EEROS  1.0.0.0
API for the EEROS Real-Time Robotics Framework
eeros::math::Matrix< M, N, T > Class Template Reference

#include <Matrix.hpp>

Collaboration diagram for eeros::math::Matrix< M, N, T >:

Classes

class  MatrixInitializer
 

Public Types

using value_type = T
 

Public Member Functions

 Matrix ()
 
 Matrix (const T v)
 
template<typename... S>
 Matrix (const S...v)
 
void zero ()
 
void eye ()
 
void fill (T v)
 
void rotx (double angle)
 
void roty (double angle)
 
void rotz (double angle)
 
MatrixInitializer< M, N, T > operator<< (T right)
 
const T get (unsigned int m, unsigned int n) const
 
Matrix< M, 1, T > getCol (unsigned int n) const
 
std::vector< T > getColVector (unsigned int n) const
 
Matrix< 1, N, T > getRow (unsigned int m) const
 
std::vector< T > getRowVector (unsigned int m) const
 
template<unsigned int U, unsigned int V>
Matrix< U, V, T > getSubMatrix (unsigned int m, unsigned int n) const
 
void set (unsigned int m, unsigned int n, T value)
 
void setCol (unsigned int n, const Matrix< M, 1, T > &col)
 
void setCol (unsigned int n, const std::vector< T > &col)
 
void setRow (unsigned int m, const Matrix< 1, N, T > &row)
 
void setRow (unsigned int m, const std::vector< T > &col)
 
T & operator() (unsigned int m, unsigned int n)
 
const T operator() (unsigned int m, unsigned int n) const
 
T & operator() (unsigned int i)
 
const T operator() (unsigned int i) const
 
T & operator[] (unsigned int i)
 
const T operator[] (unsigned int i) const
 
constexpr bool isSquare () const
 
bool isOrthogonal () const
 
bool isSymmetric () const
 
bool isDiagonal () const
 
bool isLowerTriangular () const
 
bool isUpperTriangular () const
 
bool isInvertible () const
 
constexpr unsigned int getNofRows () const
 
constexpr unsigned int getNofColums () const
 
constexpr unsigned int size () const
 
unsigned int rank () const
 
det () const
 
trace () const
 
Matrix< N, M, T > transpose () const
 
bool operator== (const Matrix< M, N, T > &right) const
 
bool operator!= (const Matrix< M, N, T > &right) const
 
bool operator< (const Matrix< M, N, T > &right) const
 
bool operator<= (const Matrix< M, N, T > &right) const
 
bool operator> (const Matrix< M, N, T > &right) const
 
bool operator>= (const Matrix< M, N, T > &right) const
 
Matrix< M, N, T > & operator= (T right)
 
template<unsigned int K>
Matrix< M, K, T > operator* (const Matrix< N, K, T > right) const
 
Matrix< M, N, T > operator* (T right) const
 
Matrix< M, N, T > multiplyElementWise (const Matrix< M, N, T > right) const
 
Matrix< M, N, T > operator+ (const Matrix< M, N, T > right) const
 
Matrix< M, N, T > operator+ (const T right) const
 
Matrix< M, N, T > & operator+= (const Matrix< M, N, T > right)
 
Matrix< M, N, T > operator- (const Matrix< M, N, T > right) const
 
Matrix< M, N, T > operator- (const T right) const
 
Matrix< M, N, T > & operator-= (const Matrix< M, N, T > right)
 
Matrix< M, N, T > operator- ()
 
Matrix< M, N, T > operator/ (T right) const
 
Matrix< M, N, T > operator! () const
 
norm () const
 
void gaussRowElimination ()
 
void sortForGaussAlgorithm ()
 
void swapRows (unsigned int rowA, unsigned int rowB)
 

Static Public Member Functions

static Matrix< M, N, T > createRotX (double angle)
 
static Matrix< M, N, T > createRotY (double angle)
 
static Matrix< M, N, T > createRotZ (double angle)
 
static Matrix< 2, 1, T > createVector2 (T x, T y)
 
static Matrix< 3, 1, T > createVector3 (T x, T y, T z)
 
static Matrix< M, N, T > createDiag (T v)
 
static Matrix< 3, 3, T > createSkewSymmetric (Matrix< 3, 1, T > a)
 
static Matrix< 3, 1, T > crossProduct (Matrix< 3, 1, T > a, Matrix< 3, 1, T > b)
 

Protected Attributes

value [M *N]
 

Member Typedef Documentation

template<unsigned int M, unsigned int N = 1, typename T = double>
using eeros::math::Matrix< M, N, T >::value_type = T

Constructor & Destructor Documentation

template<unsigned int M, unsigned int N = 1, typename T = double>
eeros::math::Matrix< M, N, T >::Matrix ( )
inline
template<unsigned int M, unsigned int N = 1, typename T = double>
eeros::math::Matrix< M, N, T >::Matrix ( const T  v)
inline
template<unsigned int M, unsigned int N = 1, typename T = double>
template<typename... S>
eeros::math::Matrix< M, N, T >::Matrix ( const S...  v)
inline

Member Function Documentation

template<unsigned int M, unsigned int N = 1, typename T = double>
static Matrix<M, N, T> eeros::math::Matrix< M, N, T >::createDiag ( v)
inlinestatic
template<unsigned int M, unsigned int N = 1, typename T = double>
static Matrix<M, N, T> eeros::math::Matrix< M, N, T >::createRotX ( double  angle)
inlinestatic
template<unsigned int M, unsigned int N = 1, typename T = double>
static Matrix<M, N, T> eeros::math::Matrix< M, N, T >::createRotY ( double  angle)
inlinestatic
template<unsigned int M, unsigned int N = 1, typename T = double>
static Matrix<M, N, T> eeros::math::Matrix< M, N, T >::createRotZ ( double  angle)
inlinestatic
template<unsigned int M, unsigned int N = 1, typename T = double>
static Matrix<3, 3, T> eeros::math::Matrix< M, N, T >::createSkewSymmetric ( Matrix< 3, 1, T >  a)
inlinestatic
template<unsigned int M, unsigned int N = 1, typename T = double>
static Matrix<2, 1, T> eeros::math::Matrix< M, N, T >::createVector2 ( x,
y 
)
inlinestatic
template<unsigned int M, unsigned int N = 1, typename T = double>
static Matrix<3, 1, T> eeros::math::Matrix< M, N, T >::createVector3 ( x,
y,
z 
)
inlinestatic
template<unsigned int M, unsigned int N = 1, typename T = double>
static Matrix<3, 1, T> eeros::math::Matrix< M, N, T >::crossProduct ( Matrix< 3, 1, T >  a,
Matrix< 3, 1, T >  b 
)
inlinestatic
template<unsigned int M, unsigned int N = 1, typename T = double>
T eeros::math::Matrix< M, N, T >::det ( ) const
inline
template<unsigned int M, unsigned int N = 1, typename T = double>
void eeros::math::Matrix< M, N, T >::eye ( )
inline
template<unsigned int M, unsigned int N = 1, typename T = double>
void eeros::math::Matrix< M, N, T >::fill ( v)
inline
template<unsigned int M, unsigned int N = 1, typename T = double>
void eeros::math::Matrix< M, N, T >::gaussRowElimination ( )
inline
template<unsigned int M, unsigned int N = 1, typename T = double>
const T eeros::math::Matrix< M, N, T >::get ( unsigned int  m,
unsigned int  n 
) const
inline
template<unsigned int M, unsigned int N = 1, typename T = double>
Matrix<M, 1, T> eeros::math::Matrix< M, N, T >::getCol ( unsigned int  n) const
inline
template<unsigned int M, unsigned int N = 1, typename T = double>
std::vector<T> eeros::math::Matrix< M, N, T >::getColVector ( unsigned int  n) const
inline
template<unsigned int M, unsigned int N = 1, typename T = double>
constexpr unsigned int eeros::math::Matrix< M, N, T >::getNofColums ( ) const
inline
template<unsigned int M, unsigned int N = 1, typename T = double>
constexpr unsigned int eeros::math::Matrix< M, N, T >::getNofRows ( ) const
inline
template<unsigned int M, unsigned int N = 1, typename T = double>
Matrix<1, N, T> eeros::math::Matrix< M, N, T >::getRow ( unsigned int  m) const
inline
template<unsigned int M, unsigned int N = 1, typename T = double>
std::vector<T> eeros::math::Matrix< M, N, T >::getRowVector ( unsigned int  m) const
inline
template<unsigned int M, unsigned int N = 1, typename T = double>
template<unsigned int U, unsigned int V>
Matrix<U, V, T> eeros::math::Matrix< M, N, T >::getSubMatrix ( unsigned int  m,
unsigned int  n 
) const
inline
template<unsigned int M, unsigned int N = 1, typename T = double>
bool eeros::math::Matrix< M, N, T >::isDiagonal ( ) const
inline
template<unsigned int M, unsigned int N = 1, typename T = double>
bool eeros::math::Matrix< M, N, T >::isInvertible ( ) const
inline
template<unsigned int M, unsigned int N = 1, typename T = double>
bool eeros::math::Matrix< M, N, T >::isLowerTriangular ( ) const
inline
template<unsigned int M, unsigned int N = 1, typename T = double>
bool eeros::math::Matrix< M, N, T >::isOrthogonal ( ) const
inline
template<unsigned int M, unsigned int N = 1, typename T = double>
constexpr bool eeros::math::Matrix< M, N, T >::isSquare ( ) const
inline
template<unsigned int M, unsigned int N = 1, typename T = double>
bool eeros::math::Matrix< M, N, T >::isSymmetric ( ) const
inline
template<unsigned int M, unsigned int N = 1, typename T = double>
bool eeros::math::Matrix< M, N, T >::isUpperTriangular ( ) const
inline
template<unsigned int M, unsigned int N = 1, typename T = double>
Matrix<M, N, T> eeros::math::Matrix< M, N, T >::multiplyElementWise ( const Matrix< M, N, T >  right) const
inline
template<unsigned int M, unsigned int N = 1, typename T = double>
T eeros::math::Matrix< M, N, T >::norm ( ) const
inline
template<unsigned int M, unsigned int N = 1, typename T = double>
Matrix<M, N, T> eeros::math::Matrix< M, N, T >::operator! ( ) const
inline
template<unsigned int M, unsigned int N = 1, typename T = double>
bool eeros::math::Matrix< M, N, T >::operator!= ( const Matrix< M, N, T > &  right) const
inline

Compares this matrix to another matrix.

Parameters
rightThis matrix is compared to right.
Returns
true if at least one element of this matrix is not equal to the element in the matrix right.
template<unsigned int M, unsigned int N = 1, typename T = double>
T& eeros::math::Matrix< M, N, T >::operator() ( unsigned int  m,
unsigned int  n 
)
inline
template<unsigned int M, unsigned int N = 1, typename T = double>
const T eeros::math::Matrix< M, N, T >::operator() ( unsigned int  m,
unsigned int  n 
) const
inline
template<unsigned int M, unsigned int N = 1, typename T = double>
T& eeros::math::Matrix< M, N, T >::operator() ( unsigned int  i)
inline
template<unsigned int M, unsigned int N = 1, typename T = double>
const T eeros::math::Matrix< M, N, T >::operator() ( unsigned int  i) const
inline
template<unsigned int M, unsigned int N = 1, typename T = double>
template<unsigned int K>
Matrix<M, K, T> eeros::math::Matrix< M, N, T >::operator* ( const Matrix< N, K, T >  right) const
inline
template<unsigned int M, unsigned int N = 1, typename T = double>
Matrix<M, N, T> eeros::math::Matrix< M, N, T >::operator* ( right) const
inline
template<unsigned int M, unsigned int N = 1, typename T = double>
Matrix<M, N, T> eeros::math::Matrix< M, N, T >::operator+ ( const Matrix< M, N, T >  right) const
inline
template<unsigned int M, unsigned int N = 1, typename T = double>
Matrix<M, N, T> eeros::math::Matrix< M, N, T >::operator+ ( const T  right) const
inline
template<unsigned int M, unsigned int N = 1, typename T = double>
Matrix<M, N, T>& eeros::math::Matrix< M, N, T >::operator+= ( const Matrix< M, N, T >  right)
inline
template<unsigned int M, unsigned int N = 1, typename T = double>
Matrix<M, N, T> eeros::math::Matrix< M, N, T >::operator- ( const Matrix< M, N, T >  right) const
inline
template<unsigned int M, unsigned int N = 1, typename T = double>
Matrix<M, N, T> eeros::math::Matrix< M, N, T >::operator- ( const T  right) const
inline
template<unsigned int M, unsigned int N = 1, typename T = double>
Matrix<M, N, T> eeros::math::Matrix< M, N, T >::operator- ( )
inline
template<unsigned int M, unsigned int N = 1, typename T = double>
Matrix<M, N, T>& eeros::math::Matrix< M, N, T >::operator-= ( const Matrix< M, N, T >  right)
inline
template<unsigned int M, unsigned int N = 1, typename T = double>
Matrix<M, N, T> eeros::math::Matrix< M, N, T >::operator/ ( right) const
inline
template<unsigned int M, unsigned int N = 1, typename T = double>
bool eeros::math::Matrix< M, N, T >::operator< ( const Matrix< M, N, T > &  right) const
inline

Compares this matrix to another matrix.

Parameters
rightThis matrix is compared to right.
Returns
true if every element of this matrix is smaller than the element in the matrix right.
template<unsigned int M, unsigned int N = 1, typename T = double>
MatrixInitializer<M, N, T> eeros::math::Matrix< M, N, T >::operator<< ( right)
inline
template<unsigned int M, unsigned int N = 1, typename T = double>
bool eeros::math::Matrix< M, N, T >::operator<= ( const Matrix< M, N, T > &  right) const
inline

Compares this matrix to another matrix.

Parameters
rightThis matrix is compared to right.
Returns
true if every element of this matrix is smaller than or equal to the element in the matrix right.
template<unsigned int M, unsigned int N = 1, typename T = double>
Matrix<M, N, T>& eeros::math::Matrix< M, N, T >::operator= ( right)
inline
template<unsigned int M, unsigned int N = 1, typename T = double>
bool eeros::math::Matrix< M, N, T >::operator== ( const Matrix< M, N, T > &  right) const
inline

Compares this matrix to another matrix.

Parameters
rightThis matrix is compared to right.
Returns
true if every element of this matrix is equal to the element in the matrix right.
template<unsigned int M, unsigned int N = 1, typename T = double>
bool eeros::math::Matrix< M, N, T >::operator> ( const Matrix< M, N, T > &  right) const
inline

Compares this matrix to another matrix.

Parameters
rightThis matrix is compared to right.
Returns
true if every element of this matrix is greater than the element in the matrix right.
template<unsigned int M, unsigned int N = 1, typename T = double>
bool eeros::math::Matrix< M, N, T >::operator>= ( const Matrix< M, N, T > &  right) const
inline

Compares this matrix to another matrix.

Parameters
rightThis matrix is compared to right.
Returns
true if every element of this matrix is greater than or equal to the element in the matrix right.
template<unsigned int M, unsigned int N = 1, typename T = double>
T& eeros::math::Matrix< M, N, T >::operator[] ( unsigned int  i)
inline
template<unsigned int M, unsigned int N = 1, typename T = double>
const T eeros::math::Matrix< M, N, T >::operator[] ( unsigned int  i) const
inline
template<unsigned int M, unsigned int N = 1, typename T = double>
unsigned int eeros::math::Matrix< M, N, T >::rank ( ) const
inline
template<unsigned int M, unsigned int N = 1, typename T = double>
void eeros::math::Matrix< M, N, T >::rotx ( double  angle)
inline
template<unsigned int M, unsigned int N = 1, typename T = double>
void eeros::math::Matrix< M, N, T >::roty ( double  angle)
inline
template<unsigned int M, unsigned int N = 1, typename T = double>
void eeros::math::Matrix< M, N, T >::rotz ( double  angle)
inline
template<unsigned int M, unsigned int N = 1, typename T = double>
void eeros::math::Matrix< M, N, T >::set ( unsigned int  m,
unsigned int  n,
value 
)
inline
template<unsigned int M, unsigned int N = 1, typename T = double>
void eeros::math::Matrix< M, N, T >::setCol ( unsigned int  n,
const Matrix< M, 1, T > &  col 
)
inline
template<unsigned int M, unsigned int N = 1, typename T = double>
void eeros::math::Matrix< M, N, T >::setCol ( unsigned int  n,
const std::vector< T > &  col 
)
inline
template<unsigned int M, unsigned int N = 1, typename T = double>
void eeros::math::Matrix< M, N, T >::setRow ( unsigned int  m,
const Matrix< 1, N, T > &  row 
)
inline
template<unsigned int M, unsigned int N = 1, typename T = double>
void eeros::math::Matrix< M, N, T >::setRow ( unsigned int  m,
const std::vector< T > &  col 
)
inline
template<unsigned int M, unsigned int N = 1, typename T = double>
constexpr unsigned int eeros::math::Matrix< M, N, T >::size ( ) const
inline
template<unsigned int M, unsigned int N = 1, typename T = double>
void eeros::math::Matrix< M, N, T >::sortForGaussAlgorithm ( )
inline
template<unsigned int M, unsigned int N = 1, typename T = double>
void eeros::math::Matrix< M, N, T >::swapRows ( unsigned int  rowA,
unsigned int  rowB 
)
inline
template<unsigned int M, unsigned int N = 1, typename T = double>
T eeros::math::Matrix< M, N, T >::trace ( ) const
inline
template<unsigned int M, unsigned int N = 1, typename T = double>
Matrix<N, M, T> eeros::math::Matrix< M, N, T >::transpose ( ) const
inline
template<unsigned int M, unsigned int N = 1, typename T = double>
void eeros::math::Matrix< M, N, T >::zero ( )
inline

Member Data Documentation

template<unsigned int M, unsigned int N = 1, typename T = double>
T eeros::math::Matrix< M, N, T >::value[M *N]
protected

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