Jolt Physics
A multi core friendly Game Physics Engine
Loading...
Searching...
No Matches
Matrix< Rows, Cols > Class Template Reference

Templatized matrix class. More...

#include <Matrix.h>

Public Member Functions

 Matrix ()=default
 Constructor. More...
 
 Matrix (const Matrix &inM2)
 
uint GetRows () const
 Dimensions. More...
 
uint GetCols () const
 
void SetZero ()
 Zero matrix. More...
 
bool IsZero () const
 Check if this matrix consists of all zeros. More...
 
void SetIdentity ()
 Identity matrix. More...
 
bool IsIdentity () const
 Check if this matrix is identity. More...
 
void SetDiagonal (const Vector< Rows< Cols? Rows :Cols > &inV)
 Diagonal matrix. More...
 
template<class OtherMatrix >
void CopyPart (const OtherMatrix &inM, uint inSourceRow, uint inSourceCol, uint inNumRows, uint inNumCols, uint inDestRow, uint inDestCol)
 Copy a (part) of another matrix into this matrix. More...
 
float operator() (uint inRow, uint inColumn) const
 Get float component by element index. More...
 
float & operator() (uint inRow, uint inColumn)
 
bool operator== (const Matrix &inM2) const
 Comparison. More...
 
bool operator!= (const Matrix &inM2) const
 
Matrixoperator= (const Matrix &inM2)
 Assignment. More...
 
template<uint OtherCols>
Matrix< Rows, OtherCols > operator* (const Matrix< Cols, OtherCols > &inM) const
 Multiply matrix by matrix. More...
 
Vector< Rows > operator* (const Vector< Cols > &inV) const
 Multiply vector by matrix. More...
 
Matrix operator* (float inV) const
 Multiply matrix with float. More...
 
Matrix operator+ (const Matrix &inM) const
 Per element addition of matrix. More...
 
Matrix operator- (const Matrix &inM) const
 Per element subtraction of matrix. More...
 
Matrix< Cols, Rows > Transposed () const
 Transpose matrix. More...
 
bool SetInversed (const Matrix &inM)
 Inverse matrix. More...
 
Matrix Inversed () const
 
const Vector< Rows > & GetColumn (int inIdx) const
 Column access. More...
 
Vector< Rows > & GetColumn (int inIdx)
 

Static Public Member Functions

static Matrix sZero ()
 
static Matrix sIdentity ()
 
static Matrix sDiagonal (const Vector< Rows< Cols? Rows :Cols > &inV)
 

Public Attributes

Vector< Rows > mCol [Cols]
 Column. More...
 

Friends

Matrix operator* (float inV, const Matrix &inM)
 
ostream & operator<< (ostream &inStream, const Matrix &inM)
 To String. More...
 

Detailed Description

template<uint Rows, uint Cols>
class Matrix< Rows, Cols >

Templatized matrix class.

Constructor & Destructor Documentation

◆ Matrix() [1/2]

template<uint Rows, uint Cols>
Matrix< Rows, Cols >::Matrix ( )
inlinedefault

Constructor.

◆ Matrix() [2/2]

template<uint Rows, uint Cols>
Matrix< Rows, Cols >::Matrix ( const Matrix< Rows, Cols > &  inM2)
inline

Member Function Documentation

◆ CopyPart()

template<uint Rows, uint Cols>
template<class OtherMatrix >
void Matrix< Rows, Cols >::CopyPart ( const OtherMatrix< Rows, Cols > &  inM,
uint  inSourceRow,
uint  inSourceCol,
uint  inNumRows,
uint  inNumCols,
uint  inDestRow,
uint  inDestCol 
)
inline

Copy a (part) of another matrix into this matrix.

◆ GetCols()

template<uint Rows, uint Cols>
uint Matrix< Rows, Cols >::GetCols ( ) const
inline

◆ GetColumn() [1/2]

template<uint Rows, uint Cols>
Vector< Rows > & Matrix< Rows, Cols >::GetColumn ( int  inIdx)
inline

◆ GetColumn() [2/2]

template<uint Rows, uint Cols>
const Vector< Rows > & Matrix< Rows, Cols >::GetColumn ( int  inIdx) const
inline

Column access.

◆ GetRows()

template<uint Rows, uint Cols>
uint Matrix< Rows, Cols >::GetRows ( ) const
inline

Dimensions.

