G+Smo  23.12.0
Geometry + Simulation Modules
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
gsMatrixBlockView< MatrixType, isConst > Class Template Reference

Detailed Description

template<typename MatrixType, bool isConst = false>
class gismo::gsMatrixBlockView< MatrixType, isConst >

Represents a block-view of the given matrix.

The blocks are references to the matrix segments. Each block can be seen a a standalone matrix.

Template Parameters
Tcoefficient type

Public Member Functions

template<typename OtherDerived >
void assign (index_t i, index_t j, const gsEigen::EigenBase< OtherDerived > &other)
 Overwrites the contents of block (i,j) with matrix other.
 
 gsMatrixBlockView (MatrixType &matrix, const Vector_t &rowSizes, const Vector_t &colSizes)
 Creates a block-view of the given matrix. More...
 
 gsMatrixBlockView (MatrixType &matrix, const Vector_t &rowSizes)
 Creates a block-view of the given matrix, using only one column piece. More...
 
 gsMatrixBlockView (const MatrixType &matrix)
 Combatibility constuctor giving the matrix as a block.
 
 gsMatrixBlockView (const gsMatrixBlockView &other)
 Copy constructor.
 
size_t numBlocks () const
 Returns the number of blocks.
 
size_t numColBlocks () const
 Returns the number of col-blocks.
 
size_t numRowBlocks () const
 Returns the number of row-blocks.
 
block_t & operator() (index_t i, index_t j=0) const
 Returns the block indexed i (row) and j (column)
 

Friends

std::ostream & operator<< (std::ostream &os, const gsMatrixBlockView &mv)
 Prints the block structure.
 

Constructor & Destructor Documentation

gsMatrixBlockView ( MatrixType &  matrix,
const Vector_t &  rowSizes,
const Vector_t &  colSizes 
)
inline

Creates a block-view of the given matrix.

The blocks are references to the matrix segments. Each block can be seen a a standalone matrix.

Parameters
[in]matrixthe matrix to be "partitioned" into blocks
[in]rowSizesthe sizes of the row blocks, must sum up to matrix.rows()
[in]colSizesthe sizes of the column blocks, must sum up to matrix.cols()
gsMatrixBlockView ( MatrixType &  matrix,
const Vector_t &  rowSizes 
)
inline

Creates a block-view of the given matrix, using only one column piece.

This constructor is suitable for vectors, The blocks are references to the matrix segments. Each block can be seen a a standalone matrix.

Parameters
[in]matrixthe matrix to be "partitioned" into blocks
[in]rowSizesthe sizes of the row blocks, must sum up to matrix.rows()