ULIS  dev4.0.7
Utility Library for Imaging Systems
Public Types | Public Member Functions | Public Attributes | List of all members
TMatrixN< T, P, N > Class Template Reference

The TMatrixN class provides a simple N square matrix class for geometry applications. More...

Public Types

typedef TVectorN< T, P, N > tColumn
 
typedef P tComputation
 
typedef TVectorN< T, P, N > tRow
 

Public Member Functions

 TMatrixN ()
 
 TMatrixN (const TMatrixN< T, P, N > &iOther)
 
template<typename U , typename Q , uint8 M>
 TMatrixN (const TMatrixN< U, Q, M > &iOther)
 
 TMatrixN (std::initializer_list< T > iValues)
 
 TMatrixN (std::initializer_list< tRow > iRows)
 
 TMatrixN (T iValue)
 
T * Data ()
 
const T * Data () const
 
tComputation Determinant () const
 
TMatrixN< T, P, N > Inverse () const
 
bool operator!= (const TMatrixN< T, P, N > &iOther)
 
TMatrixN< T, P, N > & operator*= (const TMatrixN< T, P, N > &iOther)
 
TMatrixN< T, P, N > & operator*= (T iValue)
 
TMatrixN< T, P, N > & operator+= (const TMatrixN< T, P, N > &iOther)
 
TMatrixN< T, P, N > & operator+= (T iValue)
 
TMatrixN< T, P, N > operator- () const
 
TMatrixN< T, P, N > & operator-= (const TMatrixN< T, P, N > &iOther)
 
TMatrixN< T, P, N > & operator-= (T iValue)
 
TMatrixN< T, P, N > & operator/= (const TMatrixN< T, P, N > &iOther)
 
TMatrixN< T, P, N > & operator/= (T iValue)
 
TMatrixN< T, P, N > & operator= (const TMatrixN< T, P, N > &iOther)
 
bool operator== (const TMatrixN< T, P, N > &iOther)
 
tRowoperator[] (int iIndex)
 
const tRowoperator[] (int iIndex) const
 
TMatrixN< T, P, N > Rotated90CCW () const
 
TMatrixN< T, P, N > Transpose () const
 

Public Attributes

tRow m [N]
 

Detailed Description

template<typename T, typename P, uint8 N>
class TMatrixN< T, P, N >

The TMatrixN class is a template class that provides basic matrix functionnalities, it can be used with any numeric types, ranging from integer values to floating point values.

Warning
Unlike TMatrix2, TMatrix3 and TMatrix4, TMatrixN are row-major ordered.
See also
TMatrix2
TMatrix3
TMatrix4

Member Typedef Documentation

◆ tColumn

template<typename T , typename P , uint8 N>
typedef TVectorN< T, P, N > TMatrixN< T, P, N >::tColumn

◆ tComputation

template<typename T , typename P , uint8 N>
typedef P TMatrixN< T, P, N >::tComputation

◆ tRow

template<typename T , typename P , uint8 N>
typedef TVectorN< T, P, N > TMatrixN< T, P, N >::tRow

Constructor & Destructor Documentation

◆ TMatrixN() [1/6]

template<typename T , typename P , uint8 N>
TMatrixN< T, P, N >::TMatrixN ( )

Default constructor ( identity matrix ).

◆ TMatrixN() [2/6]

template<typename T , typename P , uint8 N>
TMatrixN< T, P, N >::TMatrixN ( iValue)

Constructor from input diagonal value.

◆ TMatrixN() [3/6]

template<typename T , typename P , uint8 N>
TMatrixN< T, P, N >::TMatrixN ( std::initializer_list< T >  iValues)

Constructor from input cells values.

◆ TMatrixN() [4/6]

template<typename T , typename P , uint8 N>
TMatrixN< T, P, N >::TMatrixN ( std::initializer_list< tRow iRows)

Constructor from row vector values.

◆ TMatrixN() [5/6]

template<typename T , typename P , uint8 N>
TMatrixN< T, P, N >::TMatrixN ( const TMatrixN< T, P, N > &  iOther)

Copy constructor.

◆ TMatrixN() [6/6]

template<typename T , typename P , uint8 N>
template<typename U , typename Q , uint8 M>
TMatrixN< T, P, N >::TMatrixN ( const TMatrixN< U, Q, M > &  iOther)

Conversion constructor from other matrix type.

Member Function Documentation

