Loading...
Searching...
No Matches
jrlMathTools::Matrix4x4< T > Struct Template Reference

Generic 4x4 matrix. More...

#include <jrl/mathtools/matrix4x4.hh>

Public Member Functions

 Matrix4x4 ()
 Defaut constructor.
 
 Matrix4x4 (const T x)
 Constructor form a scalar.
 
 Matrix4x4 (const Matrix4x4< T > &v)
 Copy constructor.
 
template<typename T2>
 Matrix4x4 (const Matrix4x4< T2 > &v)
 Hybrid copy constructor.
 
T & operator[] (unsigned int i)
 ith element considering the matrix as an array.
 
const T & operator[] (unsigned int i) const
 ith element considering the matrix as an array.
 
T & operator() (unsigned int i, unsigned int j)
 Access by giving the (i,j) element.
 
T operator() (unsigned int i, unsigned int j) const
 Access by giving the (i,j) element.
 
void setZero (void)
 Set to zero matrix.
 
void setIdentity ()
 Set to identity.
 
Matrix4x4< T > operator+ (const Matrix4x4< T > &B) const
 Addition operator.
 
Matrix4x4< T > operator- (const Matrix4x4< T > &B) const
 Substraction operator.
 
Matrix4x4< T > operator* (const Matrix4x4< T > &B) const
 Multiplication operator with another matrix.
 
void CeqthismulB (const Matrix4x4< T > &B, Matrix4x4< T > &C) const
 
void CeqthismulB (const Vector4D< T > &B, Vector4D< T > &C) const
 
Vector3D< T > operator* (const Vector3D< T > &B) const
 Multiplication operator with another vector.
 
Vector4D< T > operator* (const Vector4D< T > &B) const
 Multiplication operator with a vector 4d.
 
Matrix4x4< T > operator* (const T &r) const
 Multiplication operator with a constant.
 
Matrix4x4< T > Transpose () const
 Transposition.
 
void Inversion (Matrix4x4 &A) const
 Inversion.
 
Matrix4x4< T > Inversion ()
 Inversion.
 
T determinant () const
 Determinant.
 
T trace () const
 
void operator+= (const Matrix3x3< T > &B)
 Self matrix addition.
 
void operator-= (const Matrix4x4< T > &B)
 Local matrix subtraction.
 
void operator*= (const Matrix4x4< T > &B)
 Local matrix multiplication.
 
void operator*= (const T &t)
 Local matrix multiplication.
 
std::ostream & display (std::ostream &os) const
 

Public Attributes

T m [16]
 The data array.
 

Detailed Description

template<typename T>
struct jrlMathTools::Matrix4x4< T >

Generic 4x4 matrix.

Constructor & Destructor Documentation

◆ Matrix4x4() [1/4]

template<typename T>
jrlMathTools::Matrix4x4< T >::Matrix4x4 ( )
inline

◆ Matrix4x4() [2/4]

template<typename T>
jrlMathTools::Matrix4x4< T >::Matrix4x4 ( const T x)
inline

Constructor form a scalar.

◆ Matrix4x4() [3/4]

template<typename T>
jrlMathTools::Matrix4x4< T >::Matrix4x4 ( const Matrix4x4< T > & v)
inline

Copy constructor.

◆ Matrix4x4() [4/4]

template<typename T>
template<typename T2>
jrlMathTools::Matrix4x4< T >::Matrix4x4 ( const Matrix4x4< T2 > & v)
inline

Hybrid copy constructor.

Member Function Documentation

◆ CeqthismulB() [1/2]

template<typename T>
void jrlMathTools::Matrix4x4< T >::CeqthismulB ( const Matrix4x4< T > & B,
Matrix4x4< T > & C ) const
inline

References m, and Matrix4x4().

◆ CeqthismulB() [2/2]

template<typename T>
void jrlMathTools::Matrix4x4< T >::CeqthismulB ( const Vector4D< T > & B,
Vector4D< T > & C ) const
inline

◆ determinant()

template<typename T>
T jrlMathTools::Matrix4x4< T >::determinant ( ) const
inline

Determinant.

References m.

Referenced by Inversion(), and Inversion().

◆ display()

template<typename T>
std::ostream & jrlMathTools::Matrix4x4< T >::display ( std::ostream & os) const
inline

References m.

