Gray C++ Libraries  0.0.2
A set of C++ libraries for MSVC, GNU on Windows, WinCE, Linux
GrayLib::cMatrixT< TYPE, _ROWS, _COLS > Class Template Reference

#include <cMatrix.h>

Public Types

typedef TYPE DVALUE_t
 

Public Member Functions

 cMatrixT () noexcept
 
 cMatrixT (const THIS_t &v) noexcept
 
 cMatrixT (const TYPE *pVals) noexcept
 
bool IsNear (const THIS_t &v2, TYPE fDist=(TYPE) k_FLT_MIN2) const
 
COMPARE_t Compare (const THIS_t &v2) const
 
bool operator== (const THIS_t &v2) const
 
bool operator!= (const THIS_t &v2) const
 
template<int _IDN>
void InitMul (const cMatrixT< TYPE, _ROWS, _IDN > &m1, const cMatrixT< TYPE, _IDN, _COLS > &m2)
 
TYPERefRow (int nRow)
 
const TYPEGetRow (int nRow) const
 
const TYPEGetRow (AXIS_TYPE eAxis) const
 
void SetRow (int nRow, const TYPE *p)
 
cVecT< TYPE, _COLS > & RefRowV (int nRow)
 
const cVecT< TYPE, _COLS > & GetRowV (int nRow) const
 
void SetRowV (int nRow, const cVecT< TYPE, _COLS > &v)
 
void CopyColTo (int nCol, TYPE *pV) const
 
void CopyColToV (int nCol, cVecT< TYPE, _ROWS > &v) const
 
cVecT< TYPE, _ROWS > GetColV (int nCol) const
 
void SetCol (int nCol, const TYPE *pV)
 
void SetColV (int nCol, const cVecT< TYPE, _ROWS > &v)
 

Public Attributes

union {
   TYPE   m_a [_ROWS *_COLS]
 
   TYPE   m [_ROWS][_COLS]
 
}; 
 

Static Public Attributes

static const int k_nRows = _ROWS
 
static const int k_nCols = _COLS
 

Detailed Description

template<typename TYPE = DVALUEDEF_t, int _ROWS = 4, int _COLS = 4>
class GrayLib::cMatrixT< TYPE, _ROWS, _COLS >

a matrix of arbitrary (template) dimensions. _COLS (columns) need not be equal to _ROWS (rows).

Member Typedef Documentation

◆ DVALUE_t

template<typename TYPE = DVALUEDEF_t, int _ROWS = 4, int _COLS = 4>
typedef TYPE GrayLib::cMatrixT< TYPE, _ROWS, _COLS >::DVALUE_t

Constructor & Destructor Documentation

◆ cMatrixT() [1/3]

template<typename TYPE = DVALUEDEF_t, int _ROWS = 4, int _COLS = 4>
GrayLib::cMatrixT< TYPE, _ROWS, _COLS >::cMatrixT ( )
inlinenoexcept

ASSUME no/random/undefined init data.

◆ cMatrixT() [2/3]

template<typename TYPE = DVALUEDEF_t, int _ROWS = 4, int _COLS = 4>
GrayLib::cMatrixT< TYPE, _ROWS, _COLS >::cMatrixT ( const THIS_t v)
inlinenoexcept

◆ cMatrixT() [3/3]

template<typename TYPE = DVALUEDEF_t, int _ROWS = 4, int _COLS = 4>
GrayLib::cMatrixT< TYPE, _ROWS, _COLS >::cMatrixT ( const TYPE pVals)
inlinenoexcept

Member Function Documentation

◆ Compare()

template<typename TYPE = DVALUEDEF_t, int _ROWS = 4, int _COLS = 4>
COMPARE_t GrayLib::cMatrixT< TYPE, _ROWS, _COLS >::Compare ( const THIS_t v2) const
inline

◆ CopyColTo()

template<typename TYPE = DVALUEDEF_t, int _ROWS = 4, int _COLS = 4>
void GrayLib::cMatrixT< TYPE, _ROWS, _COLS >::CopyColTo ( int  nCol,
TYPE pV 
) const
inline

◆ CopyColToV()

template<typename TYPE = DVALUEDEF_t, int _ROWS = 4, int _COLS = 4>
void GrayLib::cMatrixT< TYPE, _ROWS, _COLS >::CopyColToV ( int  nCol,
cVecT< TYPE, _ROWS > &  v 
) const
inline

◆ GetColV()

template<typename TYPE = DVALUEDEF_t, int _ROWS = 4, int _COLS = 4>
cVecT<TYPE, _ROWS> GrayLib::cMatrixT< TYPE, _ROWS, _COLS >::GetColV ( int  nCol) const
inline

◆ GetRow() [1/2]

template<typename TYPE = DVALUEDEF_t, int _ROWS = 4, int _COLS = 4>
const TYPE* GrayLib::cMatrixT< TYPE, _ROWS, _COLS >::GetRow ( AXIS_TYPE  eAxis) const
inline

