etk::Matrix< T > Class Template Reference

#include <Matrix.hpp>

Public Member Functions

 Matrix (const ivec2 &_size, T *_defaultVal=nullptr)
 
 Matrix (int32_t _width=0, int32_t _heigh=0, T *_defaultVal=nullptr)
 
template<class ETK_TYPE_MATRIX_2 >
 Matrix (const Matrix< ETK_TYPE_MATRIX_2 > &_obj)
 
virtual ~Matrix ()=default
 
const Matrix< T > & operator= (const Matrix< T > &_obj)
 
const Matrix< T > & operator= (T &_value)
 
bool operator== (const Matrix< T > &_obj) const
 
bool operator!= (const Matrix< T > &_obj) const
 
const Matrix< T > & operator+= (const Matrix< T > &_obj)
 
Matrix< T > operator+ (const Matrix< T > &_obj)
 
const Matrix< T > & operator-= (const Matrix< T > &_obj)
 
Matrix< T > operator- (const Matrix< T > &_obj)
 
const Matrix< T > & operator*= (const Matrix< T > &_obj)
 
Matrix< T > operator* (const Matrix< T > &_obj)
 
const T * operator[] (int32_t _yyy) const
 
T * operator[] (int32_t _yyy)
 
const T & operator[] (const ivec2 &_pos) const
 
T & operator[] (const ivec2 &_pos)
 
T & operator() (size_t _xxx, size_t _yyy)
 
Matrix< T > operator- () const
 
Matrix< T > transpose () const
 
Matrix< T > convolution (Matrix< T > &_obj) const
 
Matrix< T > fix (int32_t _decalage) const
 
Matrix< T > round (int32_t _decalage) const
 
Matrix< T > resize (etk::Vector2D< int32_t > _size) const
 
Matrix< T > select (int32_t _np, int32_t *_p, int32_t _nq, int32_t *_q) const
 
void clearUpperTriangle ()
 

Detailed Description

template<typename T>
class etk::Matrix< T >

2 dimention matrix template to manage simpliest algo

Note
Prototype

Constructor & Destructor Documentation

§ Matrix() [1/3]

template<typename T>
etk::Matrix< T >::Matrix ( const ivec2 _size,
T *  _defaultVal = nullptr 
)
inline

Contructor that create a Vector with a specific size and specific raw data.

Parameters
[in]_sizeDimention of the matrix
[in]_defaultValDefault list of element that might be set in the matrix

§ Matrix() [2/3]

template<typename T>
etk::Matrix< T >::Matrix ( int32_t  _width = 0,
int32_t  _heigh = 0,
T *  _defaultVal = nullptr 
)
inline

default contructor that create a Vector with a specific size and specific raw data

Parameters
[in]_widthDimention width of the matrix
[in]_heighDimention heigh of the matrix
[in]_defaultValDefault list of element that might be set in the matrix

§ Matrix() [3/3]

template<typename T>
template<class ETK_TYPE_MATRIX_2 >
etk::Matrix< T >::Matrix ( const Matrix< ETK_TYPE_MATRIX_2 > &  _obj)
inline

Copy contructor with ETK_TYPE_MATRIX_2 type matrix input.

Parameters
[in]_objObject matrix to copy

§ ~Matrix()

template<typename T>
virtual etk::Matrix< T >::~Matrix ( )
virtualdefault

Virtualisation of destructor.

Member Function Documentation

§ clearUpperTriangle()

template<typename T>
void etk::Matrix< T >::clearUpperTriangle ( )
inline

Clear the Upper triangle of the current Matrix.

  x 0 0 0 0
  x x 0 0 0
  x x x 0 0
  x x x x 0
  x x x x x

§ convolution()

template<typename T>
Matrix<T> etk::Matrix< T >::convolution ( Matrix< T > &  _obj) const
inline

Create a convolution on the matrix : set convolution on the lines.

Parameters
[in]_objThe convolution operator
Returns
New matrix containing the current matrix concoluate

§ fix()

template<typename T>
Matrix<T> etk::Matrix< T >::fix ( int32_t  _decalage) const
inline

generate a devide of the curent Matrix with the specify power of 2

Parameters
[in]_decalageThe power of 2 of the division
Returns
New matrix containing the matrix fix()

§ operator!=()

template<typename T>
bool etk::Matrix< T >::operator!= ( const Matrix< T > &  _obj) const
inline

In-Equality compare operator with an other object.

Parameters
[in]_objReference on the comparing object
Returns
true The Objects are NOT identical
false The Objects are identical

§ operator()()

template<typename T>
T& etk::Matrix< T >::operator() ( size_t  _xxx,
size_t  _yyy 
)
inline

Operator() Access at the element at a specific position.

  elemntValue = mayMatrix(xxx,yyy);
Parameters
[in]_xxxColomn position in the matrix
[in]_yyyLine position in the matrix
Returns
Reference on the element

§ operator*()

template<typename T>
Matrix<T> etk::Matrix< T >::operator* ( const Matrix< T > &  _obj)
inline

Operator* Multiplication an other matrix with this one.

Parameters
[in]_objReference on the external object
Returns
New matrix containing the value

§ operator*=()

template<typename T>
const Matrix<T>& etk::Matrix< T >::operator*= ( const Matrix< T > &  _obj)
inline

Operator*= Multiplication an other matrix with this one.

