Eigen  5.0.1
 
Loading...
Searching...
No Matches
Eigen::BlockSparseMatrix< Scalar_, Options_, BlockRows_, BlockCols_, StorageIndex_ > Class Template Reference

#include <Eigen/src/SparseCore/BlockSparseMatrix.h>

Detailed Description

template<typename Scalar_, int Options_, int BlockRows_, int BlockCols_, typename StorageIndex_ = int>
class Eigen::BlockSparseMatrix< Scalar_, Options_, BlockRows_, BlockCols_, StorageIndex_ >

A sparse matrix whose stored nonzeros are fixed-size dense blocks.

Each nonzero entry is a BlockRows x BlockCols dense matrix. The block sparsity pattern is stored in block-level compressed-column (ColMajor) or compressed-row (RowMajor) format.

Template Parameters
Scalar_Numeric scalar type.
Options_ColMajor (0) or RowMajor. Controls both the outer iteration direction over blocks and the storage layout within each block. Note: vector-shaped blocks must use a compatible order — BlockCols_=1 requires ColMajor, BlockRows_=1 requires RowMajor.
BlockRows_Rows per block; must be a fixed positive integer.
BlockCols_Columns per block; must be a fixed positive integer.
StorageIndex_Signed integer type for internal index arrays (default: int).

Assembly

Populate the matrix via setFromTriplets(), passing an iterator range of BlockTriplet objects in block coordinates. Triplets with the same (blockRow, blockCol) are summed.

Arithmetic

Addition, subtraction, and matrix product are supported between compatible BlockSparseMatrix instances. Scalar multiplication is also available.

The matrix product C = A * B requires A.BlockCols == B.BlockRows (enforced at compile time by the template constraint) and A.blockCols() == B.blockRows() (checked at runtime). The result has block type Matrix<Scalar,A.BlockRows,B.BlockCols>.

Conversion

toSparse() converts to a standard SparseMatrix with element-level sparsity. fromSparse() reconstructs a BlockSparseMatrix from an element-level SparseMatrix whose dimensions are divisible by BlockRows and BlockCols. An implicit conversion operator to SparseMatrix is also provided.

+ Inheritance diagram for Eigen::BlockSparseMatrix< Scalar_, Options_, BlockRows_, BlockCols_, StorageIndex_ >:

Classes

class  InnerIterator
 Iterates over stored blocks in outer vector outer. More...
 

Public Member Functions

BlockSparseMatrix< Scalar_, Options_, BlockCols_, BlockRows_, StorageIndex_ > adjoint () const
 
Index allocatedBlocks () const
 
Index blockCols () const
 
Index blockInnerSize () const
 
Index blockOuterSize () const
 
BlockMap blockRef (Index k)
 
ConstBlockMap blockRef (Index k) const
 
Index blockRows () const
 
 BlockSparseMatrix ()=default
 
 BlockSparseMatrix (Index blockRows, Index blockCols)
 
Scalar coeff (Index row, Index col) const
 
Index cols () const noexcept
 
template<typename ScalarFunc>
BlockSparseMatrix conjunctionExpr (const BlockSparseMatrix &other, ScalarFunc func) const
 
BlockSparseMatrix cwiseProduct (const BlockSparseMatrix &other) const
 
Matrix< Scalar, Dynamic, 1 > diagonal () const
 
template<typename ScalarFunc>
BlockSparseMatrix disjunctionExpr (const BlockSparseMatrix &other, ScalarFunc func) const
 
Index innerSize () const
 
Index nonZeroBlocks () const
 
Index nonZeros () const
 
 operator SparseMatrix< Scalar_, Options_, StorageIndex_ > () const
 
template<int RhsBlockCols>
BlockSparseMatrix< Scalar_, Options_, BlockRows_, RhsBlockCols, StorageIndex_ > operator* (const BlockSparseMatrix< Scalar_, Options_, BlockCols_, RhsBlockCols, StorageIndex_ > &rhs) const
 
