ML Reference
ml::Tmat5< DT > Class Template Reference

A 5x5 matrix class of five row vectors. More...

#include <mlMatrix5.h>

Inheritance diagram for ml::Tmat5< DT >:
ml::FloatingPointMatrix< Tvec5< DT >, 5 >

Public Types

typedef DT ComponentType
 A typedef to 'export' the type of components.
Public Types inherited from ml::FloatingPointMatrix< Tvec5< DT >, 5 >
enum  
enum  
enum  
typedef Tvec5< DT >::ComponentType ComponentType
 A typedef to 'export' the type of subcomponents.
typedef Tvec5< DT > VectorType
 A typedef to 'export' the type of component vector.

Public Member Functions

 Tmat5 ()
 Builds a 5x5 matrix from 25 zero elements.
 Tmat5 (const DT diagValue)
 Builds a matrix that has the argument diagValue as the diagonal values, zero otherwise.
 Tmat5 (const Tvec5< DT > &row0, const Tvec5< DT > &row1, const Tvec5< DT > &row2, const Tvec5< DT > &row3, const Tvec5< DT > &row4)
 Builds the matrix of the five row vectors row0, ..., row5.
 Tmat5 (const Tmat5< DT > &mat)
 Copy constructor from the Tmat5 mat.
 Tmat5 (const float mat[25])
 Constructor from 25 floats given as array mat, row by row.
 Tmat5 (const double mat[25])
 Constructor from 25 doubles given as array mat, row by row.
 Tmat5 (const double in00, const double in01, const double in02, const double in03, const double in04, const double in10, const double in11, const double in12, const double in13, const double in14, const double in20, const double in21, const double in22, const double in23, const double in24, const double in30, const double in31, const double in32, const double in33, const double in34, const double in40, const double in41, const double in42, const double in43, const double in44)
void setValues (const float m[25])
void getValues (float m[25]) const
void setValues (const double m[25])
void getValues (double m[25]) const
void setScaleMatrix (const DT scale)
 Sets the diagonal matrix with scale on the diagonal.
void set (const DT val)
 Sets all values to val.
bool operator< (const Tmat5< DT > &) const
const Tmat5< DT > & operator= (const Tmat5< DT > &m)
 Assigns from a Tmat5.
const Tmat5< DT > & operator+= (const Tmat5< DT > &m)
 Adds component-wise by a Tmat5.
const Tmat5< DT > & operator-= (const Tmat5< DT > &m)
 Subtracts component-wise by a Tmat5.
const Tmat5< DT > & operator*= (const DT d)
 Multiplies by a scalar constant d.
const Tmat5< DT > & operator/= (const DT d)
 Divide by a constant d. Division by zero is not handled and must be avoided by caller.
Public Member Functions inherited from ml::FloatingPointMatrix< Tvec5< DT >, 5 >
const Tvec5< DT > & operator[] (const size_t i) const
ComponentTypelinearIndexed (const size_t idx)
ComponentType linearIndexedConst (const size_t idx) const
ComponentType compAbsSum () const
void setValuesFromPtr (const ComponentType *const values)
void getValuesToPtr (ComponentType *values) const

Static Public Member Functions

static Tmat5< DT > getMat (const double val)
 Returns a matrix filled with values val.

Special Functions

DT determinantLower4 (const int col1, const int col2, const int col3, const int col4) const
 Determines the (sub)determinant of columns given by col1, col2, col3, and col4.
DT det () const
 Determinant.
Tmat5< DT > inverse (bool *isInvertible=nullptr) const
Tmat5 transpose () const
 Returns the transposed of this matrix.
const Tmat5< DT > & apply (MLDblFuncPtr fct)
 Applies the function fct to each component.
static Tmat5 getIdentity ()
 Returns the identity matrix.

Additional Inherited Members

Protected Attributes inherited from ml::FloatingPointMatrix< Tvec5< DT >, 5 >
Tvec5< DT > v [size]
 The rows constituting the matrix.

Detailed Description

template<class DT>
class ml::Tmat5< DT >

