CAPD DynSys Library  5.2.0
capd::vectalg::Matrix< Scalar, rows, cols > Class Template Reference

#include <capd/vectalg/Matrix.h>

Classes

struct  rebind
 

Public Types

typedef Scalar ScalarType
 
typedef MatrixContainer< Scalar, rows, cols > ContainerType
 
typedef ContainerType::iterator iterator
 
typedef ContainerType::const_iterator const_iterator
 
typedef ContainerType::Dimension Dimension
 
typedef __size_type size_type
 
typedef __difference_type difference_type
 
typedef Vector< Scalar, cols > RowVectorType
 
typedef Vector< Scalar, rows > ColumnVectorType
 
typedef RowVector< Scalar, cols > RefRowVectorType
 
typedef ColumnVector< Scalar, rows > RefColumnVectorType
 
typedef Matrix< Scalar, rows, cols > MatrixType
 

Public Member Functions

 Matrix ()
 
 Matrix (size_type _rows, size_type _cols)
 
 Matrix (const ScalarType data[])
 
 Matrix (size_type _rows, size_type _cols, const ScalarType data[])
 
 Matrix (const char data[])
 
 Matrix (const std::string &data)
 
 Matrix (const Matrix &m)
 
 Matrix (const MatrixSlice< MatrixType > &m)
 
template<typename S , typename std::enable_if< std::is_convertible< S, ScalarType >::value &&!std::is_same< S, ScalarType >::value, int >::type = 0>
 Matrix (const Matrix< S, rows, cols > &)
 
 Matrix (const Dimension &dim)
 
 Matrix (const Dimension &d, bool)
 
 Matrix (size_type _rows, size_type _cols, bool)
 
template<__size_type dataRows, __size_type dataCols>
 Matrix (const Scalar(&data)[dataRows][dataCols])
 
Matrixoperator= (Matrix &&a) noexcept=default
 
 Matrix (Matrix &&m) noexcept=default
 
 Matrix (std::initializer_list< std::initializer_list< ScalarType > > l)
 
Matrixoperator= (const Matrix &a)
 
Matrixoperator+= (const Matrix &a)
 
Matrixoperator-= (const Matrix &a)
 
Matrixoperator= (const Scalar &s)
 
Matrixoperator+= (const Scalar &s)
 
Matrixoperator-= (const Scalar &s)
 
Matrixoperator*= (const Scalar &s)
 
Matrixoperator/= (const Scalar &s)
 
MatrixIterator< MatrixTypebeginMatrix ()
 
MatrixIterator< MatrixTypeendMatrix ()
 
MatrixIterator< MatrixTypebeginOfRow (size_type i)
 
MatrixIterator< MatrixTypebeginOfColumn (size_type j)
 
MatrixIterator< MatrixTypeendOfRow (size_type i)
 
MatrixIterator< MatrixTypeendOfColumn (size_type j)
 
const_MatrixIterator< MatrixTypebeginMatrix () const
 
const_MatrixIterator< MatrixTypeendMatrix () const
 
const_MatrixIterator< MatrixTypebeginOfRow (size_type i) const
 
const_MatrixIterator< MatrixTypebeginOfColumn (size_type j) const
 
const_MatrixIterator< MatrixTypeendOfRow (size_type i) const
 
const_MatrixIterator< MatrixTypeendOfColumn (size_type j) const
 
RowVector< Scalar, cols > operator[] (size_type i) const
 
RowVector< Scalar, cols > operator() (size_type i) const
 
Scalaroperator() (size_type i, size_type j)
 
const Scalaroperator() (size_type i, size_type j) const
 
Scalarat (size_type i, size_type j)
 
const Scalarat (size_type i, size_type j) const
 
void setToIdentity ()
 
RowVector< Scalar, cols > row (size_type i) const
 
ColumnVector< Scalar, rows > column (size_type j) const
 
void transpose ()
 
difference_type rowStride () const
 
difference_type columnStride () const
 
void Transpose ()
 
size_type numberOfRows () const
 
size_type numberOfColumns () const
 
void resize (size_type r, size_type c)
 

Static Public Member Functions

static Matrix Identity (size_type dim)
 
static MatrixmakeArray (size_type N, size_type r, size_type c)
 
static size_type degree ()
 
static Dimension dimension ()
 

Friends

std::istream & operator>> (std::istream &inp, MatrixType &a)
 

Member Typedef Documentation

◆ ColumnVectorType

template<typename Scalar , __size_type rows, __size_type cols>
typedef Vector<Scalar,rows> capd::vectalg::Matrix< Scalar, rows, cols >::ColumnVectorType

◆ const_iterator

template<typename Scalar , __size_type rows, __size_type cols>
typedef ContainerType::const_iterator capd::vectalg::Matrix< Scalar, rows, cols >::const_iterator

◆ ContainerType

template<typename Scalar , __size_type rows, __size_type cols>
typedef MatrixContainer<Scalar,rows,cols> capd::vectalg::Matrix< Scalar, rows, cols >::ContainerType

◆ difference_type

template<typename Scalar , __size_type rows, __size_type cols>
typedef __difference_type capd::vectalg::Matrix< Scalar, rows, cols >::difference_type

◆ Dimension

template<typename Scalar , __size_type rows, __size_type cols>
typedef ContainerType::Dimension capd::vectalg::Matrix< Scalar, rows, cols >::Dimension

◆ iterator

template<typename Scalar , __size_type rows, __size_type cols>
typedef ContainerType::iterator capd::vectalg::Matrix< Scalar, rows, cols >::iterator

◆ MatrixType

template<typename Scalar , __size_type rows, __size_type cols>
typedef Matrix<Scalar,rows,cols> capd::vectalg::Matrix< Scalar, rows, cols >::MatrixType

◆ RefColumnVectorType

template<typename Scalar , __size_type rows, __size_type cols>
typedef ColumnVector<Scalar,rows> capd::vectalg::Matrix< Scalar, rows, cols >::RefColumnVectorType

◆ RefRowVectorType

template<typename Scalar , __size_type rows, __size_type cols>
typedef RowVector<Scalar,cols> capd::vectalg::Matrix< Scalar, rows, cols >::RefRowVectorType

◆ RowVectorType

template<typename Scalar , __size_type rows, __size_type cols>
typedef Vector<Scalar,cols> capd::vectalg::Matrix< Scalar, rows, cols >::RowVectorType

◆ ScalarType

template<typename Scalar , __size_type rows, __size_type cols>
typedef Scalar capd::vectalg::Matrix< Scalar, rows, cols >::ScalarType

◆ size_type

template<typename Scalar , __size_type rows, __size_type cols>
typedef __size_type capd::vectalg::Matrix< Scalar, rows, cols >::size_type

Constructor & Destructor Documentation

◆ Matrix() [1/15]

template<typename Scalar , __size_type rows, __size_type cols>
capd::vectalg::Matrix< Scalar, rows, cols >::Matrix
inline

◆ Matrix() [2/15]

template<typename Scalar , __size_type rows, __size_type cols>
capd::vectalg::Matrix< Scalar, rows, cols >::Matrix ( size_type  _rows,
size_type  _cols 
)
inline

◆ Matrix() [3/15]

template<typename Scalar , __size_type rows, __size_type cols>
capd::vectalg::Matrix< Scalar, rows, cols >::Matrix ( const ScalarType  data[])

◆ Matrix() [4/15]

template<typename Scalar , __size_type rows, __size_type cols>
capd::vectalg::Matrix< Scalar, rows, cols >::Matrix ( size_type  _rows,
size_type  _cols,
const ScalarType  data[] 
)

◆ Matrix() [5/15]

template<typename Scalar , __size_type rows, __size_type cols>
capd::vectalg::Matrix< Scalar, rows, cols >::Matrix ( const char  data[])
explicit

◆ Matrix() [6/15]

template<typename Scalar , __size_type rows, __size_type cols>
capd::vectalg::Matrix< Scalar, rows, cols >::Matrix ( const std::string &  data)
explicit

◆ Matrix() [7/15]

template<typename Scalar , __size_type rows, __size_type cols>
capd::vectalg::Matrix< Scalar, rows, cols >::Matrix ( const Matrix< Scalar, rows, cols > &  m)
inline

◆ Matrix() [8/15]

template<typename Scalar , __size_type rows, __size_type cols>
capd::vectalg::Matrix< Scalar, rows, cols >::Matrix ( const MatrixSlice< MatrixType > &  m)

◆ Matrix() [9/15]

template<typename Scalar , __size_type rows, __size_type cols>
template<typename S , typename std::enable_if< std::is_convertible< S, Scalar >::value &&!std::is_same< S, Scalar >::value, int >::type >
capd::vectalg::Matrix< Scalar, rows, cols >::Matrix ( const Matrix< S, rows, cols > &  m)

◆ Matrix() [10/15]

template<typename Scalar , __size_type rows, __size_type cols>
capd::vectalg::Matrix< Scalar, rows, cols >::Matrix ( const Dimension dim)
inline

◆ Matrix() [11/15]

template<typename Scalar , __size_type rows, __size_type cols>
capd::vectalg::Matrix< Scalar, rows, cols >::Matrix ( const Dimension d,
bool   
)
inline

◆ Matrix() [12/15]

template<typename Scalar , __size_type rows, __size_type cols>
capd::vectalg::Matrix< Scalar, rows, cols >::Matrix ( size_type  _rows,
size_type  _cols,
bool   
)
inline

◆ Matrix() [13/15]

template<typename Scalar , __size_type rows, __size_type cols>
template<__size_type dataRows, __size_type dataCols>
capd::vectalg::Matrix< Scalar, rows, cols >::Matrix ( const Scalar(&)  data[dataRows][dataCols])

◆ Matrix() [14/15]

template<typename Scalar , __size_type rows, __size_type cols>
capd::vectalg::Matrix< Scalar, rows, cols >::Matrix ( Matrix< Scalar, rows, cols > &&  m)
defaultnoexcept

◆ Matrix() [15/15]

template<typename Scalar , __size_type rows, __size_type cols>
capd::vectalg::Matrix< Scalar, rows, cols >::Matrix ( std::initializer_list< std::initializer_list< ScalarType > >  l)
inline

Member Function Documentation

◆ at() [1/2]

template<typename Scalar , __size_type rows, __size_type cols>
Scalar * capd::vectalg::Matrix< Scalar, rows, cols >::at ( size_type  i,
size_type  j 
)
inline

◆ at() [2/2]

template<typename Scalar , __size_type rows, __size_type cols>
const Scalar * capd::vectalg::Matrix< Scalar, rows, cols >::at ( size_type  i,
size_type  j 
) const
inline

◆ beginMatrix() [1/2]

template<typename Scalar , __size_type rows, __size_type cols>
const_MatrixIterator< Matrix< Scalar, rows, cols > > capd::vectalg::Matrix< Scalar, rows, cols >::beginMatrix
inline

◆ beginMatrix() [2/2]

template<typename Scalar , __size_type rows, __size_type cols>
const_MatrixIterator< MatrixType > capd::vectalg::Matrix< Scalar, rows, cols >::beginMatrix ( ) const

◆ beginOfColumn() [1/2]

template<typename Scalar , __size_type rows, __size_type cols>
MatrixIterator< Matrix< Scalar, rows, cols > > capd::vectalg::Matrix< Scalar, rows, cols >::beginOfColumn ( size_type  j)
inline

◆ beginOfColumn() [2/2]

template<typename Scalar , __size_type rows, __size_type cols>
const_MatrixIterator< Matrix< Scalar, rows, cols > > capd::vectalg::Matrix< Scalar, rows, cols >::beginOfColumn ( size_type  j) const
inline

◆ beginOfRow() [1/2]

template<typename Scalar , __size_type rows, __size_type cols>
MatrixIterator< Matrix< Scalar, rows, cols > > capd::vectalg::Matrix< Scalar, rows, cols >::beginOfRow ( size_type  i)
inline

◆ beginOfRow() [2/2]

template<typename Scalar , __size_type rows, __size_type cols>
const_MatrixIterator< Matrix< Scalar, rows, cols > > capd::vectalg::Matrix< Scalar, rows, cols >::beginOfRow ( size_type  i) const
inline

◆ column()

template<typename Scalar , __size_type rows, __size_type cols>
ColumnVector< Scalar, rows > capd::vectalg::Matrix< Scalar, rows, cols >::column ( size_type  j) const
inline

◆ columnStride()

template<typename Scalar , __size_type rows, __size_type cols>
difference_type capd::vectalg::Matrix< Scalar, rows, cols >::columnStride ( ) const
inline

◆ degree()

template<typename Scalar , __size_type rows, __size_type cols>
static size_type capd::vectalg::Matrix< Scalar, rows, cols >::degree ( )
inlinestatic

◆ dimension()

template<typename Scalar , __size_type rows, __size_type cols>
static Dimension capd::vectalg::MatrixContainer< Scalar, rows, cols >::dimension
inlinestatic

◆ endMatrix() [1/2]

template<typename Scalar , __size_type rows, __size_type cols>
const_MatrixIterator< Matrix< Scalar, rows, cols > > capd::vectalg::Matrix< Scalar, rows, cols >::endMatrix
inline

◆ endMatrix() [2/2]

template<typename Scalar , __size_type rows, __size_type cols>
const_MatrixIterator< MatrixType > capd::vectalg::Matrix< Scalar, rows, cols >::endMatrix ( ) const

◆ endOfColumn() [1/2]

template<typename Scalar , __size_type rows, __size_type cols>
MatrixIterator< Matrix< Scalar, rows, cols > > capd::vectalg::Matrix< Scalar, rows, cols >::endOfColumn ( size_type  j)
inline

◆ endOfColumn() [2/2]

template<typename Scalar , __size_type rows, __size_type cols>
const_MatrixIterator< Matrix< Scalar, rows, cols > > capd::vectalg::Matrix< Scalar, rows, cols >::endOfColumn ( size_type  j) const
inline

◆ endOfRow() [1/2]

template<typename Scalar , __size_type rows, __size_type cols>
MatrixIterator< Matrix< Scalar, rows, cols > > capd::vectalg::Matrix< Scalar, rows, cols >::endOfRow ( size_type  i)
inline

◆ endOfRow() [2/2]

template<typename Scalar , __size_type rows, __size_type cols>
const_MatrixIterator< Matrix< Scalar, rows, cols > > capd::vectalg::Matrix< Scalar, rows, cols >::endOfRow ( size_type  i) const
inline

◆ Identity()

template<typename Scalar , __size_type rows, __size_type cols>
template Matrix< int, CAPD_DEFAULT_DIMENSION, CAPD_DEFAULT_DIMENSION > capd::vectalg::Matrix< Scalar, rows, cols >::Identity ( size_type  dim)
static

◆ makeArray()

template<typename Scalar , __size_type rows, __size_type cols>
Matrix< Scalar, rows, cols > * capd::vectalg::Matrix< Scalar, rows, cols >::makeArray ( size_type  N,
size_type  r,
size_type  c 
)
static

◆ numberOfColumns()

template<typename Scalar , __size_type rows, __size_type cols>
size_type capd::vectalg::MatrixContainer< Scalar, rows, cols >::numberOfColumns
inline

◆ numberOfRows()

template<typename Scalar , __size_type rows, __size_type cols>
size_type capd::vectalg::MatrixContainer< Scalar, rows, cols >::numberOfRows
inline

◆ operator()() [1/3]

template<typename Scalar , __size_type rows, __size_type cols>
RowVector< Scalar, cols > capd::vectalg::Matrix< Scalar, rows, cols >::operator() ( size_type  i) const
inline

◆ operator()() [2/3]

template<typename Scalar , __size_type rows, __size_type cols>
Scalar & capd::vectalg::Matrix< Scalar, rows, cols >::operator() ( size_type  i,
size_type  j 
)
inline

◆ operator()() [3/3]

template<typename Scalar , __size_type rows, __size_type cols>
const Scalar & capd::vectalg::Matrix< Scalar, rows, cols >::operator() ( size_type  i,
size_type  j 
) const
inline

◆ operator*=()

template<typename Scalar , __size_type rows, __size_type cols>
Matrix< Scalar, rows, cols > & capd::vectalg::Matrix< Scalar, rows, cols >::operator*= ( const Scalar s)
inline

◆ operator+=() [1/2]

template<typename Scalar , __size_type rows, __size_type cols>
Matrix< Scalar, rows, cols > & capd::vectalg::Matrix< Scalar, rows, cols >::operator+= ( const Matrix< Scalar, rows, cols > &  a)
inline

◆ operator+=() [2/2]

template<typename Scalar , __size_type rows, __size_type cols>
Matrix< Scalar, rows, cols > & capd::vectalg::Matrix< Scalar, rows, cols >::operator+= ( const Scalar s)
inline

◆ operator-=() [1/2]

template<typename Scalar , __size_type rows, __size_type cols>
Matrix< Scalar, rows, cols > & capd::vectalg::Matrix< Scalar, rows, cols >::operator-= ( const Matrix< Scalar, rows, cols > &  a)
inline

◆ operator-=() [2/2]

template<typename Scalar , __size_type rows, __size_type cols>
Matrix< Scalar, rows, cols > & capd::vectalg::Matrix< Scalar, rows, cols >::operator-= ( const Scalar s)
inline

◆ operator/=()

template<typename Scalar , __size_type rows, __size_type cols>
Matrix< Scalar, rows, cols > & capd::vectalg::Matrix< Scalar, rows, cols >::operator/= ( const Scalar s)
inline

◆ operator=() [1/3]

template<typename Scalar , __size_type rows, __size_type cols>
Matrix< Scalar, rows, cols > & capd::vectalg::Matrix< Scalar, rows, cols >::operator= ( const Matrix< Scalar, rows, cols > &  a)
inline

◆ operator=() [2/3]

template<typename Scalar , __size_type rows, __size_type cols>
Matrix< Scalar, rows, cols > & capd::vectalg::Matrix< Scalar, rows, cols >::operator= ( const Scalar s)
inline

◆ operator=() [3/3]

template<typename Scalar , __size_type rows, __size_type cols>
Matrix& capd::vectalg::Matrix< Scalar, rows, cols >::operator= ( Matrix< Scalar, rows, cols > &&  a)
defaultnoexcept

◆ operator[]()

template<typename Scalar , __size_type rows, __size_type cols>
RowVector< Scalar, cols > capd::vectalg::Matrix< Scalar, rows, cols >::operator[] ( size_type  i) const
inline

◆ resize()

template<typename Scalar , __size_type rows, __size_type cols>
void capd::vectalg::MatrixContainer< Scalar, rows, cols >::resize
inline

◆ row()

template<typename Scalar , __size_type rows, __size_type cols>
RowVector< Scalar, cols > capd::vectalg::Matrix< Scalar, rows, cols >::row ( size_type  i) const
inline

◆ rowStride()

template<typename Scalar , __size_type rows, __size_type cols>
difference_type capd::vectalg::Matrix< Scalar, rows, cols >::rowStride ( ) const
inline

◆ setToIdentity()

template<typename Scalar , __size_type rows, __size_type cols>
template void capd::vectalg::Matrix< Scalar, rows, cols >::setToIdentity ( )

◆ transpose()

template<typename Scalar , __size_type rows, __size_type cols>
void capd::vectalg::Matrix< Scalar, rows, cols >::transpose

◆ Transpose()

template<typename Scalar , __size_type rows, __size_type cols>
void capd::vectalg::Matrix< Scalar, rows, cols >::Transpose ( )
inline

Friends And Related Function Documentation

◆ operator>>

template<typename Scalar , __size_type rows, __size_type cols>
std::istream& operator>> ( std::istream &  inp,
MatrixType a 
)
friend