template<typename OtherDerived>
Product< BlockSparseMatrix, OtherDerived, AliasFreeProduct > operator* (const MatrixBase< OtherDerived > &rhs) const
 
BlockSparseMatrix operator* (const Scalar &s) const
 
BlockSparseMatrix operator+ (const BlockSparseMatrix &other) const
 
BlockSparseMatrix operator- () const
 
BlockSparseMatrix operator- (const BlockSparseMatrix &other) const
 
Index outerSize () const
 
void reserve (Index n)
 
void resize (Index blockRows, Index blockCols)
 
Index rows () const noexcept
 
template<int UpLo, bool DiagIsSelfAdjoint = false>
BlockSparseSelfAdjointView< BlockSparseMatrix, UpLo, DiagIsSelfAdjoint > selfadjointView () const
 
void setFromOuterInner (Index blockRows, Index blockCols, Index nnzBlocks, const StorageIndex_ *outerPtr, const StorageIndex_ *innerPtr)
 
template<typename InputIterator>
void setFromTriplets (InputIterator begin, InputIterator end)
 
void setIdentity ()
 
void setZero ()
 
void squeeze ()
 
SparseMatrix< Scalar, Options_, StorageIndex_ > toSparse () const
 
BlockSparseMatrix< Scalar_, Options_, BlockCols_, BlockRows_, StorageIndex_ > transpose () const
 
template<int Mode, bool DiagIsTriangular = false>
BlockSparseTriangularView< BlockSparseMatrix, Mode, DiagIsTriangular > triangularView () const
 
template<typename ScalarFunc>
BlockSparseMatrix unaryExpr (ScalarFunc func) const
 
- Public Member Functions inherited from Eigen::EigenBase< BlockSparseMatrix< Scalar_, Options_, BlockRows_, BlockCols_, int > >
constexpr Index cols () const noexcept
 
constexpr BlockSparseMatrix< Scalar_, Options_, BlockRows_, BlockCols_, int > & derived ()
 
constexpr const BlockSparseMatrix< Scalar_, Options_, BlockRows_, BlockCols_, int > & derived () const
 
constexpr Index rows () const noexcept
 
constexpr Index size () const noexcept
 

Static Public Member Functions

static BlockSparseMatrix fromSparse (const SparseMatrix< Scalar_, Options_, StorageIndex_ > &sp)
 

Additional Inherited Members

- Public Types inherited from Eigen::EigenBase< BlockSparseMatrix< Scalar_, Options_, BlockRows_, BlockCols_, int > >
using Index
 The interface type of indices.
 

Constructor & Destructor Documentation

◆ BlockSparseMatrix() [1/2]

template<typename Scalar_, int Options_, int BlockRows_, int BlockCols_, typename StorageIndex_ = int>
Eigen::BlockSparseMatrix< Scalar_, Options_, BlockRows_, BlockCols_, StorageIndex_ >::BlockSparseMatrix ( )
default

Default constructor; creates a 0×0 matrix.

◆ BlockSparseMatrix() [2/2]

template<typename Scalar_, int Options_, int BlockRows_, int BlockCols_, typename StorageIndex_ = int>
Eigen::BlockSparseMatrix< Scalar_, Options_, BlockRows_, BlockCols_, StorageIndex_ >::BlockSparseMatrix ( Index blockRows,
Index blockCols )
inline

Construct a zero matrix with the given number of block-rows and block-columns.

Member Function Documentation

◆ adjoint()

template<typename Scalar_, int Options_, int BlockRows_, int BlockCols_, typename StorageIndex_>
BlockSparseMatrix< Scalar_, Options_, BlockCols_, BlockRows_, StorageIndex_ > Eigen::BlockSparseMatrix< Scalar_, Options_, BlockRows_, BlockCols_, StorageIndex_ >::adjoint ( ) const

Returns a new BSM whose block dimensions are swapped and each stored block is conjugate-transposed (adjoint). Identical to transpose() for real scalars.

◆ allocatedBlocks()

