12 #ifndef BOGUS_MAPPED_SPARSEBLOCKMATRIX_HPP
13 #define BOGUS_MAPPED_SPARSEBLOCKMATRIX_HPP
15 #include "CompressedSparseBlockIndex.hpp"
16 #include "SparseBlockMatrixBase.hpp"
17 #include "../Utils/CppTools.hpp"
23 template <
typename BlockT,
int Flags,
typename Index_ >
25 :
public BlockMatrixTraits< BlockObjectBase< MappedSparseBlockMatrix< BlockT, Flags, Index_ > > >
28 typedef typename BaseTraits::Index Index;
29 typedef typename BlockTraits< BlockT >::Scalar Scalar ;
37 typedef BlockT BlockType ;
38 typedef BOGUS_DEFAULT_BLOCK_PTR_TYPE BlockPtr ;
67 template <
typename BlockT,
int Flags,
typename Index_ >
72 typedef typename Base::Index Index ;
73 typedef typename Base::BlockPtr BlockPtr ;
79 template <
typename Derived >
86 std::size_t numberOfNonZeros,
87 const BlockT* dataPtr,
88 const Index* outerIndexPtr,
89 const Index* innerIndexPtr
94 Base::m_blocks.setData( dataPtr, numberOfNonZeros ) ;
95 Base::m_majorIndex.inner.setData( innerIndexPtr, numberOfNonZeros ) ;
96 Base::m_majorIndex.outer.setData( outerIndexPtr, Base::m_minorIndex.innerSize() + 1 ) ;
98 Base::m_minorIndex.valid = Base::empty() ;
99 Base::Finalizer::finalize( *
this ) ;
102 template <
typename Derived >
105 BOGUS_STATIC_ASSERT( (
int) Base::Traits::flags == (
int) Derived::Traits::flags,
106 OPERANDS_HAVE_INCONSISTENT_FLAGS ) ;
108 Base::cloneDimensions( source ) ;
111 source.majorIndex().outerIndexPtr(),
112 source.majorIndex().innerIndexPtr()
120 template <
typename BlockT,
int Flags,
typename Index_ >
124 typedef typename BlockType::Scalar Scalar ;
126 <
typename BlockType::TransposeBlockType, Flags ^
flags::COL_MAJOR, Index_ >
130 RowsAtCompileTime = internal::DYNAMIC,
131 ColsAtCompileTime = internal::DYNAMIC,
132 uses_plain_array_storage = 0,
140 #endif // SPARSEBLOCKMATRIX_HH
std::size_t nBlocks() const
Returns the number of (non-zero) blocks of the matrix.
Definition: SparseBlockMatrixBase.hpp:240
Definition: Traits.hpp:19
Uncompressed sparse block index.
Definition: SparseBlockIndex.hpp:86
Base class for matrix-like objects that define a block structure, but not a block type...
Definition: IterableBlockObject.hpp:22
Definition: Traits.hpp:29
Mapped Sparse Block Matrix.
Definition: MappedSparseBlockMatrix.hpp:68
Store only half the matrix, or rather the triangular part for which inner <= outer,.
Definition: Constants.hpp:64
Use an uncompressed index.
Definition: Constants.hpp:56
Store and index blocks in a column major way.
Definition: Constants.hpp:58
void mapTo(std::size_t numberOfNonZeros, const BlockT *dataPtr, const Index *outerIndexPtr, const Index *innerIndexPtr)
Definition: MappedSparseBlockMatrix.hpp:85
Const mapped array, used for Mapped Block Matrices.
Definition: CppTools.hpp:145
const BlockType * data() const
Access to blocks data as a raw pointer.
Definition: BlockMatrixBase.hpp:91
Base class for SparseBlockMatrix.
Definition: SparseBlockMatrixBase.hpp:36