Go to the documentation of this file.
7 #ifndef INCLUDE_JET_SIZE3_H_
8 #define INCLUDE_JET_SIZE3_H_
36 constexpr
Size3(
size_t x_,
size_t y_,
size_t z_) :
x(x_),
y(y_),
z(z_) {}
43 Size3(
const std::initializer_list<U>& lst);
54 void set(
size_t x,
size_t y,
size_t z);
61 void set(
const std::initializer_list<U>& lst);
137 const size_t&
at(
size_t i)
const;
140 size_t&
at(
size_t i);
175 template <
typename U>
268 #include "detail/size3-inl.h"
270 #endif // INCLUDE_JET_SIZE3_H_
Point2< T > ceil(const Point2< T > &a)
Returns element-wise ceiled point.
void imul(size_t v)
Computes this *= (v, v, v).
Size3 div(const Size3 &v) const
Computes this / (v.x, v.y, v.z).
Size3 add(const Size3 &v) const
Computes this + (v.x, v.y, v.z).
void imul(const Size3 &v)
Computes this *= (v.x, v.y, v.z).
bool operator!=(const Size3 &v) const
Returns true if other is the not same as this size.
Size3 rsub(const Size3 &v) const
Computes (v.x, v.y, v.z) - this.
size_t subminantAxis() const
Returns the index of the subminant axis.
Size3 rsub(size_t v) const
Computes (v, v, v) - this.
constexpr Size3(const Size3 &v)
Copy constructor.
Definition: size3.h:46
size_t sum() const
Returns the sum of all the components (i.e. x + y).
Size3 & operator-=(size_t v)
Computes this -= (v, v, v)
size_t dominantAxis() const
Returns the index of the dominant axis.
Size3 & operator-=(const Size3 &v)
Computes this -= (v.x, v.y, v.z)
const size_t & operator[](size_t i) const
Returns const reference to the i -th element of the size.
Point2< T > max(const Point2< T > &a, const Point2< T > &b)
Returns element-wise max point: (max(a.x, b.x), max(a.y, b.y)).
void idiv(const Size3 &v)
Computes this /= (v.x, v.y, v.z).
void iadd(size_t v)
Computes this += (v, v, v).
void iadd(const Size3 &v)
Computes this += (v.x, v.y, v.z).
Size3 rdiv(const Size3 &v) const
Computes (v.x, v.y, v.z) / this.
Size3 div(size_t v) const
Computes this / (v, v, v).
Size3 & operator/=(size_t v)
Computes this /= (v, v, v)
void set(const Size3 &v)
Set x, y, and z with other size pt.
Size3 sub(size_t v) const
Computes this - (v, v, v).
size_t min() const
Returns the minimum value among x, y, and z.
void set(size_t s)
Set all x, y, and z components to s.
size_t z
Z (or the third) component of the size.
Definition: size3.h:28
void set(const std::initializer_list< U > &lst)
Set x, y, and z components with given initializer list.
Definition: advection_solver2.h:18
Size3 mul(size_t v) const
Computes this * (v, v, v).
Size3(const std::initializer_list< U > &lst)
Constructs size with initializer list.
void isub(const Size3 &v)
Computes this -= (v.x, v.y, v.z).
size_t max() const
Returns the maximum value among x, y, and z.
T clamp(T val, T low, T high)
Returns the clamped value.
Size3 & operator*=(size_t v)
Computes this *= (v, v, v)
Matrix2x2< T > operator+(const Matrix2x2< T > &a, const Matrix2x2< T > &b)
Returns a + b (element-size).
void set(size_t x, size_t y, size_t z)
Set x, y, and z components with given parameters.
Point2< T > floor(const Point2< T > &a)
Returns element-wise floored point.
const size_t & at(size_t i) const
Returns const reference to the i -th element of the size.
void set(const Size2 &sz, size_t z)
Set x, y, and z components with given sz.x, sz.y, and z.
3-D size class.
Definition: size3.h:19
void isub(size_t v)
Computes this -= (v, v, v).
size_t absmax() const
Returns the absolute maximum value among x, y, and z.
constexpr Size3(size_t x_, size_t y_, size_t z_)
Constructs size with given parameters x_, y_, and z_.
Definition: size3.h:36
void setZero()
Set both x, y, and z to zero.
2-D size class.
Definition: size2.h:19
Size3 rdiv(size_t v) const
Computes (v, v, v) / this.
Size3 mul(const Size3 &v) const
Computes this * (v.x, v.y, v.z).
size_t & operator[](size_t i)
Returns reference to the i -th element of the size.
Size3 & operator/=(const Size3 &v)
Computes this /= (v.x, v.y, v.z)
size_t x
X (or the first) component of the size.
Definition: size3.h:22
Size3 sub(const Size3 &v) const
Computes this - (v.x, v.y, v.z).
Size3 & operator=(const std::initializer_list< U > &lst)
Set x, y, and z components with given initializer list.
bool operator==(const Size3 &v) const
Returns true if other is the same as this size.
Matrix2x2< T > operator/(const Matrix2x2< T > &a, T b)
Returns a' / b, where every element of matrix a' is a.
Size3 & operator=(const Size3 &v)
Set x, y, and z with other size pt.
Point2< T > min(const Point2< T > &a, const Point2< T > &b)
Returns element-wise min point: (min(a.x, b.x), min(a.y, b.y)).
constexpr Size3(const Size2 &v, size_t z_)
Constructs size with a 2-D size and a scalar.
Definition: size3.h:39
constexpr Size3()
Constructs default size (0, 0, 0).
Definition: size3.h:33
Size3 & operator*=(const Size3 &v)
Computes this *= (v.x, v.y, v.z)
Size3 add(size_t v) const
Computes this + (v, v, v).
Matrix2x2< T > operator-(const Matrix2x2< T > &a)
Returns a matrix with opposite sign.
size_t absmin() const
Returns the absolute minimum value among x, y, and z.
void idiv(size_t v)
Computes this /= (v, v, v).
Matrix2x2< T > operator*(const Matrix2x2< T > &a, T b)
Returns a * b', where every element of matrix b' is b.
Size3 & operator+=(const Size3 &v)
Computes this += (v.x, v.y, v.z)
bool isEqual(const Size3 &other) const
Returns true if other is the same as this size.
size_t y
Y (or the second) component of the size.
Definition: size3.h:25
Size3 & operator+=(size_t v)
Computes this += (v, v, v)
size_t & at(size_t i)
Returns reference to the i -th element of the size.