template<typename Scalar_, int Options_, int BlockRows_, int BlockCols_, typename StorageIndex_ = int>
Index Eigen::BlockSparseMatrix< Scalar_, Options_, BlockRows_, BlockCols_, StorageIndex_ >::allocatedBlocks ( ) const
inline

Number of blocks for which storage is currently allocated (capacity).

◆ blockCols()

template<typename Scalar_, int Options_, int BlockRows_, int BlockCols_, typename StorageIndex_ = int>
Index Eigen::BlockSparseMatrix< Scalar_, Options_, BlockRows_, BlockCols_, StorageIndex_ >::blockCols ( ) const
inline

Number of block-columns.

◆ blockInnerSize()

template<typename Scalar_, int Options_, int BlockRows_, int BlockCols_, typename StorageIndex_ = int>
Index Eigen::BlockSparseMatrix< Scalar_, Options_, BlockRows_, BlockCols_, StorageIndex_ >::blockInnerSize ( ) const
inline

Inner block dimension (block-rows for ColMajor, block-cols for RowMajor).

◆ blockOuterSize()

template<typename Scalar_, int Options_, int BlockRows_, int BlockCols_, typename StorageIndex_ = int>
Index Eigen::BlockSparseMatrix< Scalar_, Options_, BlockRows_, BlockCols_, StorageIndex_ >::blockOuterSize ( ) const
inline

Outer block dimension (block-cols for ColMajor, block-rows for RowMajor).

◆ blockRef() [1/2]

template<typename Scalar_, int Options_, int BlockRows_, int BlockCols_, typename StorageIndex_ = int>
BlockMap Eigen::BlockSparseMatrix< Scalar_, Options_, BlockRows_, BlockCols_, StorageIndex_ >::blockRef ( Index k)
inline

Mutable Map to the k-th stored block.

◆ blockRef() [2/2]

template<typename Scalar_, int Options_, int BlockRows_, int BlockCols_, typename StorageIndex_ = int>
ConstBlockMap Eigen::BlockSparseMatrix< Scalar_, Options_, BlockRows_, BlockCols_, StorageIndex_ >::blockRef ( Index k) const
inline

Read-only Map to the k-th stored block (block storage follows Options_).

◆ blockRows()

template<typename Scalar_, int Options_, int BlockRows_, int BlockCols_, typename StorageIndex_ = int>
Index Eigen::BlockSparseMatrix< Scalar_, Options_, BlockRows_, BlockCols_, StorageIndex_ >::blockRows ( ) const
inline

Number of block-rows.

◆ coeff()

template<typename Scalar_, int Options_, int BlockRows_, int BlockCols_, typename StorageIndex_ = int>
Scalar Eigen::BlockSparseMatrix< Scalar_, Options_, BlockRows_, BlockCols_, StorageIndex_ >::coeff ( Index row,
Index col ) const
inline

Read element (row, col); returns 0 if no block covers that position.

◆ cols()

template<typename Scalar_, int Options_, int BlockRows_, int BlockCols_, typename StorageIndex_ = int>
Index Eigen::BlockSparseMatrix< Scalar_, Options_, BlockRows_, BlockCols_, StorageIndex_ >::cols ( ) const
inlinenoexcept

Total number of element columns.

◆ conjunctionExpr()

template<typename Scalar_, int Options_, int BlockRows_, int BlockCols_, typename StorageIndex_ = int>
template<typename ScalarFunc>
BlockSparseMatrix Eigen::BlockSparseMatrix< Scalar_, Options_, BlockRows_, BlockCols_, StorageIndex_ >::conjunctionExpr ( const BlockSparseMatrix< Scalar_, Options_, BlockRows_, BlockCols_, StorageIndex_ > & other,
ScalarFunc func ) const
inline

Applies a scalar binary functor with intersection sparsity: only block positions present in both matrices contribute; func is called as func(Scalar a, Scalar b).

◆ cwiseProduct()

