Lugdunum  0.1.0
Public Types | Public Member Functions | Static Public Member Functions | Protected Attributes | List of all members
lug::Math::Matrix< Rows, Columns, T > Class Template Reference

#include <Matrix.hpp>

Inheritance diagram for lug::Math::Matrix< Rows, Columns, T >:
[legend]
Collaboration diagram for lug::Math::Matrix< Rows, Columns, T >:
[legend]

Public Types

using Values = ValArray< Rows *Columns, T >
 

Public Member Functions

constexpr Matrix ()=default
 
 Matrix (T value)
 
 Matrix (const Values &values)
 
 Matrix (std::initializer_list< T > list)
 
 Matrix (const Matrix< Rows, Columns, T > &matrix)=default
 
 Matrix (Matrix< Rows, Columns, T > &&matrix)=default
 
Matrix< Rows, Columns, T > & operator= (const Matrix< Rows, Columns, T > &rhs)=default
 
Matrix< Rows, Columns, T > & operator= (Matrix< Rows, Columns, T > &&rhs)=default
 
 ~Matrix ()=default
 
constexpr uint8_t getRows () const
 
constexpr uint8_t getColumns () const
 
ValuesgetValues ()
 
constexpr const ValuesgetValues () const
 
T & operator() (uint8_t row, uint8_t col=0)
 
constexpr const T & operator() (uint8_t row, uint8_t col=0) const
 
Matrix< Rows, Columns, T > & operator+= (T rhs)
 
Matrix< Rows, Columns, T > & operator-= (T rhs)
 
Matrix< Rows, Columns, T > & operator*= (T rhs)
 
Matrix< Rows, Columns, T > & operator/= (T rhs)
 
Matrix< Rows, Columns, T > & operator+= (const Matrix< Rows, Columns, T > &rhs)
 
Matrix< Rows, Columns, T > & operator-= (const Matrix< Rows, Columns, T > &rhs)
 
template<bool EnableBool = true>
std::enable_if<(Rows==Columns) &&EnableBool, Matrix< Rows, Columns, T > >::type & operator*= (const Matrix< Rows, Columns, T > &rhs)
 
template<bool EnableBool = true>
std::enable_if<(Rows==Columns) &&EnableBool, Matrix< Rows, Columns, T > >::type & operator/= (const Matrix< Rows, Columns, T > &rhs)
 
template<bool EnableBool = true>
std::enable_if<(Rows==1) &&EnableBool, Matrix< Rows, Columns, T > >::type inverse () const
 
template<bool EnableBool = true>
std::enable_if<(Rows==2) &&EnableBool, Matrix< Rows, Columns, T > >::type inverse () const
 
template<bool EnableBool = true>
std::enable_if<(Rows==3) &&EnableBool, Matrix< Rows, Columns, T > >::type inverse () const
 
template<bool EnableBool = true>
std::enable_if<(Rows==4) &&EnableBool, Matrix< Rows, Columns, T > >::type inverse () const
 
Matrix< Columns, Rows, T > transpose () const
 
template<bool EnableBool = true>
std::enable_if<(Rows==1) &&EnableBool, T >::type det () const
 
template<bool EnableBool = true>
std::enable_if<(Rows==2) &&EnableBool, T >::type det () const
 
template<bool EnableBool = true>
std::enable_if<(Rows==3) &&EnableBool, T >::type det () const
 
template<bool EnableBool = true>
std::enable_if<(Rows==4) &&EnableBool, T >::type det () const
 
template<bool EnableBool = true>
std::enable_if<(Rows > 4) &&EnableBool, T >::type det () const
 
template<bool EnableBool>
std::enable_if<(Rows==Columns) &&EnableBool, Matrix< Rows, Columns, T > >::type & operator*= (const Matrix< Rows, Columns, T > &rhs)
 
template<bool EnableBool>
std::enable_if<(Rows==Columns) &&EnableBool, Matrix< Rows, Columns, T > >::type & operator/= (const Matrix< Rows, Columns, T > &rhs)
 
template<bool EnableBool>
std::enable_if<(Rows==1) &&EnableBool, Matrix< Rows, Columns, T > >::type inverse () const
 
template<bool EnableBool>
std::enable_if<(Rows==2) &&EnableBool, Matrix< Rows, Columns, T > >::type inverse () const
 
template<bool EnableBool>
std::enable_if<(Rows==3) &&EnableBool, Matrix< Rows, Columns, T > >::type inverse () const
 
template<bool EnableBool>
std::enable_if<(Rows==4) &&EnableBool, Matrix< Rows, Columns, T > >::type inverse () const
 
template<bool EnableBool>
std::enable_if<(Rows==1) &&EnableBool, T >::type det () const
 
template<bool EnableBool>
std::enable_if<(Rows==2) &&EnableBool, T >::type det () const
 
