tesseract++ 0.0.1
N-dimensional tensor library for embedded systems
Loading...
Searching...
No Matches
Public Member Functions | Static Public Member Functions | Friends | List of all members
Matrix< T, Rows, Cols > Class Template Reference

#include <matrix.h>

Inheritance diagram for Matrix< T, Rows, Cols >:
Inheritance graph
[legend]
Collaboration diagram for Matrix< T, Rows, Cols >:
Collaboration graph
[legend]

Public Member Functions

 DEFINE_TYPE_ALIAS (T, value_type)
 
 Matrix ()
 
 Matrix (T initValue)
 
 Matrix (const Matrix &other)
 
 Matrix (const TensorND< T, Rows, Cols > &baseTensor)
 
 Matrix (Matrix &&other) noexcept
 
 Matrix (TensorND< T, Rows, Cols > &&baseTensor) noexcept
 
 Matrix (T(&initList)[Rows][Cols])
 
TensorND< T, Rows, Cols > toTensor (void) const
 
Matrixoperator= (const Matrix &other)
 
Matrixoperator= (T(&initList)[Rows][Cols])
 
template<my_size_t Rows1, my_size_t Cols1>
Matrix operator+ (const Matrix< T, Rows1, Cols1 > &other) const
 
Matrix operator+ (const T scalar) const
 
template<my_size_t Rows1, my_size_t Cols1>
Matrix operator- (const Matrix< T, Rows1, Cols1 > &other) const
 
Matrix operator- (const T scalar) const
 
Matrix operator- (void) const
 
template<my_size_t Rows1, my_size_t Cols1>
Matrix operator* (const Matrix< T, Rows1, Cols1 > &other) const
 
Matrix operator* (const T scalar) const
 
template<my_size_t Rows1, my_size_t Cols1>
Matrix operator/ (const Matrix< T, Rows1, Cols1 > &other) const
 
Matrix operator/ (const T scalar) const
 
Matrix transposed (void) const
 
void inplace_transpose (void)
 
MatrixsetToZero (void)
 
MatrixsetHomogen (T _val)
 
MatrixsetRandom (my_size_t _maxRand, my_size_t _minRand)
 
MatrixsetDiagonal (T _val)
 
MatrixsetIdentity (void)
 
MatrixsetSequencial (void)
 
bool isIdentity (void) const
 
bool isSymmetric (void) const
 
bool isUpperTriangular (void) const
 
bool isLowerTriangular (void) const
 
Matrix upperTriangular (bool inplace=false)
 
Matrix lowerTriangular (bool inplace=false)
 
Matrix inverse (void) const
 
Matrix inverse_c (void) const
 
bool isOrthogonal (void)
 
matrix_traits::Definiteness isPositiveDefinite () const
 
- Public Member Functions inherited from TensorND< T, Rows, Cols >
 TensorND ()
 
 TensorND (T initValue)
 
 TensorND (const TensorND &other)
 
 TensorND (TensorND &&other) noexcept
 
T & operator() (Indices... indices)
 
const T & operator() (Indices... indices) const
 
T & operator() (my_size_t(&indices)[length])
 
const T & operator() (my_size_t(&indices)[length]) const
 
bool operator== (const TensorND< T, Dims1... > &other) const
 
bool operator!= (const TensorND< T, Dims1... > &other) const
 
TensorNDoperator= (const TensorND &other)
 
TensorND operator+ (const T scalar) const
 
TensorND operator+ (const TensorND< T, Dims1... > &other) const
 
TensorND operator- (const T scalar) const
 
TensorND operator- (void) const
 
TensorND operator- (const TensorND< T, Dims1... > &other) const
 
TensorND operator* (const T scalar) const
 
TensorND operator* (const TensorND< T, Dims1... > &other) const
 
TensorND operator/ (const T scalar) const
 
TensorND operator/ (const TensorND< T, Dims1... > &other) const
 
constexpr bool areDimsEqual () const
 
bool isIdentity () const
 
TensorND transposed (const my_size_t order[sizeof...(Dims)]) const
 
TensorND transposed (void) const
 
void inplace_transpose (const my_size_t order[sizeof...(Dims)])
 
void inplace_transpose (void)
 
constexpr my_size_t getTotalSize () const
 
constexpr my_size_t getNumDims () const
 
std::string getShape () const
 
TensorNDsetToZero (void)
 
TensorNDsetHomogen (T _val)
 
TensorNDsetRandom (my_size_t _maxRand, my_size_t _minRand)
 
TensorNDsetDiagonal (T _val)
 
TensorNDsetIdentity (void)
 
TensorNDsetSequencial (void)
 
void getDiagonalEntries (TensorND< T, DiagonalSize, 1 > &diagonalEntries) const
 
void print () const
 
my_size_t getDim (my_size_t i) const
 

Static Public Member Functions

static constexpr Matrix fromTensor (TensorND< T, Rows, Cols > &&tensor)
 
template<my_size_t Common, my_size_t mat1_rows, my_size_t mat2_cols>
static Matrix< T, Rows, Cols > matmul (const Matrix< T, mat1_rows, Common > &mat1, const Matrix< T, Common, mat2_cols > &mat2)
 
- Static Public Member Functions inherited from TensorND< T, Rows, Cols >
static TensorND I (void)
 
static TensorND einsum (const TensorND< T, Dims1... > &_tensor1, const TensorND< T, Dims2... > &_tensor2, my_size_t a, my_size_t b)
 

Friends

Matrix operator+ (const T scalar, const Matrix &matrix)
 
Matrix operator- (const T scalar, const Matrix &matrix)
 
Matrix operator* (const T scalar, const Matrix &matrix)
 
Matrix operator/ (const T scalar, const Matrix &matrix)
 

Constructor & Destructor Documentation

◆ Matrix() [1/7]

template<typename T , my_size_t Rows, my_size_t Cols>
Matrix< T, Rows, Cols >::Matrix ( )
inline

◆ Matrix() [2/7]

template<typename T , my_size_t Rows, my_size_t Cols>
Matrix< T, Rows, Cols >::Matrix ( initValue)
inline

◆ Matrix() [3/7]

template<typename T , my_size_t Rows, my_size_t Cols>
Matrix< T, Rows, Cols >::Matrix ( const Matrix< T, Rows, Cols > &  other)
inline

◆ Matrix() [4/7]

template<typename T , my_size_t Rows, my_size_t Cols>
Matrix< T, Rows, Cols >::Matrix ( const TensorND< T, Rows, Cols > &  baseTensor)
inline

◆ Matrix() [5/7]

template<typename T , my_size_t Rows, my_size_t Cols>
Matrix< T, Rows, Cols >::Matrix ( Matrix< T, Rows, Cols > &&  other)
inlinenoexcept

◆ Matrix() [6/7]

template<typename T , my_size_t Rows, my_size_t Cols>
Matrix< T, Rows, Cols >::Matrix ( TensorND< T, Rows, Cols > &&  baseTensor)
inlinenoexcept

◆ Matrix() [7/7]

template<typename T , my_size_t Rows, my_size_t Cols>
Matrix< T, Rows, Cols >::Matrix ( T(&)  initList[Rows][Cols])
inline

Member Function Documentation

◆ DEFINE_TYPE_ALIAS()

template<typename T , my_size_t Rows, my_size_t Cols>
Matrix< T, Rows, Cols >::DEFINE_TYPE_ALIAS ( ,
value_type   
)

◆ fromTensor()

template<typename T , my_size_t Rows, my_size_t Cols>
static constexpr Matrix Matrix< T, Rows, Cols >::fromTensor ( TensorND< T, Rows, Cols > &&  tensor)
inlinestaticconstexpr
Here is the call graph for this function:

◆ inplace_transpose()

template<typename T , my_size_t Rows, my_size_t Cols>
void Matrix< T, Rows, Cols >::inplace_transpose ( void  )
inline
Here is the call graph for this function:

◆ inverse()

template<typename T , my_size_t Rows, my_size_t Cols>
Matrix Matrix< T, Rows, Cols >::inverse ( void  ) const
inline
Here is the call graph for this function:

◆ inverse_c()

template<typename T , my_size_t Rows, my_size_t Cols>
Matrix Matrix< T, Rows, Cols >::inverse_c ( void  ) const
inline
Here is the call graph for this function:

◆ isIdentity()

template<typename T , my_size_t Rows, my_size_t Cols>
bool Matrix< T, Rows, Cols >::isIdentity ( void  ) const
inline
Here is the call graph for this function:

◆ isLowerTriangular()

template<typename T , my_size_t Rows, my_size_t Cols>
bool Matrix< T, Rows, Cols >::isLowerTriangular ( void  ) const
inline
Here is the call graph for this function:

◆ isOrthogonal()

template<typename T , my_size_t Rows, my_size_t Cols>
bool Matrix< T, Rows, Cols >::isOrthogonal ( void  )
inline
Here is the call graph for this function:

◆ isPositiveDefinite()

template<typename T , my_size_t Rows, my_size_t Cols>
matrix_traits::Definiteness Matrix< T, Rows, Cols >::isPositiveDefinite ( ) const
inline
Here is the call graph for this function:

◆ isSymmetric()

template<typename T , my_size_t Rows, my_size_t Cols>
bool Matrix< T, Rows, Cols >::isSymmetric ( void  ) const
inline
Here is the call graph for this function:

◆ isUpperTriangular()

template<typename T , my_size_t Rows, my_size_t Cols>
bool Matrix< T, Rows, Cols >::isUpperTriangular ( void  ) const
inline
Here is the call graph for this function:

◆ lowerTriangular()

template<typename T , my_size_t Rows, my_size_t Cols>
Matrix Matrix< T, Rows, Cols >::lowerTriangular ( bool  inplace = false)
inline
Here is the call graph for this function:

◆ matmul()

template<typename T , my_size_t Rows, my_size_t Cols>
template<my_size_t Common, my_size_t mat1_rows, my_size_t mat2_cols>
static Matrix< T, Rows, Cols > Matrix< T, Rows, Cols >::matmul ( const Matrix< T, mat1_rows, Common > &  mat1,
const Matrix< T, Common, mat2_cols > &  mat2 
)
inlinestatic
Here is the call graph for this function:

◆ operator*() [1/2]

template<typename T , my_size_t Rows, my_size_t Cols>
template<my_size_t Rows1, my_size_t Cols1>
Matrix Matrix< T, Rows, Cols >::operator* ( const Matrix< T, Rows1, Cols1 > &  other) const
inline
Here is the call graph for this function:

◆ operator*() [2/2]

template<typename T , my_size_t Rows, my_size_t Cols>
Matrix Matrix< T, Rows, Cols >::operator* ( const T  scalar) const
inline
Here is the call graph for this function:

◆ operator+() [1/2]

template<typename T , my_size_t Rows, my_size_t Cols>
template<my_size_t Rows1, my_size_t Cols1>
Matrix Matrix< T, Rows, Cols >::operator+ ( const Matrix< T, Rows1, Cols1 > &  other) const
inline
Here is the call graph for this function:

◆ operator+() [2/2]

template<typename T , my_size_t Rows, my_size_t Cols>
Matrix Matrix< T, Rows, Cols >::operator+ ( const T  scalar) const
inline
Here is the call graph for this function:

◆ operator-() [1/3]

template<typename T , my_size_t Rows, my_size_t Cols>
template<my_size_t Rows1, my_size_t Cols1>
Matrix Matrix< T, Rows, Cols >::operator- ( const Matrix< T, Rows1, Cols1 > &  other) const
inline
Here is the call graph for this function:

◆ operator-() [2/3]

template<typename T , my_size_t Rows, my_size_t Cols>
Matrix Matrix< T, Rows, Cols >::operator- ( const T  scalar) const
inline
Here is the call graph for this function:

◆ operator-() [3/3]

template<typename T , my_size_t Rows, my_size_t Cols>
Matrix Matrix< T, Rows, Cols >::operator- ( void  ) const
inline
Here is the call graph for this function:

◆ operator/() [1/2]

template<typename T , my_size_t Rows, my_size_t Cols>
template<my_size_t Rows1, my_size_t Cols1>
Matrix Matrix< T, Rows, Cols >::operator/ ( const Matrix< T, Rows1, Cols1 > &  other) const
inline
Here is the call graph for this function:

◆ operator/() [2/2]

template<typename T , my_size_t Rows, my_size_t Cols>
Matrix Matrix< T, Rows, Cols >::operator/ ( const T  scalar) const
inline
Here is the call graph for this function:

◆ operator=() [1/2]

template<typename T , my_size_t Rows, my_size_t Cols>
Matrix & Matrix< T, Rows, Cols >::operator= ( const Matrix< T, Rows, Cols > &  other)
inline
Here is the call graph for this function:

◆ operator=() [2/2]

template<typename T , my_size_t Rows, my_size_t Cols>
Matrix & Matrix< T, Rows, Cols >::operator= ( T(&)  initList[Rows][Cols])
inline

◆ setDiagonal()

template<typename T , my_size_t Rows, my_size_t Cols>
Matrix & Matrix< T, Rows, Cols >::setDiagonal ( _val)
inline
Here is the call graph for this function:

◆ setHomogen()

template<typename T , my_size_t Rows, my_size_t Cols>
Matrix & Matrix< T, Rows, Cols >::setHomogen ( _val)
inline
Here is the call graph for this function:

◆ setIdentity()

template<typename T , my_size_t Rows, my_size_t Cols>
Matrix & Matrix< T, Rows, Cols >::setIdentity ( void  )
inline
Here is the call graph for this function:

◆ setRandom()

template<typename T , my_size_t Rows, my_size_t Cols>
Matrix & Matrix< T, Rows, Cols >::setRandom ( my_size_t  _maxRand,
my_size_t  _minRand 
)
inline
Here is the call graph for this function:

◆ setSequencial()

template<typename T , my_size_t Rows, my_size_t Cols>
Matrix & Matrix< T, Rows, Cols >::setSequencial ( void  )
inline
Here is the call graph for this function:

◆ setToZero()

template<typename T , my_size_t Rows, my_size_t Cols>
Matrix & Matrix< T, Rows, Cols >::setToZero ( void  )
inline
Here is the call graph for this function:

◆ toTensor()

template<typename T , my_size_t Rows, my_size_t Cols>
TensorND< T, Rows, Cols > Matrix< T, Rows, Cols >::toTensor ( void  ) const
inline

◆ transposed()

template<typename T , my_size_t Rows, my_size_t Cols>
Matrix Matrix< T, Rows, Cols >::transposed ( void  ) const
inline
Here is the call graph for this function:

◆ upperTriangular()

template<typename T , my_size_t Rows, my_size_t Cols>
Matrix Matrix< T, Rows, Cols >::upperTriangular ( bool  inplace = false)
inline
Here is the call graph for this function:

Friends And Related Symbol Documentation

◆ operator*

template<typename T , my_size_t Rows, my_size_t Cols>
Matrix operator* ( const T  scalar,
const Matrix< T, Rows, Cols > &  matrix 
)
friend

◆ operator+

template<typename T , my_size_t Rows, my_size_t Cols>
Matrix operator+ ( const T  scalar,
const Matrix< T, Rows, Cols > &  matrix 
)
friend

◆ operator-

template<typename T , my_size_t Rows, my_size_t Cols>
Matrix operator- ( const T  scalar,
const Matrix< T, Rows, Cols > &  matrix 
)
friend

◆ operator/

template<typename T , my_size_t Rows, my_size_t Cols>
Matrix operator/ ( const T  scalar,
const Matrix< T, Rows, Cols > &  matrix 
)
friend

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