Parameters
[in]_objReference on the external object
Returns
Local reference of the vector multiplicated

§ operator+()

template<typename T>
Matrix<T> etk::Matrix< T >::operator+ ( const Matrix< T > &  _obj)
inline

Operator+= Addition an other matrix with this one.

   (a b)   (e f)   (a+e b+f)
   (c d) + (g h) = (c+g d+h)
Note
If the size are different, we create a matrix witth the max size of the 2 others ...
Parameters
[in]_objReference on the external object
Returns
New matrix containing the value

§ operator+=()

template<typename T>
const Matrix<T>& etk::Matrix< T >::operator+= ( const Matrix< T > &  _obj)
inline

Operator+= Addition an other matrix with this one.

   (a b)   (e f)   (a+e b+f)
   (c d) + (g h) = (c+g d+h)
Note
If the size are different, we create a matrix witth the max size of the 2 others ...
Parameters
[in]_objReference on the external object
Returns
Local reference of the vector additionned

§ operator-() [1/2]

template<typename T>
Matrix<T> etk::Matrix< T >::operator- ( const Matrix< T > &  _obj)
inline

Operator+= Addition an other matrix with this one.

   (a b)   (e f)   (a-e b-f)
   (c d) - (g h) = (c-g d-h)
Note
If the size are different, we create a matrix witth the max size of the 2 others ...
Parameters
[in]_objReference on the external object
Returns
New matrix containing the value

§ operator-() [2/2]

template<typename T>
Matrix<T> etk::Matrix< T >::operator- ( ) const
inline

Operator- Multiply with -1.

Returns
New matrix containing the value

§ operator-=()

template<typename T>
const Matrix<T>& etk::Matrix< T >::operator-= ( const Matrix< T > &  _obj)
inline

Operator+= Addition an other matrix with this one.

   (a b)   (e f)   (a-e b-f)
   (c d) - (g h) = (c-g d-h)
Note
If the size are different, we create a matrix witth the max size of the 2 others ...
Parameters
[in]_objReference on the external object
Returns
Local reference of the vector additionned

§ operator=() [1/2]

template<typename T>
const Matrix<T>& etk::Matrix< T >::operator= ( const Matrix< T > &  _obj)
inline

Operator= Asign the current object with an other object.

Parameters
[in]_objReference on the external object
Returns
Local reference of the vector asigned

§ operator=() [2/2]

template<typename T>
const Matrix<T>& etk::Matrix< T >::operator= ( T &  _value)
inline

Operator= Asign the current object with a unique value.

Parameters
[in]_valueValue to set in the matrix data
Returns
Local reference of the vector asigned

§ operator==()

template<typename T>
bool etk::Matrix< T >::operator== ( const Matrix< T > &  _obj) const
inline

Equality compare operator with an other object.

Parameters
[in]_objReference on the comparing object
Returns
true The Objects are identical
false The Objects are NOT identical

§ operator[]() [1/4]

template<typename T>
const T* etk::Matrix< T >::operator[] ( int32_t  _yyy) const
inline

Operator[] Access at the first element (const pointer) of a line.

  elemntValue = mayMatrix[YYY][xxx];
Parameters
[in]_yyyLine Id requested [0..m_size.y()]
Returns
Const pointer on the first line element

§ operator[]() [2/4]

template<typename T>
T* etk::Matrix< T >::operator[] ( int32_t  _yyy)
inline

Operator[] Access at the first element (pointer) of a line.

  elemntValue = mayMatrix[YYY][xxx];
Parameters
[in]_yyyLine Id requested [0..m_size.y()]
Returns
Pointer on the first line element

§ operator[]() [3/4]

template<typename T>
const T& etk::Matrix< T >::operator[] ( const ivec2 _pos) const
inline

Operator[] Access at the element at a specific position.

  elemntValue = mayMatrix[ivec2(xxx,yyy)];
Parameters
[in]_posPosition in the matrix
Returns
Const Reference on the element

§ operator[]() [4/4]

template<typename T>
T& etk::Matrix< T >::operator[] ( const ivec2 _pos)
inline

Operator[] Access at the element at a specific position.

  elemntValue = mayMatrix[ivec2(xxx,yyy)];
Parameters
[in]_posPosition in the matrix
Returns
Reference on the element

§ resize()

template<typename T>
Matrix<T> etk::Matrix< T >::resize ( etk::Vector2D< int32_t >  _size) const
inline

Generate a resised matrix.

Parameters
[in]_sizenew output size
Returns
New matrix resized

§ round()

template<typename T>
Matrix<T> etk::Matrix< T >::round ( int32_t  _decalage) const
inline

generate a devide of the curent Matrix with the specify power of 2

Parameters
[in]_decalageThe power of 2 of the division
Returns
New matrix containing the rounded matrix

§ select()

template<typename T>
Matrix<T> etk::Matrix< T >::select ( int32_t  _np,
int32_t *  _p,
int32_t  _nq,
int32_t *  _q 
) const
inline

Select element in the matrix from a list of element Ids.

Parameters
[in]_npWidth of the output matrix
[in]_pList pointer of x
[in]_nqHeigh of the output matrix
[in]_qList pointer of y
Returns
New matrix resized

§ transpose()

template<typename T>
Matrix<T> etk::Matrix< T >::transpose ( ) const
inline

Transpose Matrix.

Returns
New matrix containing the value

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