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
 
typedef Container< Scalar, rows > ColumnContainer
 
typedef Container< Scalar, cols > RowContainer
 
typedef std::reverse_iterator< iteratorreverse_iterator
 
typedef std::reverse_iterator< const_iteratorconst_reverse_iterator
 

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)
 
void resize (size_type newCapacity)
 
iterator begin ()
 
const_iterator begin () const
 
iterator end ()
 
const_iterator end () const
 
reverse_iterator rbegin ()
 
const_reverse_iterator rbegin () const
 
reverse_iterator rend ()
 
const_reverse_iterator rend () const
 
ScalarTypeoperator[] (size_type)
 
ScalarTypeoperator() (size_type)
 
void clear ()
 

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 ()
 
static size_type size ()
 

Static Public Attributes

static const size_type ROWS = rows
 
static const size_type COLS = cols
 

Protected Attributes

ScalarType data [capacity]
 

Friends

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

Member Typedef Documentation

◆ ColumnContainer

template<typename Scalar , __size_type rows, __size_type cols>
typedef Container<Scalar,rows> capd::vectalg::MatrixContainer< Scalar, rows, cols >::ColumnContainer
inherited

◆ 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

◆ const_reverse_iterator

typedef std::reverse_iterator<const_iterator> capd::vectalg::Container< Scalar, capacity >::const_reverse_iterator
inherited

◆ 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

◆ reverse_iterator

typedef std::reverse_iterator<iterator> capd::vectalg::Container< Scalar, capacity >::reverse_iterator
inherited

◆ RowContainer

template<typename Scalar , __size_type rows, __size_type cols>
typedef Container<Scalar,cols> capd::vectalg::MatrixContainer< Scalar, rows, cols >::RowContainer
inherited

◆ 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

◆ begin() [1/2]

Container< Scalar, capacity >::iterator capd::vectalg::Container< Scalar, capacity >::begin
inlineinherited

◆ begin() [2/2]

Container< Scalar, capacity >::const_iterator capd::vectalg::Container< Scalar, capacity >::begin
inlineinherited

◆ beginMatrix() [1/2]

template<typename Scalar , __size_type rows, __size_type cols>
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< Matrix< Scalar, rows, cols > > capd::vectalg::Matrix< Scalar, rows, cols >::beginMatrix
inline

◆ 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

◆ clear()

void capd::vectalg::Container< Scalar, capacity >::clear
inherited

◆ 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

◆ end() [1/2]

Container< Scalar, capacity >::iterator capd::vectalg::Container< Scalar, capacity >::end
inlineinherited

◆ end() [2/2]

Container< Scalar, capacity >::const_iterator capd::vectalg::Container< Scalar, capacity >::end
inlineinherited

◆ endMatrix() [1/2]

template<typename Scalar , __size_type rows, __size_type cols>
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< Matrix< Scalar, rows, cols > > capd::vectalg::Matrix< Scalar, rows, cols >::endMatrix
inline

◆ 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 ( ) const
inline

◆ numberOfRows()

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

◆ operator()() [1/4]

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/4]

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/4]

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()() [4/4]

Scalar & capd::vectalg::Container< Scalar, capacity >::operator() ( size_type  i)
inlineinherited

◆ 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[]() [1/2]

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/2]

Scalar & capd::vectalg::Container< Scalar, capacity >::operator[] ( size_type  i)
inlineinherited

◆ rbegin() [1/2]

Container< Scalar, capacity >::reverse_iterator capd::vectalg::Container< Scalar, capacity >::rbegin
inlineinherited

◆ rbegin() [2/2]

Container< Scalar, capacity >::const_reverse_iterator capd::vectalg::Container< Scalar, capacity >::rbegin
inlineinherited

◆ rend() [1/2]

Container< Scalar, capacity >::reverse_iterator capd::vectalg::Container< Scalar, capacity >::rend
inlineinherited

◆ rend() [2/2]

Container< Scalar, capacity >::const_reverse_iterator capd::vectalg::Container< Scalar, capacity >::rend
inlineinherited

◆ resize() [1/2]

void capd::vectalg::Container< Scalar, capacity >::resize ( size_type  newCapacity)
inherited

◆ resize() [2/2]

template<typename Scalar , __size_type rows, __size_type cols>
void capd::vectalg::MatrixContainer< Scalar, rows, cols >::resize ( size_type  r,
size_type  c 
)
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 ( )

◆ size()

static size_type capd::vectalg::Container< Scalar, capacity >::size ( )
inlinestaticinherited

◆ 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

Member Data Documentation

◆ COLS

template<typename Scalar , __size_type rows, __size_type cols>
const size_type capd::vectalg::MatrixContainer< Scalar, rows, cols >::COLS = cols
staticinherited

◆ data

ScalarType capd::vectalg::Container< Scalar, capacity >::data[capacity]
protectedinherited

◆ ROWS

template<typename Scalar , __size_type rows, __size_type cols>
const size_type capd::vectalg::MatrixContainer< Scalar, rows, cols >::ROWS = rows
staticinherited