49template <
typename T,
size_t N>
54 VectorN(std::array<T, N>& arr) :
std::array<T, N>(arr) {}
56 VectorN(
const std::array<T, N>& arr) { std::copy(arr.begin(), arr.end(), this->begin()); }
60 for (
size_t i = 0; i < N; ++i) {
61 result[i] = (*this)[i] + other[i];
69 for (
size_t i = 0; i < N; ++i) {
70 result[i] = (*this)[i] - other[i];
77 for (
size_t i = 0; i < N; ++i) {
78 result[i] = (*this)[i] - other[i];
85 for (
size_t i = 0; i < N; ++i) {
86 result[i] = -(*this)[i];
93 for (
size_t i = 0; i < N; ++i) {
94 (*this)[i] += other[i];
108inline std::string
zeroPad(
size_t value,
size_t width) {
109 std::ostringstream oss;
110 oss << std::setw(width) << std::setfill(
'0') << value;
117inline size_t roundUp(
const size_t& number,
const size_t& multiple) {
return (number + multiple - 1) & -multiple; }
VectorN(const std::array< T, N > &arr)
Definition utils.hpp:56
VectorN(T x, T y, T z)
Definition utils.hpp:53
VectorN< double, N > operator-(const VectorN< double, N > &other) const
Definition utils.hpp:75
VectorN(std::array< T, N > &&arr)
Definition utils.hpp:55
VectorN< T, N > operator+(const VectorN< U, N > &other) const
Definition utils.hpp:58
VectorN(std::array< T, N > &arr)
Definition utils.hpp:54
VectorN< T, N > & operator/=(const U &val)
Definition utils.hpp:100
VectorN< T, N > & operator+=(const VectorN< U, N > &other)
Definition utils.hpp:92
VectorN< T, N > operator-() const
Definition utils.hpp:83
VectorN< T, N > operator-(const VectorN< U, N > &other) const
Definition utils.hpp:67
VectorN()
Definition utils.hpp:52
Definition jobManagement.hpp:72
Definition jobManagement.hpp:50
std::string zeroPad(size_t value, size_t width)
Definition utils.hpp:108
size_t roundUp(const size_t &number, const size_t &multiple)
Definition utils.hpp:117