◆ Data() [1/2]

template<typename T , typename P , uint8 N>
T * TMatrixN< T, P, N >::Data ( )

Return a pointer to the base storage.

◆ Data() [2/2]

template<typename T , typename P , uint8 N>
const T * TMatrixN< T, P, N >::Data ( ) const

Return a pointer to the base storage.

◆ Determinant()

template<typename T , typename P , uint8 N>
TMatrixN< T, P, N >::tComputation TMatrixN< T, P, N >::Determinant ( ) const

Obtain the determinant of the matrix.

◆ Inverse()

template<typename T , typename P , uint8 N>
TMatrixN< T, P, N > TMatrixN< T, P, N >::Inverse ( ) const

Obtain the inverse of the matrix.

◆ operator!=()

template<typename T , typename P , uint8 N>
bool TMatrixN< T, P, N >::operator!= ( const TMatrixN< T, P, N > &  iOther)

Inequality operator.

◆ operator*=() [1/2]

template<typename T , typename P , uint8 N>
TMatrixN< T, P, N > & TMatrixN< T, P, N >::operator*= ( const TMatrixN< T, P, N > &  iOther)

Unary multiplication operator with matrix.

◆ operator*=() [2/2]

template<typename T , typename P , uint8 N>
TMatrixN< T, P, N > & TMatrixN< T, P, N >::operator*= ( iValue)

Unary multiplication operator with value.

◆ operator+=() [1/2]

template<typename T , typename P , uint8 N>
TMatrixN< T, P, N > & TMatrixN< T, P, N >::operator+= ( const TMatrixN< T, P, N > &  iOther)

Unary addition operator with matrix.

◆ operator+=() [2/2]

template<typename T , typename P , uint8 N>
TMatrixN< T, P, N > & TMatrixN< T, P, N >::operator+= ( iValue)

Unary addition operator with value.

◆ operator-()

template<typename T , typename P , uint8 N>
TMatrixN< T, P, N > TMatrixN< T, P, N >::operator- ( ) const

Unary negative operator.

◆ operator-=() [1/2]

template<typename T , typename P , uint8 N>
TMatrixN< T, P, N > & TMatrixN< T, P, N >::operator-= ( const TMatrixN< T, P, N > &  iOther)

Unary substraction operator with matrix.

◆ operator-=() [2/2]

template<typename T , typename P , uint8 N>
TMatrixN< T, P, N > & TMatrixN< T, P, N >::operator-= ( iValue)

Unary substraction operator with value.

◆ operator/=() [1/2]

template<typename T , typename P , uint8 N>
TMatrixN< T, P, N > & TMatrixN< T, P, N >::operator/= ( const TMatrixN< T, P, N > &  iOther)

Unary division operator with matrix.

◆ operator/=() [2/2]

template<typename T , typename P , uint8 N>
TMatrixN< T, P, N > & TMatrixN< T, P, N >::operator/= ( iValue)

Unary division operator with value.

◆ operator=()

template<typename T , typename P , uint8 N>
TMatrixN< T, P, N > & TMatrixN< T, P, N >::operator= ( const TMatrixN< T, P, N > &  iOther)

Assignment operator from matrix.

◆ operator==()

template<typename T , typename P , uint8 N>
bool TMatrixN< T, P, N >::operator== ( const TMatrixN< T, P, N > &  iOther)

Equality operator.

◆ operator[]() [1/2]

template<typename T , typename P , uint8 N>
TMatrixN< T, P, N >::tColumn & TMatrixN< T, P, N >::operator[] ( int  iIndex)

Subscript accessor for matrix columns.

◆ operator[]() [2/2]

template<typename T , typename P , uint8 N>
const TMatrixN< T, P, N >::tColumn & TMatrixN< T, P, N >::operator[] ( int  iIndex) const

Subscript accessor for const matrix columns.

◆ Rotated90CCW()

template<typename T , typename P , uint8 N>
TMatrixN< T, P, N > TMatrixN< T, P, N >::Rotated90CCW ( ) const

Obtain the transpose of the matrix.

◆ Transpose()

template<typename T , typename P , uint8 N>
TMatrixN< T, P, N > TMatrixN< T, P, N >::Transpose ( ) const

Obtain the transpose of the matrix.

Member Data Documentation

◆ m

template<typename T , typename P , uint8 N>
tRow TMatrixN< T, P, N >::m[N]

The N rows of the N matrix.