template<bool EnableBool>
std::enable_if<(Rows==3) &&EnableBool, T >::type det () const
 
template<bool EnableBool>
std::enable_if<(Rows==4) &&EnableBool, T >::type det () const
 
template<bool EnableBool>
std::enable_if<(Rows > 4) &&EnableBool, T >::type det () const
 
template<bool EnableBool>
std::enable_if<(Rows==Columns) &&EnableBool, Matrix< Rows, Columns, T > >::type identity ()
 

Static Public Member Functions

template<bool EnableBool = true>
static std::enable_if<(Rows==Columns) &&EnableBool, Matrix< Rows, Columns, T > >::type identity ()
 

Protected Attributes

Values _values
 

Detailed Description

template<uint8_t Rows, uint8_t Columns, typename T = float>
class lug::Math::Matrix< Rows, Columns, T >

Definition at line 13 of file Matrix.hpp.

Member Typedef Documentation

◆ Values

template<uint8_t Rows, uint8_t Columns, typename T = float>
using lug::Math::Matrix< Rows, Columns, T >::Values = ValArray<Rows * Columns, T>

Definition at line 16 of file Matrix.hpp.

Constructor & Destructor Documentation

◆ Matrix() [1/6]

template<uint8_t Rows, uint8_t Columns, typename T = float>
constexpr lug::Math::Matrix< Rows, Columns, T >::Matrix ( )
default

◆ Matrix() [2/6]

template<uint8_t Rows, uint8_t Columns, typename T = float>
Matrix::Matrix ( value)
inlineexplicit

Definition at line 2 of file Matrix.inl.

◆ Matrix() [3/6]

template<uint8_t Rows, uint8_t Columns, typename T = float>
Matrix::Matrix ( const Values values)
inline

Definition at line 13 of file Matrix.inl.

◆ Matrix() [4/6]

template<uint8_t Rows, uint8_t Columns, typename T = float>
Matrix::Matrix ( std::initializer_list< T >  list)
inline

Definition at line 18 of file Matrix.inl.

◆ Matrix() [5/6]

template<uint8_t Rows, uint8_t Columns, typename T = float>
lug::Math::Matrix< Rows, Columns, T >::Matrix ( const Matrix< Rows, Columns, T > &  matrix)
default

◆ Matrix() [6/6]

template<uint8_t Rows, uint8_t Columns, typename T = float>
lug::Math::Matrix< Rows, Columns, T >::Matrix ( Matrix< Rows, Columns, T > &&  matrix)
default

◆ ~Matrix()

template<uint8_t Rows, uint8_t Columns, typename T = float>
lug::Math::Matrix< Rows, Columns, T >::~Matrix ( )
default

Member Function Documentation

◆ operator=() [1/2]

template<uint8_t Rows, uint8_t Columns, typename T = float>
Matrix<Rows, Columns, T>& lug::Math::Matrix< Rows, Columns, T >::operator= ( const Matrix< Rows, Columns, T > &  rhs)
default

◆ operator=() [2/2]

template<uint8_t Rows, uint8_t Columns, typename T = float>
Matrix<Rows, Columns, T>& lug::Math::Matrix< Rows, Columns, T >::operator= ( Matrix< Rows, Columns, T > &&  rhs)
default

◆ getRows()

template<uint8_t Rows, uint8_t Columns, typename T = float>
constexpr uint8_t Matrix::getRows ( ) const
inline

Definition at line 32 of file Matrix.inl.

◆ getColumns()

template<uint8_t Rows, uint8_t Columns, typename T = float>
constexpr uint8_t Matrix::getColumns ( ) const
inline

Definition at line 37 of file Matrix.inl.

◆ getValues() [1/2]

template<uint8_t Rows, uint8_t Columns, typename T = float>
Matrix< Rows, Columns, T >::Values & Matrix::getValues ( )
inline

Definition at line 42 of file Matrix.inl.

◆ getValues() [2/2]

template<uint8_t Rows, uint8_t Columns, typename T = float>
constexpr const Matrix< Rows, Columns, T >::Values & Matrix::getValues ( ) const
inline

Definition at line 47 of file Matrix.inl.

◆ operator()() [1/2]

template<uint8_t Rows, uint8_t Columns, typename T = float>
T& lug::Math::Matrix< Rows, Columns, T >::operator() ( uint8_t  row,
uint8_t  col = 0 
)

◆ operator()() [2/2]

template<uint8_t Rows, uint8_t Columns, typename T = float>
constexpr const T& lug::Math::Matrix< Rows, Columns, T >::operator() ( uint8_t  row,
uint8_t  col = 0 
) const

◆ operator+=() [1/2]

template<uint8_t Rows, uint8_t Columns, typename T = float>
Matrix< Rows, Columns, T > & Matrix::operator+= ( rhs)
inline

