OpenVDB 13.1.0
Loading...
Searching...
No Matches
Mat2< T > Class Template Reference

#include <nanovdb/math/Math.h>

Public Member Functions

 Mat2 ()=default
__hostdev__ Mat2 (T a, T b, T c, T d)
 Constructor given individual array elements, the ordering is in row major form:
template<typename Source>
__hostdev__ Mat2 (Source *array)
 Constructor given array of elements, the ordering is in row major form.
__hostdev__ Mat2 operator- () const
__hostdev__ Mat2< T > operator* (const Mat2< T > &m) const
 Multiply by 2x2 matrix m and return the resulting matrix.
__hostdev__ Mat2< T > & operator+= (const Mat2< T > &m)
 Add each element of the given matrix to the corresponding element of this matrix.
__hostdev__ Mat2< T > transpose () const
 returns transpose of this
__hostdev__ Mat2< T > inverse () const
 returns inverse of this
__hostdev__ T * operator[] (int row)
__hostdev__ const T * operator[] (int row) const

Static Protected Member Functions

static constexpr int rows ()
static constexpr int cols ()
static constexpr int size ()

Protected Attributes

mData [ROWS *COLS]

Constructor & Destructor Documentation

◆ Mat2() [1/3]

template<typename T>
Mat2 ( )
default

◆ Mat2() [2/3]

template<typename T>
__hostdev__ Mat2 ( T a,
T b,
T c,
T d )
inline

Constructor given individual array elements, the ordering is in row major form:

a b
c d

◆ Mat2() [3/3]

template<typename T>
template<typename Source>
__hostdev__ Mat2 ( Source * array)
inline

Constructor given array of elements, the ordering is in row major form.

Member Function Documentation

◆ cols()

constexpr int cols ( )
inlinestaticconstexprprotectedinherited

◆ inverse()

template<typename T>
__hostdev__ Mat2< T > inverse ( ) const
inline

returns inverse of this

◆ operator*()

template<typename T>
__hostdev__ Mat2< T > operator* ( const Mat2< T > & m) const
inline

Multiply by 2x2 matrix m and return the resulting matrix.

◆ operator+=()

template<typename T>
__hostdev__ Mat2< T > & operator+= ( const Mat2< T > & m)
inline

Add each element of the given matrix to the corresponding element of this matrix.

◆ operator-()

template<typename T>
__hostdev__ Mat2 operator- ( ) const
inline

◆ operator[]() [1/2]

__hostdev__ T * operator[] ( int row)
inlineinherited

◆ operator[]() [2/2]

__hostdev__ const T * operator[] ( int row) const
inlineinherited

◆ rows()

constexpr int rows ( )
inlinestaticconstexprprotectedinherited

◆ size()

constexpr int size ( )
inlinestaticconstexprprotectedinherited

◆ transpose()

template<typename T>
__hostdev__ Mat2< T > transpose ( ) const
inline

returns transpose of this

Member Data Documentation

◆ mData

T mData[ROWS *COLS]
protectedinherited