template<typename Scalar_, int Options_, int BlockRows_, int BlockCols_, typename StorageIndex_ = int>
BlockSparseMatrix Eigen::BlockSparseMatrix< Scalar_, Options_, BlockRows_, BlockCols_, StorageIndex_ >::cwiseProduct ( const BlockSparseMatrix< Scalar_, Options_, BlockRows_, BlockCols_, StorageIndex_ > & other) const
inline

Element-wise product. Only blocks present in both operands contribute to the result.

◆ diagonal()

template<typename Scalar_, int Options_, int BlockRows_, int BlockCols_, typename StorageIndex_ = int>
Matrix< Scalar, Dynamic, 1 > Eigen::BlockSparseMatrix< Scalar_, Options_, BlockRows_, BlockCols_, StorageIndex_ >::diagonal ( ) const
inline

Extract the main scalar diagonal as a dense vector.

Iterates outer slices once and binary-searches for the diagonal block in each slice, then copies the relevant entries from that block — one search per outer slice (square blocks) or per unique inner-block boundary (non-square blocks), vs. one search per scalar element for the coeff-by-coeff approach.

◆ disjunctionExpr()

template<typename Scalar_, int Options_, int BlockRows_, int BlockCols_, typename StorageIndex_ = int>
template<typename ScalarFunc>
BlockSparseMatrix Eigen::BlockSparseMatrix< Scalar_, Options_, BlockRows_, BlockCols_, StorageIndex_ >::disjunctionExpr ( const BlockSparseMatrix< Scalar_, Options_, BlockRows_, BlockCols_, StorageIndex_ > & other,
ScalarFunc func ) const
inline

Applies a scalar binary functor with union sparsity.

func must provide three members:

Scalar func(Scalar a, Scalar b) // both present
Scalar func.lhs(Scalar a) // only lhs present; rhs is implicitly zero
Scalar func.rhs(Scalar b) // only rhs present; lhs is implicitly zero

◆ fromSparse()

template<typename Scalar_, int Options_, int BlockRows_, int BlockCols_, typename StorageIndex_>
BlockSparseMatrix< Scalar_, Options_, BlockRows_, BlockCols_, StorageIndex_ > Eigen::BlockSparseMatrix< Scalar_, Options_, BlockRows_, BlockCols_, StorageIndex_ >::fromSparse ( const SparseMatrix< Scalar_, Options_, StorageIndex_ > & sp)
static

Construct a BlockSparseMatrix from an element-level SparseMatrix.

Precondition
sp.rows() % BlockRows == 0 and sp.cols() % BlockCols == 0.

Each scalar entry sp(i,j) is placed into position (iBlockRows, jBlockCols) of block (i/BlockRows, j/BlockCols). Multiple entries mapping to the same element of the same block are accumulated with +=.

◆ innerSize()

template<typename Scalar_, int Options_, int BlockRows_, int BlockCols_, typename StorageIndex_ = int>
Index Eigen::BlockSparseMatrix< Scalar_, Options_, BlockRows_, BlockCols_, StorageIndex_ >::innerSize ( ) const
inline

Element-level inner size: rows() for ColMajor, cols() for RowMajor.

◆ nonZeroBlocks()

template<typename Scalar_, int Options_, int BlockRows_, int BlockCols_, typename StorageIndex_ = int>
Index Eigen::BlockSparseMatrix< Scalar_, Options_, BlockRows_, BlockCols_, StorageIndex_ >::nonZeroBlocks ( ) const
inline

Number of stored (structurally non-zero) blocks.

◆ nonZeros()

template<typename Scalar_, int Options_, int BlockRows_, int BlockCols_, typename StorageIndex_ = int>
Index Eigen::BlockSparseMatrix< Scalar_, Options_, BlockRows_, BlockCols_, StorageIndex_ >::nonZeros ( ) const
inline

Total number of stored scalar coefficients (= nonZeroBlocks() * BlockRows * BlockCols).

◆ operator SparseMatrix< Scalar_, Options_, StorageIndex_ >()