A 5x5 matrix class of five row vectors.

Definition at line 48 of file mlMatrix5.h.

Member Typedef Documentation

◆ ComponentType

template<class DT>
typedef DT ml::Tmat5< DT >::ComponentType

A typedef to 'export' the type of components.

Definition at line 53 of file mlMatrix5.h.

Constructor & Destructor Documentation

◆ Tmat5() [1/7]

template<class DT>
ml::Tmat5< DT >::Tmat5 ( )
inline

Builds a 5x5 matrix from 25 zero elements.

Builds a 5x5 matrix from 25 0 elements.

Definition at line 166 of file mlMatrix5.h.

References Tmat5(), and ml::FloatingPointMatrix< Tvec5< DT >, 5 >::v.

Referenced by apply(), getIdentity(), getMat(), inverse(), operator*=(), operator+=(), operator-=(), operator/=(), operator=(), Tmat5(), Tmat5(), Tmat5(), Tmat5(), Tmat5(), Tmat5(), Tmat5(), and transpose().

◆ Tmat5() [2/7]

template<class DT>
ml::Tmat5< DT >::Tmat5 ( const DT diagValue)
inline

Builds a matrix that has the argument diagValue as the diagonal values, zero otherwise.

Constructs a matrix that has the argument diagValue as the diagonal values, zero otherwise.

Definition at line 173 of file mlMatrix5.h.

References Tmat5(), and ml::FloatingPointMatrix< Tvec5< DT >, 5 >::v.

◆ Tmat5() [3/7]

template<class DT>
ml::Tmat5< DT >::Tmat5 ( const Tvec5< DT > & row0,
const Tvec5< DT > & row1,
const Tvec5< DT > & row2,
const Tvec5< DT > & row3,
const Tvec5< DT > & row4 )
inline

Builds the matrix of the five row vectors row0, ..., row5.

Builds a matrix of the five row vectors row0, ..., row4.

Definition at line 183 of file mlMatrix5.h.

References Tmat5(), and ml::FloatingPointMatrix< Tvec5< DT >, 5 >::v.

◆ Tmat5() [4/7]

template<class DT>
ml::Tmat5< DT >::Tmat5 ( const Tmat5< DT > & mat)
inline

Copy constructor from the Tmat5 mat.

Definition at line 195 of file mlMatrix5.h.

References Tmat5(), ml::FloatingPointMatrix< VectorT, size >::v, and ml::FloatingPointMatrix< Tvec5< DT >, 5 >::v.

◆ Tmat5() [5/7]

template<class DT>
ml::Tmat5< DT >::Tmat5 ( const float mat[25])
inline

Constructor from 25 floats given as array mat, row by row.

Definition at line 206 of file mlMatrix5.h.

References setValues(), and Tmat5().

◆ Tmat5() [6/7]

template<class DT>
ml::Tmat5< DT >::Tmat5 ( const double mat[25])
inline

Constructor from 25 doubles given as array mat, row by row.

Definition at line 213 of file mlMatrix5.h.

References setValues(), and Tmat5().

◆ Tmat5() [7/7]

template<class DT>
ml::Tmat5< DT >::Tmat5 ( const double in00,
const double in01,
const double in02,
const double in03,
const double in04,
const double in10,
const double in11,
const double in12,
const double in13,
const double in14,
const double in20,
const double in21,
const double in22,
const double in23,
const double in24,
const double in30,
const double in31,
const double in32,
const double in33,
const double in34,
const double in40,
const double in41,
const double in42,
const double in43,
const double in44 )

Initializes all matrix elements explicitly with scalars, filling it row by row.

Definition at line 366 of file mlMatrix5.h.

References Tmat5(), and ml::FloatingPointMatrix< Tvec5< DT >, 5 >::v.

Member Function Documentation

◆ apply()

template<class DT>
const Tmat5< DT > & ml::Tmat5< DT >::apply ( MLDblFuncPtr fct)

Applies the function fct to each component.

Definition at line 637 of file mlMatrix5.h.