Definition at line 64 of file Matrix.inl.

◆ operator-=() [1/2]

template<uint8_t Rows, uint8_t Columns, typename T = float>
Matrix< Rows, Columns, T > & Matrix::operator-= ( rhs)
inline

Definition at line 70 of file Matrix.inl.

◆ operator*=() [1/3]

template<uint8_t Rows, uint8_t Columns, typename T = float>
Matrix< Rows, Columns, T > & Matrix::operator*= ( rhs)
inline

Definition at line 76 of file Matrix.inl.

◆ operator/=() [1/3]

template<uint8_t Rows, uint8_t Columns, typename T = float>
Matrix< Rows, Columns, T > & Matrix::operator/= ( rhs)
inline

Definition at line 82 of file Matrix.inl.

◆ operator+=() [2/2]

template<uint8_t Rows, uint8_t Columns, typename T = float>
Matrix< Rows, Columns, T > & Matrix::operator+= ( const Matrix< Rows, Columns, T > &  rhs)

Definition at line 90 of file Matrix.inl.

◆ operator-=() [2/2]

template<uint8_t Rows, uint8_t Columns, typename T = float>
Matrix< Rows, Columns, T > & Matrix::operator-= ( const Matrix< Rows, Columns, T > &  rhs)

Definition at line 96 of file Matrix.inl.

◆ operator*=() [2/3]

template<uint8_t Rows, uint8_t Columns, typename T = float>
template<bool EnableBool = true>
std::enable_if<(Rows == Columns) && EnableBool, Matrix<Rows, Columns, T> >::type& lug::Math::Matrix< Rows, Columns, T >::operator*= ( const Matrix< Rows, Columns, T > &  rhs)

◆ operator/=() [2/3]

template<uint8_t Rows, uint8_t Columns, typename T = float>
template<bool EnableBool = true>
std::enable_if<(Rows == Columns) && EnableBool, Matrix<Rows, Columns, T> >::type& lug::Math::Matrix< Rows, Columns, T >::operator/= ( const Matrix< Rows, Columns, T > &  rhs)

◆ inverse() [1/8]

template<uint8_t Rows, uint8_t Columns, typename T = float>
template<bool EnableBool = true>
std::enable_if<(Rows == 1) && EnableBool, Matrix<Rows, Columns, T> >::type lug::Math::Matrix< Rows, Columns, T >::inverse ( ) const

◆ inverse() [2/8]

template<uint8_t Rows, uint8_t Columns, typename T = float>
template<bool EnableBool = true>
std::enable_if<(Rows == 2) && EnableBool, Matrix<Rows, Columns, T> >::type lug::Math::Matrix< Rows, Columns, T >::inverse ( ) const

◆ inverse() [3/8]

template<uint8_t Rows, uint8_t Columns, typename T = float>
template<bool EnableBool = true>
std::enable_if<(Rows == 3) && EnableBool, Matrix<Rows, Columns, T> >::type lug::Math::Matrix< Rows, Columns, T >::inverse ( ) const

◆ inverse() [4/8]

template<uint8_t Rows, uint8_t Columns, typename T = float>
template<bool EnableBool = true>
std::enable_if<(Rows == 4) && EnableBool, Matrix<Rows, Columns, T> >::type lug::Math::Matrix< Rows, Columns, T >::inverse ( ) const

◆ transpose()

template<uint8_t Rows, uint8_t Columns, typename T = float>
Matrix< Columns, Rows, T > Matrix::transpose ( ) const
inline

Definition at line 331 of file Matrix.inl.

◆ det() [1/10]

template<uint8_t Rows, uint8_t Columns, typename T = float>
template<bool EnableBool = true>
std::enable_if<(Rows == 1) && EnableBool, T>::type lug::Math::Matrix< Rows, Columns, T >::det ( ) const

◆ det() [2/10]

template<uint8_t Rows, uint8_t Columns, typename T = float>
template<bool EnableBool = true>
std::enable_if<(Rows == 2) && EnableBool, T>::type lug::Math::Matrix< Rows, Columns, T >::det ( ) const

◆ det() [3/10]

template<uint8_t Rows, uint8_t Columns, typename T = float>
template<bool EnableBool = true>
std::enable_if<(Rows == 3) && EnableBool, T>::type lug::Math::Matrix< Rows, Columns, T >::det ( ) const

◆ det() [4/10]

template<uint8_t Rows, uint8_t Columns, typename T = float>
template<bool EnableBool = true>
std::enable_if<(Rows == 4) && EnableBool, T>::type lug::Math::Matrix< Rows, Columns, T >::det ( ) const

◆ det() [5/10]

template<uint8_t Rows, uint8_t Columns, typename T = float>
template<bool EnableBool = true>
std::enable_if<(Rows > 4) && EnableBool, T>::type lug::Math::Matrix< Rows, Columns, T >::det ( ) const