template<typename Scalar_, int Options_, int BlockRows_, int BlockCols_, typename StorageIndex_ = int>
Eigen::BlockSparseMatrix< Scalar_, Options_, BlockRows_, BlockCols_, StorageIndex_ >::operator SparseMatrix< Scalar_, Options_, StorageIndex_ > ( ) const
inline

Implicit conversion to SparseMatrix.

◆ operator*() [1/3]

template<typename Scalar_, int Options_, int BlockRows_, int BlockCols_, typename StorageIndex_>
template<int RhsBlockCols>
BlockSparseMatrix< Scalar_, Options_, BlockRows_, RhsBlockCols, StorageIndex_ > Eigen::BlockSparseMatrix< Scalar_, Options_, BlockRows_, BlockCols_, StorageIndex_ >::operator* ( const BlockSparseMatrix< Scalar_, Options_, BlockCols_, RhsBlockCols, StorageIndex_ > & rhs) const

Block-sparse matrix product.

Template Parameters
RhsBlockColsBlock-column count of the right-hand side.

The left-hand side has block type Matrix<Scalar,BlockRows,BlockCols> and the right-hand side must have block type Matrix<Scalar,BlockCols,RhsBlockCols> (enforced by the template parameter). The result has block type Matrix<Scalar,BlockRows,RhsBlockCols>.

Precondition
this->blockCols() == rhs.blockRows() (checked at runtime).

◆ operator*() [2/3]

template<typename Scalar_, int Options_, int BlockRows_, int BlockCols_, typename StorageIndex_ = int>
template<typename OtherDerived>
Product< BlockSparseMatrix, OtherDerived, AliasFreeProduct > Eigen::BlockSparseMatrix< Scalar_, Options_, BlockRows_, BlockCols_, StorageIndex_ >::operator* ( const MatrixBase< OtherDerived > & rhs) const
inline

Block-sparse times dense matrix (or vector) product.

Returns a lazy Product<> expression evaluated via generic_product_impl. This enables fused accumulation:

b.noalias() = A * x; // no temporary
b.noalias() += A * x; // fused add
b.noalias() += alpha * (A * x); // scale then add via evaluator
Precondition
this->cols() == rhs.rows().
Scalar types must match.
Warning
The result uses AliasFreeProduct, so assignment goes directly through generic_product_impl::evalTo with no aliasing temporary. x = A * x silently corrupts; use an explicit temporary if needed.

◆ operator*() [3/3]

template<typename Scalar_, int Options_, int BlockRows_, int BlockCols_, typename StorageIndex_ = int>
BlockSparseMatrix Eigen::BlockSparseMatrix< Scalar_, Options_, BlockRows_, BlockCols_, StorageIndex_ >::operator* ( const Scalar & s) const
inline

Scalar multiplication (returns a new matrix).

◆ operator+()

template<typename Scalar_, int Options_, int BlockRows_, int BlockCols_, typename StorageIndex_ = int>
BlockSparseMatrix Eigen::BlockSparseMatrix< Scalar_, Options_, BlockRows_, BlockCols_, StorageIndex_ >::operator+ ( const BlockSparseMatrix< Scalar_, Options_, BlockRows_, BlockCols_, StorageIndex_ > & other) const
inline

Element-wise addition. Both matrices must have the same block dimensions.

◆ operator-() [1/2]

template<typename Scalar_, int Options_, int BlockRows_, int BlockCols_, typename StorageIndex_ = int>
BlockSparseMatrix Eigen::BlockSparseMatrix< Scalar_, Options_, BlockRows_, BlockCols_, StorageIndex_ >::operator- ( ) const
inline

Unary negation.

◆ operator-() [2/2]

template<typename Scalar_, int Options_, int BlockRows_, int BlockCols_, typename StorageIndex_ = int>
BlockSparseMatrix Eigen::BlockSparseMatrix< Scalar_, Options_, BlockRows_, BlockCols_, StorageIndex_ >::operator- ( const BlockSparseMatrix< Scalar_, Options_, BlockRows_, BlockCols_, StorageIndex_ > & other) const
inline