References apply(), Tmat5(), and ml::FloatingPointMatrix< Tvec5< DT >, 5 >::v.

Referenced by apply().

◆ det()

template<class DT>
DT ml::Tmat5< DT >::det ( ) const

Determinant.

Returns the determinant of this matrix.

Definition at line 573 of file mlMatrix5.h.

References det(), determinantLower4(), and ml::FloatingPointMatrix< Tvec5< DT >, 5 >::v.

Referenced by det(), and ml::Tmat6< DT >::determinantLower5().

◆ determinantLower4()

template<class DT>
DT ml::Tmat5< DT >::determinantLower4 ( const int col1,
const int col2,
const int col3,
const int col4 ) const
inline

Determines the (sub)determinant of columns given by col1, col2, col3, and col4.

Definition at line 560 of file mlMatrix5.h.

References ml::Tmat4< DT >::det(), determinantLower4(), and ml::FloatingPointMatrix< Tvec5< DT >, 5 >::v.

Referenced by det(), and determinantLower4().

◆ getIdentity()

template<class DT>
Tmat5< DT > ml::Tmat5< DT >::getIdentity ( )
inlinestatic

Returns the identity matrix.

Definition at line 624 of file mlMatrix5.h.

References getIdentity(), and Tmat5().

Referenced by getIdentity(), and inverse().

◆ getMat()

template<class DT>
Tmat5< DT > ml::Tmat5< DT >::getMat ( const double val)
inlinestatic

Returns a matrix filled with values val.

Returns a matrix filled with values val, row by row.

Definition at line 220 of file mlMatrix5.h.

References getMat(), and Tmat5().

Referenced by getMat().

◆ getValues() [1/2]

template<class DT>
void ml::Tmat5< DT >::getValues ( double m[25]) const

Copies the contents of *this into double array m. m must point to an array with at least 25 accessible entries, row by row.

Copies the contents of *this into m, where m must provide at least 25 accessible entries, row by row.

Definition at line 501 of file mlMatrix5.h.

References getValues(), and ml::FloatingPointMatrix< Tvec5< DT >, 5 >::v.

◆ getValues() [2/2]

template<class DT>
void ml::Tmat5< DT >::getValues ( float m[25]) const

Copies the contents of *this into float array m. Note that range and precision of the float values may not be sufficient for higher precision matrix contents. m must point to an array with at least 25 accessible entries, row by row.

Definition at line 425 of file mlMatrix5.h.

References getValues(), and ml::FloatingPointMatrix< Tvec5< DT >, 5 >::v.

Referenced by getValues(), and getValues().

◆ inverse()

template<class DT>
Tmat5< DT > ml::Tmat5< DT >::inverse ( bool * isInvertible = nullptr) const

Returns the inverse Gauss-Jordan elimination with partial pivoting. If a non-NULL boolean pointer is passed to isInvertible, then true is returned in *isInvertible in the case of a successful inversion or false if the inversion is not possible (function return is the identity then). If a NULL pointer is passed as isInvertible, the matrix must be invertible; otherwise, errors will occur.

Returns the inverse. Gauss-Jordan elimination with partial pivoting. If a non-NULL boolean pointer is passed to isInvertible, then true is returned in *isInvertible in the case of a successful inversion or false if the inversion is not possible (function return is the identity then). If a NULL pointer is passed as isInvertible, the matrix must be invertible; otherwise, errors will occur.

Definition at line 592 of file mlMatrix5.h.

References getIdentity(), inverse(), ml::MLInverseMatHelper(), and Tmat5().

Referenced by inverse().

◆ operator*=()

template<class DT>
const Tmat5< DT > & ml::Tmat5< DT >::operator*= ( const DT d)
inline

Multiplies by a scalar constant d.

Multiplies by a constant d.

Definition at line 279 of file mlMatrix5.h.

References operator*=(), Tmat5(), and ml::FloatingPointMatrix< Tvec5< DT >, 5 >::v.

Referenced by operator*=().

◆ operator+=()

template<class DT>
const Tmat5< DT > & ml::Tmat5< DT >::operator+= ( const Tmat5< DT > & m)
inline