◆ GetRow() [2/2]

template<typename TYPE = DVALUEDEF_t, int _ROWS = 4, int _COLS = 4>
const TYPE* GrayLib::cMatrixT< TYPE, _ROWS, _COLS >::GetRow ( int  nRow) const
inline

Only really useful for row-major matrices in a left-handed space. (DX not OpenGL) otherwise use GetRowV, GetColV

◆ GetRowV()

template<typename TYPE = DVALUEDEF_t, int _ROWS = 4, int _COLS = 4>
const cVecT<TYPE, _COLS>& GrayLib::cMatrixT< TYPE, _ROWS, _COLS >::GetRowV ( int  nRow) const
inline

◆ InitMul()

template<typename TYPE = DVALUEDEF_t, int _ROWS = 4, int _COLS = 4>
template<int _IDN>
void GrayLib::cMatrixT< TYPE, _ROWS, _COLS >::InitMul ( const cMatrixT< TYPE, _ROWS, _IDN > &  m1,
const cMatrixT< TYPE, _IDN, _COLS > &  m2 
)
inline

Set with result of multiply of 2 matrices.

Note
Order IS important when multiply of matrix! A*B != B*A matrices are XY size transposed of each other. see http://www.purplemath.com/modules/mtrxmult.htm

◆ IsNear()

template<typename TYPE = DVALUEDEF_t, int _ROWS = 4, int _COLS = 4>
bool GrayLib::cMatrixT< TYPE, _ROWS, _COLS >::IsNear ( const THIS_t v2,
TYPE  fDist = (TYPE)k_FLT_MIN2 
) const
inline

Are these 2 matrices near each other ?

◆ operator!=()

template<typename TYPE = DVALUEDEF_t, int _ROWS = 4, int _COLS = 4>
bool GrayLib::cMatrixT< TYPE, _ROWS, _COLS >::operator!= ( const THIS_t v2) const
inline

◆ operator==()

template<typename TYPE = DVALUEDEF_t, int _ROWS = 4, int _COLS = 4>
bool GrayLib::cMatrixT< TYPE, _ROWS, _COLS >::operator== ( const THIS_t v2) const
inline

◆ RefRow()

template<typename TYPE = DVALUEDEF_t, int _ROWS = 4, int _COLS = 4>
TYPE* GrayLib::cMatrixT< TYPE, _ROWS, _COLS >::RefRow ( int  nRow)
inline

Only really useful for row-major matrices in a left-handed space. (DX not OpenGL) otherwise use GetRowV, GetColV

◆ RefRowV()

template<typename TYPE = DVALUEDEF_t, int _ROWS = 4, int _COLS = 4>
cVecT<TYPE, _COLS>& GrayLib::cMatrixT< TYPE, _ROWS, _COLS >::RefRowV ( int  nRow)
inline

◆ SetCol()

template<typename TYPE = DVALUEDEF_t, int _ROWS = 4, int _COLS = 4>
void GrayLib::cMatrixT< TYPE, _ROWS, _COLS >::SetCol ( int  nCol,
const TYPE pV 
)
inline

◆ SetColV()

template<typename TYPE = DVALUEDEF_t, int _ROWS = 4, int _COLS = 4>
void GrayLib::cMatrixT< TYPE, _ROWS, _COLS >::SetColV ( int  nCol,
const cVecT< TYPE, _ROWS > &  v 
)
inline

◆ SetRow()

template<typename TYPE = DVALUEDEF_t, int _ROWS = 4, int _COLS = 4>
void GrayLib::cMatrixT< TYPE, _ROWS, _COLS >::SetRow ( int  nRow,
const TYPE p 
)
inline

◆ SetRowV()

template<typename TYPE = DVALUEDEF_t, int _ROWS = 4, int _COLS = 4>
void GrayLib::cMatrixT< TYPE, _ROWS, _COLS >::SetRowV ( int  nRow,
const cVecT< TYPE, _COLS > &  v 
)
inline

Member Data Documentation

◆ 

union { ... }

◆ k_nCols

template<typename TYPE = DVALUEDEF_t, int _ROWS = 4, int _COLS = 4>
const int GrayLib::cMatrixT< TYPE, _ROWS, _COLS >::k_nCols = _COLS
static

◆ k_nRows

template<typename TYPE = DVALUEDEF_t, int _ROWS = 4, int _COLS = 4>
const int GrayLib::cMatrixT< TYPE, _ROWS, _COLS >::k_nRows = _ROWS
static

◆ m

template<typename TYPE = DVALUEDEF_t, int _ROWS = 4, int _COLS = 4>
TYPE GrayLib::cMatrixT< TYPE, _ROWS, _COLS >::m[_ROWS][_COLS]

◆ m_a

template<typename TYPE = DVALUEDEF_t, int _ROWS = 4, int _COLS = 4>
TYPE GrayLib::cMatrixT< TYPE, _ROWS, _COLS >::m_a[_ROWS *_COLS]

The documentation for this class was generated from the following file: