A versatile sparse matrix representation where each element is a block. More...
Public Types | |
enum | { Options , Flags , BlockSize , RowsAtCompileTime , ColsAtCompileTime , MaxRowsAtCompileTime , MaxColsAtCompileTime , IsVectorAtCompileTime , IsColMajor } |
typedef Matrix< RealScalar, _BlockAtCompileTime, _BlockAtCompileTime, IsColMajor ? ColMajor :RowMajor > | BlockRealScalar |
typedef Matrix< Scalar, _BlockAtCompileTime, _BlockAtCompileTime, IsColMajor ? ColMajor :RowMajor > | BlockScalar |
typedef std::conditional_t< _BlockAtCompileTime==Dynamic, Scalar, BlockScalar > | BlockScalarReturnType |
typedef internal::ref_selector< BlockSparseMatrix< Scalar_, _BlockAtCompileTime, Options_, StorageIndex_ > >::type | Nested |
typedef BlockSparseMatrix< Scalar, BlockSize, IsColMajor ? ColMajor :RowMajor, StorageIndex > | PlainObject |
typedef NumTraits< Scalar >::Real | RealScalar |
typedef Scalar_ | Scalar |
typedef StorageIndex_ | StorageIndex |
![]() | |
typedef std::conditional_t< NumTraits< Scalar >::IsComplex, CwiseUnaryOp< internal::scalar_conjugate_op< Scalar >, Eigen::Transpose< const Derived > >, Transpose< const Derived > > | AdjointReturnType |
typedef Transpose< const Derived > | ConstTransposeReturnType |
typedef Matrix< StorageIndex, Dynamic, 1 > | IndexVector |
typedef internal::add_const_on_value_type_if_arithmetic< typename internal::packet_traits< Scalar >::type >::type | PacketReturnType |
typedef internal::packet_traits< Scalar >::type | PacketScalar |
typedef SparseMatrix< Scalar, Flags &RowMajorBit ? RowMajor :ColMajor, StorageIndex > | PlainObject |
typedef internal::traits< Derived >::Scalar | Scalar |
typedef Matrix< Scalar, Dynamic, 1 > | ScalarVector |
typedef SparseMatrixBase | StorageBaseType |
typedef internal::traits< Derived >::StorageIndex | StorageIndex |
typedef internal::traits< Derived >::StorageKind | StorageKind |
typedef Transpose< Derived > | TransposeReturnType |
typedef Scalar | value_type |
![]() | |
typedef Eigen::Index | Index |
typedef internal::traits< Derived >::StorageKind | StorageKind |
Public Member Functions | |
Index | blockCols () const |
Index | blockColsIndex (Index bj) const |
Index | blockInnerIndex (Index bi) const |
Index | blockInnerSize (Index bi) const |
Index | blockOuterIndex (Index bj) const |
Index | blockOuterSize (Index bj) const |
Index | blockPtr (Index id) const |
Index | blockRows () const |
Index | blockRowsIndex (Index bi) const |
BlockSparseMatrix () | |
BlockSparseMatrix (const BlockSparseMatrix &other) | |
Copy-constructor. More... | |
template<typename MatrixType > | |
BlockSparseMatrix (const MatrixType &spmat) | |
Constructor from a sparse matrix. More... | |
BlockSparseMatrix (Index brow, Index bcol) | |
Construct and resize. More... | |
Map< const BlockScalar > | coeff (Index brow, Index bcol) const |
Ref< BlockScalar > | coeffRef (Index brow, Index bcol) |
Index | cols () const |
Index | innerBlocks () const |
StorageIndex * | innerIndexPtr () |
const StorageIndex * | innerIndexPtr () const |
Index | innerSize () const |
Index | innerToBlock (Index inner) const |
bool | isCompressed () const |
for compatibility purposes with the SparseMatrix class More... | |
Index | nonZeros () const |
Index | nonZerosBlocks () const |
template<typename VecType > | |
BlockSparseTimeDenseProduct< BlockSparseMatrix, VecType > | operator* (const VecType &lhs) const |
BlockSparseMatrix & | operator= (BlockSparseMatrix other) |
template<typename MatrixType > | |
BlockSparseMatrix & | operator= (const MatrixType &spmat) |
Assignment from a sparse matrix with the same storage order. More... | |
Index | outerBlocks () const |
StorageIndex * | outerIndexPtr () |
const StorageIndex * | outerIndexPtr () const |
Index | outerSize () const |
Index | outerToBlock (Index outer) const |
void | reserve (const Index nonzerosblocks) |
Allocate the internal array of pointers to blocks and their inner indices. More... | |
void | resize (Index brow, Index bcol) |
Set the number of rows and columns blocks. More... | |
Index | rows () const |
void | setBlockLayout (const VectorXi &rowBlocks, const VectorXi &colBlocks) |
Set the row and column block layouts,. More... | |
void | setBlockSize (Index blockSize) |
set the block size at runtime for fixed-size block layout More... | |
template<typename MatrixType > | |
void | setBlockStructure (const MatrixType &blockPattern) |
Set the nonzero block pattern of the matrix. More... | |
template<typename InputIterator > | |
void | setFromTriplets (const InputIterator &begin, const InputIterator &end) |
Fill values in a matrix from a triplet list. More... | |
BlockScalarReturnType * | valuePtr () |
~BlockSparseMatrix () | |
![]() | |
const AdjointReturnType | adjoint () const |
RealScalar | blueNorm () const |
Index | cols () const |
const SparseMatrixBase< Derived >::template CwiseProductDenseReturnType< OtherDerived >::Type | cwiseProduct (const MatrixBase< OtherDerived > &other) const |
const CwiseProductDenseReturnType< OtherDerived >::Type | cwiseProduct (const MatrixBase< OtherDerived > &other) const |
internal::traits< Derived >::Scalar | dot (const MatrixBase< OtherDerived > &other) const |
Scalar | dot (const MatrixBase< OtherDerived > &other) const |
internal::traits< Derived >::Scalar | dot (const SparseMatrixBase< OtherDerived > &other) const |
Scalar | dot (const SparseMatrixBase< OtherDerived > &other) const |
const internal::eval< Derived >::type | eval () const |
Index | innerSize () const |
bool | isApprox (const MatrixBase< OtherDerived > &other, const RealScalar &prec=NumTraits< Scalar >::dummy_precision()) const |
bool | isApprox (const SparseMatrixBase< OtherDerived > &other, const RealScalar &prec=NumTraits< Scalar >::dummy_precision()) const |
bool | isRValue () const |
bool | isVector () const |
Derived & | markAsRValue () |
RealScalar | norm () const |
const Product< Derived, OtherDerived > | operator* (const DiagonalBase< OtherDerived > &other) const |
const Product< Derived, OtherDerived > | operator* (const MatrixBase< OtherDerived > &other) const |
const Product< Derived, OtherDerived, AliasFreeProduct > | operator* (const SparseMatrixBase< OtherDerived > &other) const |
Derived & | operator*= (const Scalar &other) |
Derived & | operator*= (const SparseMatrixBase< OtherDerived > &other) |
Derived & | operator+= (const DiagonalBase< OtherDerived > &other) |
Derived & | operator+= (const EigenBase< OtherDerived > &other) |
Derived & | operator+= (const SparseMatrixBase< OtherDerived > &other) |
Derived & | operator-= (const DiagonalBase< OtherDerived > &other) |
Derived & | operator-= (const EigenBase< OtherDerived > &other) |
Derived & | operator-= (const SparseMatrixBase< OtherDerived > &other) |
Derived & | operator/= (const Scalar &other) |
Derived & | operator= (const Derived &other) |
Derived & | operator= (const EigenBase< OtherDerived > &other) |
Derived & | operator= (const ReturnByValue< OtherDerived > &other) |
Derived & | operator= (const SparseMatrixBase< OtherDerived > &other) |
Index | outerSize () const |
const SparseView< Derived > | pruned (const Scalar &reference=Scalar(0), const RealScalar &epsilon=NumTraits< Scalar >::dummy_precision()) const |
Index | rows () const |
SelfAdjointViewReturnType< UpLo >::Type | selfadjointView () |
SparseMatrixBase< Derived >::template SelfAdjointViewReturnType< UpLo >::Type | selfadjointView () |
SparseMatrixBase< Derived >::template ConstSelfAdjointViewReturnType< UpLo >::Type | selfadjointView () const |
ConstSelfAdjointViewReturnType< UpLo >::Type | selfadjointView () const |
Index | size () const |
SparseMatrixBase () | |
RealScalar | squaredNorm () const |
Scalar | sum () const |
DenseMatrixType | toDense () const |
TransposeReturnType | transpose () |
const ConstTransposeReturnType | transpose () const |
const TriangularView< const Derived, Mode > | triangularView () const |
SparseSymmetricPermutationProduct< Derived, Upper|Lower > | twistedBy (const PermutationMatrix< Dynamic, Dynamic, StorageIndex > &perm) const |
![]() | |
void | addTo (Dest &dst) const |
void | applyThisOnTheLeft (Dest &dst) const |
void | applyThisOnTheRight (Dest &dst) const |
EIGEN_CONSTEXPR Index | cols () const EIGEN_NOEXCEPT |
Derived & | const_cast_derived () const |
const Derived & | const_derived () const |
Derived & | derived () |
const Derived & | derived () const |
void | evalTo (Dest &dst) const |
EIGEN_CONSTEXPR Index | rows () const EIGEN_NOEXCEPT |
EIGEN_CONSTEXPR Index | size () const EIGEN_NOEXCEPT |
void | subTo (Dest &dst) const |
Protected Member Functions | |
Map< BlockScalar > | insert (Index brow, Index bcol) |
![]() | |
Derived & | assign (const OtherDerived &other) |
void | assignGeneric (const OtherDerived &other) |
Protected Attributes | |
StorageIndex * | m_blockPtr |
Index | m_blockSize |
StorageIndex * | m_indices |
Index | m_innerBSize |
StorageIndex * | m_innerOffset |
Index | m_nonzeros |
Index | m_nonzerosblocks |
Index | m_outerBSize |
StorageIndex * | m_outerIndex |
StorageIndex * | m_outerOffset |
Scalar * | m_values |
![]() | |
bool | m_isRValue |
Additional Inherited Members | |
![]() | |
ColsAtCompileTime | |
Flags | |
InnerSizeAtCompileTime | |
IsRowMajor | |
IsVectorAtCompileTime | |
MaxColsAtCompileTime | |
MaxRowsAtCompileTime | |
MaxSizeAtCompileTime | |
NumDimensions | |
RowsAtCompileTime | |
SizeAtCompileTime | |
![]() | |
static StorageIndex | convert_index (const Index idx) |
A versatile sparse matrix representation where each element is a block.
This class provides routines to manipulate block sparse matrices stored in a BSR-like representation. There are two main types :
In any of the previous case, the matrix can be filled by calling setFromTriplets(). A regular sparse matrix can be converted to a block sparse matrix and vice versa. It is obviously required to describe the block layout beforehand by calling either setBlockSize() for fixed-size blocks or setBlockLayout for variable-size blocks.
Scalar_ | The Scalar type |
_BlockAtCompileTime | The block layout option. It takes the following values Dynamic : block size known at runtime a numeric number : fixed-size block known at compile time |
Definition at line 286 of file BlockSparseMatrix.h.
typedef Matrix<RealScalar, _BlockAtCompileTime, _BlockAtCompileTime,IsColMajor ? ColMajor : RowMajor> Eigen::BlockSparseMatrix< Scalar_, _BlockAtCompileTime, Options_, StorageIndex_ >::BlockRealScalar |
Definition at line 306 of file BlockSparseMatrix.h.
typedef Matrix<Scalar, _BlockAtCompileTime, _BlockAtCompileTime,IsColMajor ? ColMajor : RowMajor> Eigen::BlockSparseMatrix< Scalar_, _BlockAtCompileTime, Options_, StorageIndex_ >::BlockScalar |
Definition at line 305 of file BlockSparseMatrix.h.
typedef std::conditional_t<_BlockAtCompileTime==Dynamic, Scalar, BlockScalar> Eigen::BlockSparseMatrix< Scalar_, _BlockAtCompileTime, Options_, StorageIndex_ >::BlockScalarReturnType |
Definition at line 307 of file BlockSparseMatrix.h.
typedef internal::ref_selector<BlockSparseMatrix<Scalar_, _BlockAtCompileTime, Options_, StorageIndex_> >::type Eigen::BlockSparseMatrix< Scalar_, _BlockAtCompileTime, Options_, StorageIndex_ >::Nested |
Definition at line 292 of file BlockSparseMatrix.h.
typedef BlockSparseMatrix<Scalar, BlockSize, IsColMajor ? ColMajor : RowMajor, StorageIndex> Eigen::BlockSparseMatrix< Scalar_, _BlockAtCompileTime, Options_, StorageIndex_ >::PlainObject |
Definition at line 308 of file BlockSparseMatrix.h.
typedef NumTraits<Scalar>::Real Eigen::BlockSparseMatrix< Scalar_, _BlockAtCompileTime, Options_, StorageIndex_ >::RealScalar |
Definition at line 290 of file BlockSparseMatrix.h.
typedef Scalar_ Eigen::BlockSparseMatrix< Scalar_, _BlockAtCompileTime, Options_, StorageIndex_ >::Scalar |
Definition at line 289 of file BlockSparseMatrix.h.
typedef StorageIndex_ Eigen::BlockSparseMatrix< Scalar_, _BlockAtCompileTime, Options_, StorageIndex_ >::StorageIndex |
Definition at line 291 of file BlockSparseMatrix.h.
anonymous enum |
Enumerator | |
---|---|
Options | |
Flags | |
BlockSize | |
RowsAtCompileTime | |
ColsAtCompileTime | |
MaxRowsAtCompileTime | |
MaxColsAtCompileTime | |
IsVectorAtCompileTime | |
IsColMajor |
Definition at line 294 of file BlockSparseMatrix.h.
|
inline |
Definition at line 311 of file BlockSparseMatrix.h.
|
inline |
|
inline |
Copy-constructor.
Definition at line 333 of file BlockSparseMatrix.h.
|
inline |
Definition at line 375 of file BlockSparseMatrix.h.
|
inline |
Constructor from a sparse matrix.
Definition at line 391 of file BlockSparseMatrix.h.
|
inline |
Definition at line 772 of file BlockSparseMatrix.h.
|
inline |
Definition at line 886 of file BlockSparseMatrix.h.
|
inline |
Definition at line 895 of file BlockSparseMatrix.h.
|
inline |
Definition at line 901 of file BlockSparseMatrix.h.
|
inline |
Definition at line 891 of file BlockSparseMatrix.h.
|
inline |
Definition at line 905 of file BlockSparseMatrix.h.
|
inline |
id
in the array of values Definition at line 938 of file BlockSparseMatrix.h.
|
inline |
Definition at line 767 of file BlockSparseMatrix.h.
|
inline |
Definition at line 878 of file BlockSparseMatrix.h.
|
inline |
Definition at line 834 of file BlockSparseMatrix.h.
|
inline |
Definition at line 808 of file BlockSparseMatrix.h.
|
inline |
|
inline |
Definition at line 778 of file BlockSparseMatrix.h.
|
inline |
Definition at line 868 of file BlockSparseMatrix.h.
|
inline |
Definition at line 869 of file BlockSparseMatrix.h.
|
inline |
Definition at line 755 of file BlockSparseMatrix.h.
|
inline |
Definition at line 793 of file BlockSparseMatrix.h.
|
protected |
|
inline |
for compatibility purposes with the SparseMatrix class
Definition at line 874 of file BlockSparseMatrix.h.
|
inline |
Definition at line 864 of file BlockSparseMatrix.h.
|
inline |
|
inline |
Definition at line 856 of file BlockSparseMatrix.h.
|
inline |
Definition at line 367 of file BlockSparseMatrix.h.
|
inline |
Assignment from a sparse matrix with the same storage order.
Convert from a sparse matrix to block sparse matrix.
Definition at line 407 of file BlockSparseMatrix.h.
|
inline |
Definition at line 777 of file BlockSparseMatrix.h.
|
inline |
Definition at line 870 of file BlockSparseMatrix.h.
|
inline |
Definition at line 871 of file BlockSparseMatrix.h.
|
inline |
Definition at line 761 of file BlockSparseMatrix.h.
|
inline |
Definition at line 781 of file BlockSparseMatrix.h.
|
inline |
Allocate the internal array of pointers to blocks and their inner indices.
nonzerosblocks | Number of nonzero blocks. The total number of nonzeros is is computed in setBlockLayout() for variable-size blocks |
Definition at line 598 of file BlockSparseMatrix.h.
|
inline |
|
inline |
|
inline |
Set the row and column block layouts,.
This function set the size of each row and column block. So this function should be used only for blocks with variable size.
rowBlocks | : Number of rows per row block |
colBlocks | : Number of columns per column block |
Definition at line 565 of file BlockSparseMatrix.h.
|
inline |
set the block size at runtime for fixed-size block layout
Call this only for fixed-size blocks
Definition at line 551 of file BlockSparseMatrix.h.
|
inline |
Set the nonzero block pattern of the matrix.
Given a sparse matrix describing the nonzero block pattern, this function prepares the internal pointers for values. After calling this function, any nonzero block (bi, bj) can be set with a simple call to coeffRef(bi,bj).
blockPattern | Sparse matrix of boolean elements describing the block structure |
Definition at line 500 of file BlockSparseMatrix.h.
|
inline |
Fill values in a matrix from a triplet list.
Each triplet item has a block stored in an Eigen dense matrix. The InputIterator class should provide the functions row(), col() and value()
FIXME Do not accept duplicates
Definition at line 633 of file BlockSparseMatrix.h.
|
inline |
Definition at line 866 of file BlockSparseMatrix.h.
|
protected |
Definition at line 967 of file BlockSparseMatrix.h.
|
protected |
Definition at line 970 of file BlockSparseMatrix.h.
|
protected |
Definition at line 968 of file BlockSparseMatrix.h.
|
protected |
Definition at line 960 of file BlockSparseMatrix.h.
|
protected |
Definition at line 962 of file BlockSparseMatrix.h.
|
protected |
Definition at line 965 of file BlockSparseMatrix.h.
|
protected |
Definition at line 964 of file BlockSparseMatrix.h.
|
protected |
Definition at line 961 of file BlockSparseMatrix.h.
|
protected |
Definition at line 969 of file BlockSparseMatrix.h.
|
protected |
Definition at line 963 of file BlockSparseMatrix.h.
|
protected |
Definition at line 966 of file BlockSparseMatrix.h.