Adds component-wise by a Tmat5.

Definition at line 253 of file mlMatrix5.h.

References operator+=(), Tmat5(), ml::FloatingPointMatrix< VectorT, size >::v, and ml::FloatingPointMatrix< Tvec5< DT >, 5 >::v.

Referenced by operator+=().

◆ operator-=()

template<class DT>
const Tmat5< DT > & ml::Tmat5< DT >::operator-= ( const Tmat5< DT > & m)
inline

Subtracts component-wise by a Tmat5.

Definition at line 266 of file mlMatrix5.h.

References operator-=(), Tmat5(), ml::FloatingPointMatrix< VectorT, size >::v, and ml::FloatingPointMatrix< Tvec5< DT >, 5 >::v.

Referenced by operator-=().

◆ operator/=()

template<class DT>
const Tmat5< DT > & ml::Tmat5< DT >::operator/= ( const DT d)
inline

Divide by a constant d. Division by zero is not handled and must be avoided by caller.

Divides by a scalar constant d. Division by zero is not handled and must be avoided by caller.

Definition at line 292 of file mlMatrix5.h.

References ML_CHECK_FLOAT_THROW, operator/=(), Tmat5(), and ml::FloatingPointMatrix< Tvec5< DT >, 5 >::v.

Referenced by operator/=().

◆ operator<()

template<class DT>
bool ml::Tmat5< DT >::operator< ( const Tmat5< DT > & ) const
inline

Dummy 'lesser than operator' which always returns false. It is needed to make class work with some STL containers on VC7.

Definition at line 111 of file mlMatrix5.h.

◆ operator=()

template<class DT>
const Tmat5< DT > & ml::Tmat5< DT >::operator= ( const Tmat5< DT > & m)
inline

Assigns from a Tmat5.

Assigns by a Tmat5.

Definition at line 238 of file mlMatrix5.h.

References operator=(), Tmat5(), ml::FloatingPointMatrix< VectorT, size >::v, and ml::FloatingPointMatrix< Tvec5< DT >, 5 >::v.

Referenced by operator=().

◆ set()

template<class DT>
void ml::Tmat5< DT >::set ( const DT val)
inline

Sets all values to val.

Definition at line 231 of file mlMatrix5.h.

References set(), and ml::FloatingPointMatrix< Tvec5< DT >, 5 >::v.

Referenced by set().

◆ setScaleMatrix()

template<class DT>
void ml::Tmat5< DT >::setScaleMatrix ( const DT scale)

Sets the diagonal matrix with scale on the diagonal.

Definition at line 539 of file mlMatrix5.h.

References setScaleMatrix(), and ml::FloatingPointMatrix< Tvec5< DT >, 5 >::v.

Referenced by setScaleMatrix().

◆ setValues() [1/2]

template<class DT>
void ml::Tmat5< DT >::setValues ( const double m[25])

Copies the contents from double array m into *this. m must point to an array with at least 25 valid entries, row by row.

Copies the contents of m into *this, where m must provide at least 25 accessible entries, row by row.

Definition at line 463 of file mlMatrix5.h.

References setValues(), and ml::FloatingPointMatrix< Tvec5< DT >, 5 >::v.

◆ setValues() [2/2]

template<class DT>
void ml::Tmat5< DT >::setValues ( const float m[25])

Copies the contents from float array m into *this. m must point to an array with at least 25 valid entries, row by row.

Definition at line 385 of file mlMatrix5.h.

References setValues(), and ml::FloatingPointMatrix< Tvec5< DT >, 5 >::v.

Referenced by setValues(), setValues(), Tmat5(), and Tmat5().

◆ transpose()

template<class DT>
Tmat5< DT > ml::Tmat5< DT >::transpose ( ) const
inline

Returns the transposed of this matrix.

Definition at line 611 of file mlMatrix5.h.

References Tmat5(), transpose(), and ml::FloatingPointMatrix< Tvec5< DT >, 5 >::v.

Referenced by ml::operator*(), and transpose().


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