ULIS  dev4.0.7
Utility Library for Imaging Systems
Public Types | Public Member Functions | Static Public Member Functions | List of all members
TMatrix2< T > Class Template Reference

The TMatrix2 class provides a simple 2x2 square matrix class for geometry applications. More...

Public Types

typedef TVector2< T > tColumn
 
typedef TVector2< T > tRow
 

Public Member Functions

 TMatrix2 ()
 
 TMatrix2 (const tColumn &iCol0, const tColumn &iCol1)
 
 TMatrix2 (const TMatrix2 &iOther)
 
template<typename U >
 TMatrix2 (const TMatrix2< U > &iOther)
 
 TMatrix2 (T iM00, T iM01, T iM10, T iM11)
 
 TMatrix2 (T iValue)
 
T * Data ()
 
const T * Data () const
 
Determinant () const
 
TMatrix2 Inverse () const
 
bool operator!= (const TMatrix2 &iOther)
 
TMatrix2operator*= (const TMatrix2 &iOther)
 
TMatrix2operator*= (T iValue)
 
TMatrix2operator+= (const TMatrix2 &iOther)
 
TMatrix2operator+= (T iValue)
 
TMatrix2 operator- () const
 
TMatrix2operator-= (const TMatrix2 &iOther)
 
TMatrix2operator-= (T iValue)
 
TMatrix2operator/= (const TMatrix2 &iOther)
 
TMatrix2operator/= (T iValue)
 
TMatrix2operator= (const TMatrix2 &iOther)
 
bool operator== (const TMatrix2 &iOther)
 
tColumnoperator[] (int iIndex)
 
const tColumnoperator[] (int iIndex) const
 
TMatrix2 Transpose () const
 

Static Public Member Functions

static TMatrix2 MakeRotationMatrix (T iAngleRad)
 
static TMatrix2 MakeScaleMatrix (T iScaleX, T iScaleY)
 
static TMatrix2 MakeSkewMatrix (T iSkewX, T iSkewY)
 

Detailed Description

template<typename T>
class TMatrix2< T >

The TMatrix2 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.

TMatrix2 are column-major ordered.

Member Typedef Documentation

◆ tColumn

template<typename T >
typedef TVector2< T > TMatrix2< T >::tColumn

◆ tRow

template<typename T >
typedef TVector2< T > TMatrix2< T >::tRow

Constructor & Destructor Documentation

◆ TMatrix2() [1/6]

template<typename T >
TMatrix2< T >::TMatrix2 ( )

Default constructor ( identity matrix ).

◆ TMatrix2() [2/6]

template<typename T >
TMatrix2< T >::TMatrix2 ( iValue)

Constructor from input diagonal value.

◆ TMatrix2() [3/6]

template<typename T >
TMatrix2< T >::TMatrix2 ( iM00,
iM01,
iM10,
iM11 
)

Constructor from input cells values.

◆ TMatrix2() [4/6]

template<typename T >
TMatrix2< T >::TMatrix2 ( const tColumn iCol0,
const tColumn iCol1 
)

Constructor from row vector values.

◆ TMatrix2() [5/6]

template<typename T >
TMatrix2< T >::TMatrix2 ( const TMatrix2< T > &  iOther)

Copy constructor.

◆ TMatrix2() [6/6]

template<typename T >
template<typename U >
TMatrix2< T >::TMatrix2 ( const TMatrix2< U > &  iOther)

Conversion constructor from other matrix type.

Member Function Documentation

◆ Data() [1/2]

template<typename T >
T * TMatrix2< T >::Data ( )

Return a pointer to the base storage.

◆ Data() [2/2]

template<typename T >
const T * TMatrix2< T >::Data ( ) const

Return a pointer to the base storage.

◆ Determinant()

template<typename T >
T TMatrix2< T >::Determinant ( ) const

Obtain the determinant of the matrix.

◆ Inverse()

template<typename T >
TMatrix2< T > TMatrix2< T >::Inverse ( ) const

Obtain the inverse of the matrix.

◆ MakeRotationMatrix()

template<typename T >
TMatrix2< T > TMatrix2< T >::MakeRotationMatrix ( iAngleRad)
static

Static maker for 2D 2x2 rotation matrix.

◆ MakeScaleMatrix()

template<typename T >
TMatrix2< T > TMatrix2< T >::MakeScaleMatrix ( iScaleX,
iScaleY 
)
static

Static maker for 2D 2x2 scale matrix.

◆ MakeSkewMatrix()

template<typename T >
TMatrix2< T > TMatrix2< T >::MakeSkewMatrix ( iSkewX,
iSkewY 
)
static

Static maker for 2D 2x2 skew matrix.

◆ operator!=()

template<typename T >
bool TMatrix2< T >::operator!= ( const TMatrix2< T > &  iOther)

Inequality operator.

◆ operator*=() [1/2]

template<typename T >
TMatrix2< T > & TMatrix2< T >::operator*= ( const TMatrix2< T > &  iOther)

Unary multiplication operator with matrix.

◆ operator*=() [2/2]

template<typename T >
TMatrix2< T > & TMatrix2< T >::operator*= ( iValue)

Unary multiplication operator with value.

◆ operator+=() [1/2]

template<typename T >
TMatrix2< T > & TMatrix2< T >::operator+= ( const TMatrix2< T > &  iOther)

Unary addition operator with matrix.

◆ operator+=() [2/2]

template<typename T >
TMatrix2< T > & TMatrix2< T >::operator+= ( iValue)

Unary addition operator with value.

◆ operator-()

template<typename T >
TMatrix2< T > TMatrix2< T >::operator- ( ) const

Unary negative operator.

◆ operator-=() [1/2]

template<typename T >
TMatrix2< T > & TMatrix2< T >::operator-= ( const TMatrix2< T > &  iOther)

Unary substraction operator with matrix.

◆ operator-=() [2/2]

template<typename T >
TMatrix2< T > & TMatrix2< T >::operator-= ( iValue)

Unary substraction operator with value.

◆ operator/=() [1/2]

template<typename T >
TMatrix2< T > & TMatrix2< T >::operator/= ( const TMatrix2< T > &  iOther)

Unary division operator with matrix.

◆ operator/=() [2/2]

template<typename T >
TMatrix2< T > & TMatrix2< T >::operator/= ( iValue)

Unary division operator with value.

◆ operator=()

template<typename T >
TMatrix2< T > & TMatrix2< T >::operator= ( const TMatrix2< T > &  iOther)

Assignment operator from matrix.

◆ operator==()

template<typename T >
bool TMatrix2< T >::operator== ( const TMatrix2< T > &  iOther)

Equality operator.

◆ operator[]() [1/2]

template<typename T >
TMatrix2< T >::tColumn & TMatrix2< T >::operator[] ( int  iIndex)

Subscript accessor for matrix columns.

◆ operator[]() [2/2]

template<typename T >
const TMatrix2< T >::tColumn & TMatrix2< T >::operator[] ( int  iIndex) const

Subscript accessor for const matrix columns.

◆ Transpose()

template<typename T >
TMatrix2< T > TMatrix2< T >::Transpose ( ) const

Obtain the transpose of the matrix.