Element-wise subtraction.

◆ outerSize()

template<typename Scalar_, int Options_, int BlockRows_, int BlockCols_, typename StorageIndex_ = int>
Index Eigen::BlockSparseMatrix< Scalar_, Options_, BlockRows_, BlockCols_, StorageIndex_ >::outerSize ( ) const
inline

Element-level outer size: cols() for ColMajor, rows() for RowMajor.

◆ reserve()

template<typename Scalar_, int Options_, int BlockRows_, int BlockCols_, typename StorageIndex_ = int>
void Eigen::BlockSparseMatrix< Scalar_, Options_, BlockRows_, BlockCols_, StorageIndex_ >::reserve ( Index n)
inline

Pre-allocate storage for at least n blocks without changing the logical sparsity pattern. Existing block data is preserved up to min(n, nonZeroBlocks()).

◆ resize()

template<typename Scalar_, int Options_, int BlockRows_, int BlockCols_, typename StorageIndex_ = int>
void Eigen::BlockSparseMatrix< Scalar_, Options_, BlockRows_, BlockCols_, StorageIndex_ >::resize ( Index blockRows,
Index blockCols )
inline

Resize to blockRows × blockCols blocks and set the logical nnz to zero. Allocated block storage is retained; call squeeze() to release it.

◆ rows()

template<typename Scalar_, int Options_, int BlockRows_, int BlockCols_, typename StorageIndex_ = int>
Index Eigen::BlockSparseMatrix< Scalar_, Options_, BlockRows_, BlockCols_, StorageIndex_ >::rows ( ) const
inlinenoexcept

Total number of element rows.

◆ selfadjointView()

template<typename Scalar_, int Options_, int BlockRows_, int BlockCols_, typename StorageIndex_ = int>
template<int UpLo, bool DiagIsSelfAdjoint = false>
BlockSparseSelfAdjointView< BlockSparseMatrix, UpLo, DiagIsSelfAdjoint > Eigen::BlockSparseMatrix< Scalar_, Options_, BlockRows_, BlockCols_, StorageIndex_ >::selfadjointView ( ) const
inline

Returns a block-level self-adjoint view.

Only the triangle selected by UpLo is read; the opposite triangle is reconstructed on-the-fly as the adjoint of each stored off-diagonal block.

Template Parameters
UpLoEigen::Upper or Eigen::Lower.
DiagIsSelfAdjointSet to true when every diagonal block is itself Hermitian and both triangles are explicitly stored. The dense sub-product then uses a plain product rather than selfadjointView, which is more efficient for the small fixed-size blocks typical here. When false (the default), only the UpLo triangle of each diagonal block is assumed valid; selfadjointView<UpLo>() reconstructs the full block.
Precondition
BlockRows == BlockCols (diagonal blocks must be square).

◆ setFromOuterInner()

template<typename Scalar_, int Options_, int BlockRows_, int BlockCols_, typename StorageIndex_ = int>
void Eigen::BlockSparseMatrix< Scalar_, Options_, BlockRows_, BlockCols_, StorageIndex_ >::setFromOuterInner ( Index blockRows,
Index blockCols,
Index nnzBlocks,
const StorageIndex_ * outerPtr,
const StorageIndex_ * innerPtr )
inline

Initialize the block structure directly from compressed outer/inner index arrays, zero-initializing all block values.

outerPtr has size blockCols+1 (ColMajor) or blockRows+1 (RowMajor). innerPtr has size nnzBlocks.

◆ setFromTriplets()

template<typename Scalar_, int Options_, int BlockRows_, int BlockCols_, typename StorageIndex_>
template<typename InputIterator>
void Eigen::BlockSparseMatrix< Scalar_, Options_, BlockRows_, BlockCols_, StorageIndex_ >::setFromTriplets ( InputIterator begin,
InputIterator end )

