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.
 
 Matrix (const Matrix &inM2)
 
uint GetRows () const
 Dimensions.
 
uint GetCols () const
 
void SetZero ()
 Zero matrix.
 
bool IsZero () const
 Check if this matrix consists of all zeros.
 
void SetIdentity ()
 Identity matrix.
 
bool IsIdentity () const
 Check if this matrix is identity.
 
void SetDiagonal (const Vector< Rows< Cols? Rows :Cols > &inV)
 Diagonal matrix.
 
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.
 
float operator() (uint inRow, uint inColumn) const
 Get float component by element index.
 
float & operator() (uint inRow, uint inColumn)
 
bool operator== (const Matrix &inM2) const
 Comparison.
 
bool operator!= (const Matrix &inM2) const
 
Matrixoperator= (const Matrix &inM2)
 Assignment.
 
template<uint OtherCols>
Matrix< Rows, OtherCols > operator* (const Matrix< Cols, OtherCols > &inM) const
 Multiply matrix by matrix.
 
Vector< Rows > operator* (const Vector< Cols > &inV) const
 Multiply vector by matrix.
 
Matrix operator* (float inV) const
 Multiply matrix with float.
 
Matrix operator+ (const Matrix &inM) const
 Per element addition of matrix.
 
Matrix operator- (const Matrix &inM) const
 Per element subtraction of matrix.
 
Matrix< Cols, Rows > Transposed () const
 Transpose matrix.
 
bool SetInversed (const Matrix &inM)
 Inverse matrix.
 
Matrix Inversed () const
 
const Vector< Rows > & GetColumn (int inIdx) const
 Column access.
 
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.
 

Friends

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

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 Symbol 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: