G+Smo  24.08.0
Geometry + Simulation Modules
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
gsMatrix< T, _Rows, _Cols, _Options > Class Template Reference

Detailed Description

template<class T, int _Rows, int _Cols, int _Options>
class gismo::gsMatrix< T, _Rows, _Cols, _Options >

A matrix with arbitrary coefficient type and fixed or dynamic size.

Forward declaration of gsMatrix class.

This class provides an interface to gsEigen::Matrix from the Eigen linear algebra library. Most operations from Eigen are supported on a gsMatrix.

See therefore also the Eigen documentation for dense matrices, http://eigen.tuxfamily.org/dox/group__QuickRefPage.html

Template Parameters
Tcoefficient type
_Rowsnumber of rows: an integer or Dynamic
_Colsnumber of rows: an integer or Dynamic
_Optionsfurther options; see Eigen documentation
+ Inheritance diagram for gsMatrix< T, _Rows, _Cols, _Options >:

Public Types

typedef memory::shared_ptr
< gsMatrix
Ptr
 Shared pointer for gsMatrix.
 
typedef memory::unique_ptr
< gsMatrix
uPtr
 Unique pointer for gsMatrix.
 

Public Member Functions

gsAsMatrix< T, 1, Dynamic > asRowVector ()
 
gsAsConstMatrix< T, 1, Dynamic > asRowVector () const
 
gsAsVector< T, Dynamic > asVector ()
 Returns the entries of the matrix resized to a n*m vector column-wise.
 
gsAsConstVector< T, Dynamic > asVector () const
 Returns the entries of the matrix resized to a (const) n*m vector column-wise.
 
at (index_t i) const
 Returns the i-th element of the vectorization of the matrix.
 
T & at (index_t i)
 Returns the i-th element of the vectorization of the matrix.
 
void blockTransposeInPlace (const index_t colBlock)
 Transposes in place the matrix block-wise. The matrix is.
 
BlockView blockView (const gsVector< index_t > &rowSizes, const gsVector< index_t > &colSizes)
 Return a block view of the matrix with rowSizes and colSizes.
 
void cefInPlace ()
 Converts the matrix to a Column Echelon Form (CEF)
 
Col3DType col3d (index_t c)
 Returns column c as a fixed-size 3D vector.
 
void colMinor (index_t j, ColMinorMatrixType &result) const
 
void firstMinor (index_t i, index_t j, FirstMinorMatrixType &result) const
 
template<typename OtherDerived >
 gsMatrix (const gsEigen::EigenBase< OtherDerived > &other)
 This constructor allows constructing a gsMatrix from Eigen expressions.
 
template<typename OtherDerived >
 gsMatrix (const gsEigen::MatrixBase< OtherDerived > &other)
 This constructor allows constructing a gsMatrix from Eigen expressions.
 
template<typename OtherDerived >
 gsMatrix (const gsEigen::ReturnByValue< OtherDerived > &other)
 This constructor allows constructing a gsMatrix from Eigen expressions.
 
template<typename OtherDerived >
gsMatrix khatriRao (const gsEigen::MatrixBase< OtherDerived > &other) const
 Returns the Khatri-Rao product of this with other.
 
template<typename OtherDerived >
gsMatrix kron (const gsEigen::MatrixBase< OtherDerived > &other) const
 Returns the Kronecker product of this with other.
 
void lexSortRows (const std::vector< index_t > &lorder)
 Sorts rows of matrix by columns in vector lorder.
 
uPtr moveToPtr ()
 This function returns a smart pointer to the matrix. After calling it, the matrix object becomes empty, ie the size of the matrix is 0.
 
void rcefInPlace ()
 Converts the matrix to its Reduced Column Echelon Form (RCEF)
 
void refInPlace ()
 Converts the matrix to a Row Echelon Form (REF)
 
void removeCol (index_t i)
 
gsAsMatrix< T, Dynamic, Dynamic > reshape (index_t n, index_t m)
 Returns the matrix resized to n x m matrix (data is not copied) This function assumes that the matrix is size n*m, ie. already allocated.
 
gsAsConstMatrix< T, Dynamic,
Dynamic > 
reshape (index_t n, index_t m) const
 Returns the matrix resized to n x m matrix (data is not copied) This function assumes that the matrix is size n*m, ie. already allocated.
 
gsAsMatrix< T, Dynamic, Dynamic > reshapeCol (index_t c, index_t n, index_t m)
 Returns column c of the matrix resized to n x m matrix This function assumes that the matrix is size n*m, ie. already allocated.
 
gsAsConstMatrix< T, Dynamic,
Dynamic > 
reshapeCol (index_t c, index_t n, index_t m) const
 Returns column c of the matrix resized to n x m matrix This function assumes that the matrix is size n*m, ie. already allocated.
 
void rowMinor (index_t i, RowMinorMatrixType &result) const
 
void rrefInPlace ()
 Converts the matrix to its Reduced Row Echelon Form (RREF)
 
void sortByColumn (const index_t j)
 Sorts rows of matrix by column j.
 
template<class container >
void submatrix (const container &rowInd, const container &colInd, gsMatrix< T > &result) const
 
template<class container >
void submatrixCols (const container &colInd, gsMatrix< T > &result) const
 
template<class container >
void submatrixRows (const container &rowInd, gsMatrix< T > &result) const
 

Member Function Documentation

gsAsMatrix<T, 1, Dynamic> asRowVector ( )
inline

Returns the entries of the matrix resized to a 1 x n*m row-vector column-wise

gsAsConstMatrix<T, 1, Dynamic> asRowVector ( ) const
inline

Returns the entries of the matrix resized to a (const) 1 x n*m row-vector column-wise

void colMinor ( index_t  j,
ColMinorMatrixType result 
) const
inline

Returns the jth column minor, i.e. the matrix after removing column j from the matrix. After the operation the column size of the matrix is one less.

void firstMinor ( index_t  i,
index_t  j,
FirstMinorMatrixType result 
) const
inline

Returns the (i,j)-minor, i.e. the matrix after removing row i and column j from the matrix. After the operation the row and column size of the matrix is one less.

void removeCol ( index_t  i)
inline

Removes column i from the matrix. After the operation the column size of the matrix is one less.

void rowMinor ( index_t  i,
RowMinorMatrixType result 
) const
inline

Returns the ith row minor, i.e. the matrix after removing row i from the matrix. After the operation the row size of the matrix is one less.

void submatrix ( const container &  rowInd,
const container &  colInd,
gsMatrix< T > &  result 
) const
inline

Returns a submatrix consisting of the rows and columns indexed by the vector containers rowInd and colInd respectively

void submatrixCols ( const container &  colInd,
gsMatrix< T > &  result 
) const
inline

Returns a submatrix consisting of the columns indexed by the vector container colInd

void submatrixRows ( const container &  rowInd,
gsMatrix< T > &  result 
) const
inline

Returns a submatrix consisting of the rows indexed by the vector container rowInd