A versatile sparse matrix representation where each element is a block. More...
#include <BlockSparseMatrix.h>
Classes | |
class | BlockInnerIterator |
class | InnerIterator |
Public Types | |
enum | { Options = _Options, Flags = Options, BlockSize =_BlockAtCompileTime, RowsAtCompileTime = Dynamic, ColsAtCompileTime = Dynamic, MaxRowsAtCompileTime = Dynamic, MaxColsAtCompileTime = Dynamic, IsVectorAtCompileTime = 0, IsColMajor = Flags&RowMajorBit ? 0 : 1 } |
typedef Matrix< RealScalar, _BlockAtCompileTime, _BlockAtCompileTime, IsColMajor ? ColMajor :RowMajor > | BlockRealScalar |
typedef Matrix< Scalar, _BlockAtCompileTime, _BlockAtCompileTime, IsColMajor ? ColMajor :RowMajor > | BlockScalar |
typedef internal::conditional< _BlockAtCompileTime==Dynamic, Scalar, BlockScalar >::type | 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 |
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 () | |
Protected Member Functions | |
Map< BlockScalar > | insert (Index brow, Index bcol) |
Friends | |
std::ostream & | operator<< (std::ostream &s, const BlockSparseMatrix &m) |
void | swap (BlockSparseMatrix &first, BlockSparseMatrix &second) |
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 54 of file BlockSparseMatrix.h.
typedef Matrix<RealScalar, _BlockAtCompileTime, _BlockAtCompileTime,IsColMajor ? ColMajor : RowMajor> Eigen::BlockSparseMatrix::BlockRealScalar |
Definition at line 304 of file BlockSparseMatrix.h.
typedef Matrix<Scalar, _BlockAtCompileTime, _BlockAtCompileTime,IsColMajor ? ColMajor : RowMajor> Eigen::BlockSparseMatrix::BlockScalar |
Definition at line 303 of file BlockSparseMatrix.h.
typedef internal::conditional<_BlockAtCompileTime==Dynamic, Scalar, BlockScalar>::type Eigen::BlockSparseMatrix::BlockScalarReturnType |
Definition at line 305 of file BlockSparseMatrix.h.
typedef internal::ref_selector<BlockSparseMatrix<_Scalar, _BlockAtCompileTime, _Options, _StorageIndex> >::type Eigen::BlockSparseMatrix::Nested |
Definition at line 290 of file BlockSparseMatrix.h.
typedef BlockSparseMatrix<Scalar, BlockSize, IsColMajor ? ColMajor : RowMajor, StorageIndex> Eigen::BlockSparseMatrix::PlainObject |
Definition at line 306 of file BlockSparseMatrix.h.
Definition at line 288 of file BlockSparseMatrix.h.
typedef _Scalar Eigen::BlockSparseMatrix::Scalar |
Definition at line 287 of file BlockSparseMatrix.h.
typedef _StorageIndex Eigen::BlockSparseMatrix::StorageIndex |
Definition at line 289 of file BlockSparseMatrix.h.
anonymous enum |
Enumerator | |
---|---|
Options | |
Flags | |
BlockSize | |
RowsAtCompileTime | |
ColsAtCompileTime | |
MaxRowsAtCompileTime | |
MaxColsAtCompileTime | |
IsVectorAtCompileTime | |
IsColMajor |
Definition at line 292 of file BlockSparseMatrix.h.
|
inline |
Definition at line 309 of file BlockSparseMatrix.h.
Construct and resize.
Definition at line 320 of file BlockSparseMatrix.h.
|
inline |
Copy-constructor.
Definition at line 331 of file BlockSparseMatrix.h.
|
inline |
Definition at line 373 of file BlockSparseMatrix.h.
|
inline |
Constructor from a sparse matrix.
Definition at line 389 of file BlockSparseMatrix.h.
|
inline |
Definition at line 770 of file BlockSparseMatrix.h.
Definition at line 884 of file BlockSparseMatrix.h.
Definition at line 893 of file BlockSparseMatrix.h.
Definition at line 899 of file BlockSparseMatrix.h.
Definition at line 889 of file BlockSparseMatrix.h.
Definition at line 903 of file BlockSparseMatrix.h.
id
in the array of values Definition at line 936 of file BlockSparseMatrix.h.
|
inline |
Definition at line 765 of file BlockSparseMatrix.h.
Definition at line 876 of file BlockSparseMatrix.h.
|
inline |
Definition at line 832 of file BlockSparseMatrix.h.
|
inline |
Definition at line 806 of file BlockSparseMatrix.h.
|
inline |
Definition at line 747 of file BlockSparseMatrix.h.
|
inline |
Definition at line 776 of file BlockSparseMatrix.h.
|
inline |
Definition at line 866 of file BlockSparseMatrix.h.
|
inline |
Definition at line 867 of file BlockSparseMatrix.h.
|
inline |
Definition at line 753 of file BlockSparseMatrix.h.
Definition at line 791 of file BlockSparseMatrix.h.
|
protected |
|
inline |
for compatibility purposes with the SparseMatrix class
Definition at line 872 of file BlockSparseMatrix.h.
|
inline |
Definition at line 862 of file BlockSparseMatrix.h.
|
inline |
Definition at line 860 of file BlockSparseMatrix.h.
|
inline |
Definition at line 854 of file BlockSparseMatrix.h.
|
inline |
Definition at line 365 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 405 of file BlockSparseMatrix.h.
|
inline |
Definition at line 775 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 759 of file BlockSparseMatrix.h.
Definition at line 779 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 596 of file BlockSparseMatrix.h.
Set the number of rows and columns blocks.
Definition at line 538 of file BlockSparseMatrix.h.
|
inline |
Definition at line 738 of file BlockSparseMatrix.h.
|
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 563 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 549 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 498 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 631 of file BlockSparseMatrix.h.
|
inline |
Definition at line 864 of file BlockSparseMatrix.h.
|
friend |
Definition at line 918 of file BlockSparseMatrix.h.
|
friend |
Definition at line 350 of file BlockSparseMatrix.h.
|
protected |
Definition at line 965 of file BlockSparseMatrix.h.
|
protected |
Definition at line 968 of file BlockSparseMatrix.h.
|
protected |
Definition at line 966 of file BlockSparseMatrix.h.
|
protected |
Definition at line 958 of file BlockSparseMatrix.h.
|
protected |
Definition at line 960 of file BlockSparseMatrix.h.
|
protected |
Definition at line 963 of file BlockSparseMatrix.h.
|
protected |
Definition at line 962 of file BlockSparseMatrix.h.
|
protected |
Definition at line 959 of file BlockSparseMatrix.h.
|
protected |
Definition at line 967 of file BlockSparseMatrix.h.
|
protected |
Definition at line 961 of file BlockSparseMatrix.h.
|
protected |
Definition at line 964 of file BlockSparseMatrix.h.