◆ Inversed()

template<uint Rows, uint Cols>
Matrix Matrix< Rows, Cols >::Inversed ( ) const
inline

◆ IsIdentity()

template<uint Rows, uint Cols>
bool Matrix< Rows, Cols >::IsIdentity ( ) const
inline

Check if this matrix is identity.

◆ IsZero()

template<uint Rows, uint Cols>
bool Matrix< Rows, Cols >::IsZero ( ) const
inline

Check if this matrix consists of all zeros.

◆ operator!=()

template<uint Rows, uint Cols>
bool Matrix< Rows, Cols >::operator!= ( const Matrix< Rows, Cols > &  inM2) const
inline

◆ operator()() [1/2]

template<uint Rows, uint Cols>
float & Matrix< Rows, Cols >::operator() ( uint  inRow,
uint  inColumn 
)
inline

◆ operator()() [2/2]

template<uint Rows, uint Cols>
float Matrix< Rows, Cols >::operator() ( uint  inRow,
uint  inColumn 
) const
inline

Get float component by element index.

◆ operator*() [1/3]

template<uint Rows, uint Cols>
template<uint OtherCols>
Matrix< Rows, OtherCols > Matrix< Rows, Cols >::operator* ( const Matrix< Cols, OtherCols > &  inM) const
inline

Multiply matrix by matrix.

◆ operator*() [2/3]

template<uint Rows, uint Cols>
Vector< Rows > Matrix< Rows, Cols >::operator* ( const Vector< Cols > &  inV) const
inline

Multiply vector by matrix.

◆ operator*() [3/3]

template<uint Rows, uint Cols>
Matrix Matrix< Rows, Cols >::operator* ( float  inV) const
inline

Multiply matrix with float.

◆ operator+()

template<uint Rows, uint Cols>
Matrix Matrix< Rows, Cols >::operator+ ( const Matrix< Rows, Cols > &  inM) const
inline

Per element addition of matrix.

◆ operator-()

template<uint Rows, uint Cols>
Matrix Matrix< Rows, Cols >::operator- ( const Matrix< Rows, Cols > &  inM) const
inline

Per element subtraction of matrix.

◆ operator=()

template<uint Rows, uint Cols>
Matrix & Matrix< Rows, Cols >::operator= ( const Matrix< Rows, Cols > &  inM2)
inline

Assignment.

◆ operator==()

template<uint Rows, uint Cols>
bool Matrix< Rows, Cols >::operator== ( const Matrix< Rows, Cols > &  inM2) const
inline

Comparison.

◆ sDiagonal()

template<uint Rows, uint Cols>
static Matrix Matrix< Rows, Cols >::sDiagonal ( )
inlinestatic

◆ SetDiagonal()

template<uint Rows, uint Cols>
void Matrix< Rows, Cols >::SetDiagonal ( )
inline

Diagonal matrix.

◆ SetIdentity()

template<uint Rows, uint Cols>
void Matrix< Rows, Cols >::SetIdentity ( )
inline

Identity matrix.

◆ SetInversed()

template<uint Rows, uint Cols>
bool Matrix< Rows, Cols >::SetInversed ( const Matrix< Rows, Cols > &  inM)
inline

Inverse matrix.

◆ SetZero()

template<uint Rows, uint Cols>
void Matrix< Rows, Cols >::SetZero ( )
inline

Zero matrix.

◆ sIdentity()

template<uint Rows, uint Cols>
static Matrix Matrix< Rows, Cols >::sIdentity ( )
inlinestatic

◆ sZero()

template<uint Rows, uint Cols>
static Matrix Matrix< Rows, Cols >::sZero ( )
inlinestatic

◆ Transposed()

template<uint Rows, uint Cols>
Matrix< Cols, Rows > Matrix< Rows, Cols >::Transposed ( ) const
inline

Transpose matrix.

Friends And Related Function Documentation

◆ operator*

template<uint Rows, uint Cols>
Matrix operator* ( float  inV,
const Matrix< Rows, Cols > &  inM 
)
friend

◆ operator<<

template<uint Rows, uint Cols>
ostream & operator<< ( ostream &  inStream,
const Matrix< Rows, Cols > &  inM 
)
friend

To String.

Member Data Documentation

◆ mCol

template<uint Rows, uint Cols>
Vector<Rows> Matrix< Rows, Cols >::mCol[Cols]

Column.


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