jrlMathTools::Matrix3x3< T > Struct Template Reference

Generic 3x3 matrix. More...

#include <jrl/mathtools/matrix3x3.hh>

Collaboration diagram for jrlMathTools::Matrix3x3< T >:

Public Member Functions

 Matrix3x3 ()
 Default constructor. More...
 
 Matrix3x3 (const T x)
 Constructor form a scalar. More...
 
 Matrix3x3 (const T x0, const T x1, const T x2, const T x3, const T x4, const T x5, const T x6, const T x7, const T x8)
 Constructor from 9 scalars. More...
 
 Matrix3x3 (const Matrix3x3< T > &v)
 Copy constructor. More...
 
template<typename T2 >
 Matrix3x3 (const Matrix3x3< T2 > &v)
 Hybrid copy constructor. More...
 
T & operator[] (unsigned int i)
 i-th element considering the matrix as an array. More...
 
const T & operator[] (unsigned int i) const
 i-th element considering the matrix as an array. More...
 
T & operator() (unsigned int i, unsigned int j)
 Access by giving the (i,j) element. More...
 
const T & operator() (unsigned int i, unsigned int j) const
 Access by giving the (i,j) element. More...
 
void setZero ()
 Set to zero matrix. More...
 
void setIdentity ()
 Set to identity. More...
 
Matrix3x3< T > operator+ (const Matrix3x3< T > &B) const
 Adition operator. More...
 
Matrix3x3< T > operator- (const Matrix3x3< T > &B) const
 Substraction operator. More...
 
Matrix3x3< T > operator* (const Matrix3x3< T > &B) const
 Multiplication operator with another matrix. More...
 
void CeqthismulB (const Matrix3x3< T > &B, Matrix3x3< T > &C) const
 
Matrix3x3< T > operator* (const T &r) const
 Multiplication operator with a constant. More...
 
Matrix3x3< T > Transpose () const
 Transposition. More...
 
void Transpose (Matrix3x3< T > &A) const
 Transposition. More...
 
void Inversion (Matrix3x3< T > &A) const
 Inversion. More...
 
determinant () const
 Determinant. More...
 
void Fill (T value)
 Fills with value. More...
 
bool IsIdentity () const
 returns true if matrix is identity. More...
 
void operator+= (const Matrix3x3< T > &B)
 Self matrix addition. More...
 
void operator-= (const Matrix3x3< T > &B)
 Local matrix subtraction. More...
 
void operator*= (const Matrix3x3< T > &B)
 Local matrix multiplication. More...
 
void operator*= (const T &t)
 Matrix product with a scalar. More...
 
std::ostream & display (std::ostream &os) const
 

Public Attributes

m [9]
 The data array. More...
 

Detailed Description

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

Generic 3x3 matrix.

This matrix has been designed to be as simple and efficient as possible.

Constructor & Destructor Documentation

◆ Matrix3x3() [1/5]

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

Default constructor.

◆ Matrix3x3() [2/5]

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

Constructor form a scalar.

◆ Matrix3x3() [3/5]

template<typename T>
jrlMathTools::Matrix3x3< T >::Matrix3x3 ( const T  x0,
const T  x1,
const T  x2,
const T  x3,
const T  x4,
const T  x5,
const T  x6,
const T  x7,
const T  x8 
)
inlineexplicit

Constructor from 9 scalars.

◆ Matrix3x3() [4/5]

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

Copy constructor.

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

◆ Matrix3x3() [5/5]

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

Hybrid copy constructor.

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

Member Function Documentation

◆ CeqthismulB()

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

◆ determinant()

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

Determinant.

Referenced by jrlMathTools::Matrix3x3< T >::Inversion().

◆ display()

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

◆ Fill()

template<typename T>
void jrlMathTools::Matrix3x3< T >::Fill ( value)
inline

Fills with value.

◆ Inversion()

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

◆ IsIdentity()

template<typename T>
bool jrlMathTools::Matrix3x3< T >::IsIdentity ( ) const
inline

returns true if matrix is identity.

◆ operator()() [1/2]

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

Access by giving the (i,j) element.

◆ operator()() [2/2]

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

Access by giving the (i,j) element.

◆ operator*() [1/2]

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

Multiplication operator with another matrix.

Referenced by jrlMathTools::Matrix3x3< T >::operator*().

◆ operator*() [2/2]

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

Multiplication operator with a constant.

References jrlMathTools::Matrix3x3< T >::CeqthismulB(), and jrlMathTools::Matrix3x3< T >::operator*().

◆ operator*=() [1/2]

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

Local matrix multiplication.

◆ operator*=() [2/2]

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

Matrix product with a scalar.

◆ operator+()

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

Adition operator.

◆ operator+=()

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

Self matrix addition.

◆ operator-()

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

Substraction operator.

◆ operator-=()

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

Local matrix subtraction.

◆ operator[]() [1/2]

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

i-th element considering the matrix as an array.

◆ operator[]() [2/2]

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

i-th element considering the matrix as an array.

◆ setIdentity()

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

Set to identity.

◆ setZero()

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

Set to zero matrix.

◆ Transpose() [1/2]

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

Transposition.

◆ Transpose() [2/2]

template<typename T>
void jrlMathTools::Matrix3x3< T >::Transpose ( Matrix3x3< T > &  A) const
inline

Transposition.

Member Data Documentation

◆ m