◆ identity() [1/2]

template<uint8_t Rows, uint8_t Columns, typename T = float>
template<bool EnableBool = true>
static std::enable_if<(Rows == Columns) && EnableBool, Matrix<Rows, Columns, T> >::type lug::Math::Matrix< Rows, Columns, T >::identity ( )
static

◆ operator*=() [3/3]

template<uint8_t Rows, uint8_t Columns, typename T = float>
template<bool EnableBool>
std::enable_if<(Rows == Columns) && EnableBool, Matrix<Rows, Columns, T> >::type& lug::Math::Matrix< Rows, Columns, T >::operator*= ( const Matrix< Rows, Columns, T > &  rhs)
inline

Definition at line 107 of file Matrix.inl.

◆ operator/=() [3/3]

template<uint8_t Rows, uint8_t Columns, typename T = float>
template<bool EnableBool>
std::enable_if<(Rows == Columns) && EnableBool, Matrix<Rows, Columns, T> >::type& lug::Math::Matrix< Rows, Columns, T >::operator/= ( const Matrix< Rows, Columns, T > &  rhs)
inline

Definition at line 123 of file Matrix.inl.

◆ inverse() [5/8]

template<uint8_t Rows, uint8_t Columns, typename T = float>
template<bool EnableBool>
std::enable_if<(Rows == 1) && EnableBool, Matrix<Rows, Columns, T> >::type lug::Math::Matrix< Rows, Columns, T >::inverse ( ) const
inline

Definition at line 139 of file Matrix.inl.

◆ inverse() [6/8]

template<uint8_t Rows, uint8_t Columns, typename T = float>
template<bool EnableBool>
std::enable_if<(Rows == 2) && EnableBool, Matrix<Rows, Columns, T> >::type lug::Math::Matrix< Rows, Columns, T >::inverse ( ) const
inline

Definition at line 152 of file Matrix.inl.

◆ inverse() [7/8]

template<uint8_t Rows, uint8_t Columns, typename T = float>
template<bool EnableBool>
std::enable_if<(Rows == 3) && EnableBool, Matrix<Rows, Columns, T> >::type lug::Math::Matrix< Rows, Columns, T >::inverse ( ) const
inline

Definition at line 170 of file Matrix.inl.

◆ inverse() [8/8]

template<uint8_t Rows, uint8_t Columns, typename T = float>
template<bool EnableBool>
std::enable_if<(Rows == 4) && EnableBool, Matrix<Rows, Columns, T> >::type lug::Math::Matrix< Rows, Columns, T >::inverse ( ) const
inline

Definition at line 195 of file Matrix.inl.

◆ det() [6/10]

template<uint8_t Rows, uint8_t Columns, typename T = float>
template<bool EnableBool>
std::enable_if<(Rows == 1) && EnableBool, T>::type lug::Math::Matrix< Rows, Columns, T >::det ( ) const
inline

Definition at line 350 of file Matrix.inl.

◆ det() [7/10]

template<uint8_t Rows, uint8_t Columns, typename T = float>
template<bool EnableBool>
std::enable_if<(Rows == 2) && EnableBool, T>::type lug::Math::Matrix< Rows, Columns, T >::det ( ) const
inline

Definition at line 363 of file Matrix.inl.

◆ det() [8/10]

template<uint8_t Rows, uint8_t Columns, typename T = float>
template<bool EnableBool>
std::enable_if<(Rows == 3) && EnableBool, T>::type lug::Math::Matrix< Rows, Columns, T >::det ( ) const
inline

Definition at line 379 of file Matrix.inl.

◆ det() [9/10]

template<uint8_t Rows, uint8_t Columns, typename T = float>
template<bool EnableBool>
std::enable_if<(Rows == 4) && EnableBool, T>::type lug::Math::Matrix< Rows, Columns, T >::det ( ) const
inline

Definition at line 399 of file Matrix.inl.

◆ det() [10/10]

template<uint8_t Rows, uint8_t Columns, typename T = float>
template<bool EnableBool>
std::enable_if<(Rows > 4) && EnableBool, T>::type lug::Math::Matrix< Rows, Columns, T >::det ( ) const

Definition at line 444 of file Matrix.inl.

◆ identity() [2/2]

template<uint8_t Rows, uint8_t Columns, typename T = float>
template<bool EnableBool>
std::enable_if<(Rows == Columns) && EnableBool, Matrix<Rows, Columns, T> >::type lug::Math::Matrix< Rows, Columns, T >::identity ( )
inline

Definition at line 483 of file Matrix.inl.

Member Data Documentation

◆ _values

template<uint8_t Rows, uint8_t Columns, typename T = float>
Values lug::Math::Matrix< Rows, Columns, T >::_values
protected

Definition at line 150 of file Matrix.hpp.


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