Fill the matrix from an iterator range of BlockTriplet objects.

Triplet coordinates are in block space. Triplets with the same (blockRow, blockCol) pair are summed (their block values are added). The input range may be in any order.

Template Parameters
InputIteratorMust dereference to a type with row(), col(), and value() members, matching BlockTriplet's interface.

◆ setIdentity()

template<typename Scalar_, int Options_, int BlockRows_, int BlockCols_, typename StorageIndex_ = int>
void Eigen::BlockSparseMatrix< Scalar_, Options_, BlockRows_, BlockCols_, StorageIndex_ >::setIdentity ( )
inline

Fill the matrix with the block identity: the min(blockRows,blockCols) diagonal blocks are set to the B×B identity; all other blocks are absent.

Precondition
BlockRows == BlockCols (square blocks).

◆ setZero()

template<typename Scalar_, int Options_, int BlockRows_, int BlockCols_, typename StorageIndex_ = int>
void Eigen::BlockSparseMatrix< Scalar_, Options_, BlockRows_, BlockCols_, StorageIndex_ >::setZero ( )
inline

Clear all stored blocks (logical nnz → 0) while keeping dimensions and allocated storage.

◆ squeeze()

template<typename Scalar_, int Options_, int BlockRows_, int BlockCols_, typename StorageIndex_ = int>
void Eigen::BlockSparseMatrix< Scalar_, Options_, BlockRows_, BlockCols_, StorageIndex_ >::squeeze ( )
inline

Release any excess allocated block storage so that allocatedBlocks() == nonZeroBlocks().

◆ toSparse()

template<typename Scalar_, int Options_, int BlockRows_, int BlockCols_, typename StorageIndex_>
SparseMatrix< Scalar_, Options_, StorageIndex_ > Eigen::BlockSparseMatrix< Scalar_, Options_, BlockRows_, BlockCols_, StorageIndex_ >::toSparse ( ) const

Convert to a SparseMatrix with scalar nonzeros.

Each stored block of size BlockRows×BlockCols expands into up to BlockRows*BlockCols scalar nonzeros. The resulting SparseMatrix has the same storage order as *this.

◆ transpose()

template<typename Scalar_, int Options_, int BlockRows_, int BlockCols_, typename StorageIndex_>
BlockSparseMatrix< Scalar_, Options_, BlockCols_, BlockRows_, StorageIndex_ > Eigen::BlockSparseMatrix< Scalar_, Options_, BlockRows_, BlockCols_, StorageIndex_ >::transpose ( ) const

Returns a new BSM whose block dimensions are swapped (BlockRows ↔ BlockCols) and each stored block is transposed. Storage order is preserved.

◆ triangularView()

template<typename Scalar_, int Options_, int BlockRows_, int BlockCols_, typename StorageIndex_ = int>
template<int Mode, bool DiagIsTriangular = false>
BlockSparseTriangularView< BlockSparseMatrix, Mode, DiagIsTriangular > Eigen::BlockSparseMatrix< Scalar_, Options_, BlockRows_, BlockCols_, StorageIndex_ >::triangularView ( ) const
inline

Returns a block-level triangular view.

Template Parameters
ModeEigen::Upper or Eigen::Lower.
DiagIsTriangularWhen false (default), diagonal blocks are treated as triangular regardless of what is stored in the unused triangle — products use triangularView on the block and eval() explicitly zeros the unused triangle. When true, the caller guarantees that the unused triangle of every diagonal block is already zero; products then use a full vectorised GEMV (faster, no zeroing).

◆ unaryExpr()

template<typename Scalar_, int Options_, int BlockRows_, int BlockCols_, typename StorageIndex_ = int>
template<typename ScalarFunc>
BlockSparseMatrix Eigen::BlockSparseMatrix< Scalar_, Options_, BlockRows_, BlockCols_, StorageIndex_ >::unaryExpr ( ScalarFunc func) const
inline

Applies a scalar unary functor to every stored nonzero, preserving the sparsity pattern.


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