![]() |
OpenVDB 14.0.0
|
2x2 row-major matrix. More...
#include <nanovdb/math/Math.h>
Public Types | |
| using | ValueType |
Public Member Functions | |
| Mat2 () noexcept=default | |
Default-construct (entries left uninitialized for fundamental T). | |
| __hostdev__ constexpr | Mat2 (T a, T b, T c, T d) noexcept |
| Constructor given individual array elements, the ordering is in row major form: | |
| template<typename Source> | |
| __hostdev__ constexpr | Mat2 (Source *array) noexcept |
| Constructor given array of elements, the ordering is in row major form. | |
| __hostdev__ constexpr Mat2 | operator- () const noexcept |
| __hostdev__ constexpr Mat2 | operator+ (const Mat2 &m) const noexcept |
| __hostdev__ constexpr Mat2 | operator- (const Mat2 &m) const noexcept |
| __hostdev__ constexpr Mat2 & | operator+= (const Mat2 &m) noexcept |
| __hostdev__ constexpr Mat2 & | operator-= (const Mat2 &m) noexcept |
| __hostdev__ constexpr Mat2 | operator* (const Mat2 &m) const noexcept |
| __hostdev__ constexpr Vec2< T > | operator* (const Vec2< T > &v) const noexcept |
| __hostdev__ constexpr Mat2 | operator* (const T &s) const noexcept |
| __hostdev__ constexpr Mat2 | operator/ (const T &s) const noexcept |
| __hostdev__ constexpr Mat2 & | operator*= (const T &s) noexcept |
| __hostdev__ constexpr Mat2 & | operator/= (const T &s) noexcept |
| __hostdev__ constexpr bool | operator== (const Mat2 &m) const noexcept |
| __hostdev__ constexpr bool | operator!= (const Mat2 &m) const noexcept |
| __hostdev__ constexpr Mat2 | transpose () const noexcept |
| returns transpose of this | |
| __hostdev__ constexpr Mat2< T > | inverse () const noexcept |
| returns inverse of this | |
| __hostdev__ constexpr T * | operator[] (int row) noexcept |
2D row access. Returns a pointer to the start of row; the caller indexes into it with the column. Asserts 0 <= row < ROWS in debug builds; column index is the caller's responsibility (use 0 <= col < COLS). | |
| __hostdev__ constexpr const T * | operator[] (int row) const noexcept |
Const overload of operator[](int); see non-const variant. | |
| __hostdev__ constexpr T * | data () noexcept |
| return a raw pointer to the underlying 1D storage (row-major) | |
| __hostdev__ constexpr const T * | data () const noexcept |
| return a const raw pointer to the underlying 1D storage (row-major) | |
| __hostdev__ constexpr Derived | plus (const Derived &rhs) const noexcept |
return *this + rhs as a Derived | |
| __hostdev__ constexpr Derived | minus (const Derived &rhs) const noexcept |
return *this - rhs as a Derived | |
| __hostdev__ constexpr Derived | negate () const noexcept |
return -(*this) as a Derived | |
| __hostdev__ constexpr Derived | scale (T s) const noexcept |
return s * (*this) as a Derived | |
| __hostdev__ constexpr MatBase & | addAssign (const MatBase &rhs) noexcept |
Element-wise add rhs into *this and return *this. | |
| __hostdev__ constexpr MatBase & | subAssign (const MatBase &rhs) noexcept |
Element-wise subtract rhs from *this and return *this. | |
| __hostdev__ constexpr MatBase & | scaleAssign (T s) noexcept |
Multiply every element by scalar s in place; return *this. s is taken by value so m *= m[0][0] scales every element by the original value. | |
| __hostdev__ constexpr Derived | divideBy (T s) const noexcept |
return (*this) / s element-wise as a Derived. Floating-point T multiplies by the reciprocal 1/s; integer T divides each element, since 1/s would truncate to zero. | |
| __hostdev__ constexpr MatBase & | divideAssignScalar (T s) noexcept |
Divide every element by scalar s in place; return *this. Uses the same floating-point reciprocal / integer per-element split as divideBy. s is taken by value so m /= m[0][0] is safe. | |
| __hostdev__ constexpr bool | equals (const MatBase &rhs) const noexcept |
Return true iff every element compares equal to rhs. | |
| __hostdev__ constexpr Result | transposeAs () const noexcept |
return the transpose of *this as the Result type. | |
| __hostdev__ constexpr Result | multiply (const Rhs &rhs) const noexcept |
return (*this) * rhs as the Result type. | |
| __hostdev__ constexpr VecResult | multiplyVec (const VecRhs &v) const noexcept |
return (*this) * v as the VecResult type. | |
Static Public Member Functions | |
| static __hostdev__ constexpr int | rows () noexcept |
| Compile-time row count. | |
| static __hostdev__ constexpr int | cols () noexcept |
| Compile-time column count. | |
| static __hostdev__ constexpr int | size () noexcept |
Compile-time element count, i.e. ROWS * COLS. | |
Static Protected Member Functions | |
| static __hostdev__ constexpr Result | generate (F f, std::integer_sequence< int, I... >) noexcept |
Return a Result whose row-major element idx is f(idx), built through its Count-element constructor. This is constexpr-valid in C++17 without first value-initializing a result and overwriting it. | |
| static __hostdev__ constexpr Result | generate (F f) noexcept |
Protected Attributes | |
| T | mData [ROWS *COLS] |
Friends | |
| __hostdev__ friend constexpr Mat2 | operator* (const T &s, const Mat2 &m) noexcept |
| scalar * Mat (hidden friend — found only via ADL on Mat2) | |
2x2 row-major matrix.
Naturally aligned (alignof(T)), like all Vec/Mat classes, so the layout of structs and buffers that hold one does not depend on this class.
|
inherited |
|
defaultnoexcept |
Default-construct (entries left uninitialized for fundamental T).
|
inlineconstexprnoexcept |
Constructor given individual array elements, the ordering is in row major form:
a b c d
|
inlineconstexprnoexcept |
Constructor given array of elements, the ordering is in row major form.
|
inlineconstexprnoexceptinherited |
Element-wise add rhs into *this and return *this.
|
inlinestaticnodiscardconstexprnoexceptinherited |
Compile-time column count.
|
inlineconstexprnoexceptinherited |
return a const raw pointer to the underlying 1D storage (row-major)
|
inlineconstexprnoexceptinherited |
return a raw pointer to the underlying 1D storage (row-major)
|
inlineconstexprnoexceptinherited |
Divide every element by scalar s in place; return *this. Uses the same floating-point reciprocal / integer per-element split as divideBy. s is taken by value so m /= m[0][0] is safe.
|
inlinenodiscardconstexprnoexceptinherited |
return (*this) / s element-wise as a Derived. Floating-point T multiplies by the reciprocal 1/s; integer T divides each element, since 1/s would truncate to zero.
|
inlinenodiscardconstexprnoexceptinherited |
Return true iff every element compares equal to rhs.
|
inlinestaticconstexprprotectednoexceptinherited |
|
inlinestaticconstexprprotectednoexceptinherited |
Return a Result whose row-major element idx is f(idx), built through its Count-element constructor. This is constexpr-valid in C++17 without first value-initializing a result and overwriting it.
|
inlinenodiscardconstexprnoexcept |
returns inverse of this
|
inlinenodiscardconstexprnoexceptinherited |
return *this - rhs as a Derived
|
inlinenodiscardconstexprnoexceptinherited |
return (*this) * rhs as the Result type.
| Result | a matrix type whose dimensions are (ROWS, Rhs::cols()) |
| Rhs | a matrix type whose row count equals COLS |
|
inlinenodiscardconstexprnoexceptinherited |
return (*this) * v as the VecResult type.
| VecResult | a vector type whose SIZE equals ROWS |
| VecRhs | a vector type whose SIZE equals COLS |
|
inlinenodiscardconstexprnoexceptinherited |
return -(*this) as a Derived
|
inlinenodiscardconstexprnoexcept |
|
inlinenodiscardconstexprnoexcept |
|
inlinenodiscardconstexprnoexcept |
|
inlinenodiscardconstexprnoexcept |
|
inlineconstexprnoexcept |
|
inlinenodiscardconstexprnoexcept |
|
inlineconstexprnoexcept |
|
inlinenodiscardconstexprnoexcept |
|
inlinenodiscardconstexprnoexcept |
|
inlineconstexprnoexcept |
|
inlinenodiscardconstexprnoexcept |
|
inlineconstexprnoexcept |
|
inlinenodiscardconstexprnoexcept |
|
inlineconstexprnoexceptinherited |
Const overload of operator[](int); see non-const variant.
|
inlineconstexprnoexceptinherited |
2D row access. Returns a pointer to the start of row; the caller indexes into it with the column. Asserts 0 <= row < ROWS in debug builds; column index is the caller's responsibility (use 0 <= col < COLS).
|
inlinenodiscardconstexprnoexceptinherited |
return *this + rhs as a Derived
|
inlinestaticnodiscardconstexprnoexceptinherited |
Compile-time row count.
|
inlinenodiscardconstexprnoexceptinherited |
return s * (*this) as a Derived
|
inlineconstexprnoexceptinherited |
Multiply every element by scalar s in place; return *this. s is taken by value so m *= m[0][0] scales every element by the original value.
|
inlinestaticnodiscardconstexprnoexceptinherited |
Compile-time element count, i.e. ROWS * COLS.
|
inlineconstexprnoexceptinherited |
Element-wise subtract rhs from *this and return *this.
|
inlinenodiscardconstexprnoexcept |
returns transpose of this
|
inlinenodiscardconstexprnoexceptinherited |
return the transpose of *this as the Result type.
| Result | a matrix type whose dimensions are (COLS, ROWS) |
|
friend |
scalar * Mat (hidden friend — found only via ADL on Mat2)
|
protectedinherited |