Referenced by jrlMathTools::operator<<().

◆ Inversion() [1/2]

template<typename T>
Matrix4x4< T > jrlMathTools::Matrix4x4< T >::Inversion ( )
inline

Inversion.

References determinant(), m, and Matrix4x4().

◆ Inversion() [2/2]

template<typename T>
void jrlMathTools::Matrix4x4< T >::Inversion ( Matrix4x4< T > & A) const
inline

Inversion.

References determinant(), m, and Matrix4x4().

◆ operator()() [1/2]

template<typename T>
T & jrlMathTools::Matrix4x4< T >::operator() ( unsigned int i,
unsigned int j )
inline

Access by giving the (i,j) element.

References m.

◆ operator()() [2/2]

template<typename T>
T jrlMathTools::Matrix4x4< T >::operator() ( unsigned int i,
unsigned int j ) const
inline

Access by giving the (i,j) element.

References m.

◆ operator*() [1/4]

template<typename T>
Matrix4x4< T > jrlMathTools::Matrix4x4< T >::operator* ( const Matrix4x4< T > & B) const
inline

Multiplication operator with another matrix.

References m, and Matrix4x4().

◆ operator*() [2/4]

template<typename T>
Matrix4x4< T > jrlMathTools::Matrix4x4< T >::operator* ( const T & r) const
inline

Multiplication operator with a constant.

References m, and Matrix4x4().

◆ operator*() [3/4]

template<typename T>
Vector3D< T > jrlMathTools::Matrix4x4< T >::operator* ( const Vector3D< T > & B) const
inline

Multiplication operator with another vector.

References m, jrlMathTools::Vector3D< T >::m_x, jrlMathTools::Vector3D< T >::m_y, and jrlMathTools::Vector3D< T >::m_z.

◆ operator*() [4/4]

template<typename T>
Vector4D< T > jrlMathTools::Matrix4x4< T >::operator* ( const Vector4D< T > & B) const
inline

◆ operator*=() [1/2]

template<typename T>
void jrlMathTools::Matrix4x4< T >::operator*= ( const Matrix4x4< T > & B)
inline

Local matrix multiplication.

References m, and Matrix4x4().

◆ operator*=() [2/2]

template<typename T>
void jrlMathTools::Matrix4x4< T >::operator*= ( const T & t)
inline

Local matrix multiplication.

References m.

◆ operator+()

template<typename T>
Matrix4x4< T > jrlMathTools::Matrix4x4< T >::operator+ ( const Matrix4x4< T > & B) const
inline

Addition operator.

References m, and Matrix4x4().

◆ operator+=()

template<typename T>
void jrlMathTools::Matrix4x4< T >::operator+= ( const Matrix3x3< T > & B)
inline

Self matrix addition.

References jrlMathTools::Matrix3x3< T >::m, and m.

◆ operator-()

template<typename T>
Matrix4x4< T > jrlMathTools::Matrix4x4< T >::operator- ( const Matrix4x4< T > & B) const
inline

Substraction operator.

References m, and Matrix4x4().

◆ operator-=()

template<typename T>
void jrlMathTools::Matrix4x4< T >::operator-= ( const Matrix4x4< T > & B)
inline

Local matrix subtraction.

References m, and Matrix4x4().

◆ operator[]() [1/2]

template<typename T>
T & jrlMathTools::Matrix4x4< T >::operator[] ( unsigned int i)
inline

ith element considering the matrix as an array.

References m.

◆ operator[]() [2/2]

template<typename T>
const T & jrlMathTools::Matrix4x4< T >::operator[] ( unsigned int i) const
inline

ith element considering the matrix as an array.

References m.

◆ setIdentity()

template<typename T>
void jrlMathTools::Matrix4x4< T >::setIdentity ( )
inline

Set to identity.

References m, and setZero().

◆ setZero()

template<typename T>
void jrlMathTools::Matrix4x4< T >::setZero ( void )
inline

Set to zero matrix.

References m.

Referenced by setIdentity().

◆ trace()

template<typename T>
T jrlMathTools::Matrix4x4< T >::trace ( ) const
inline

References m.

◆ Transpose()

template<typename T>
Matrix4x4< T > jrlMathTools::Matrix4x4< T >::Transpose ( ) const
inline

Transposition.

References m, and Matrix4x4().

Member Data Documentation

◆ m