3#include "Base/Headers/Buffer.hpp"
4#include "Base/Headers/Dictionary.h"
7#include "sparse_block_matrix_ccs.h"
8#include "matrix_structure.h"
13 using namespace Eigen;
30 template <
class MatrixType = MatrixX<g_type>>
42 typedef std::map<int, SparseMatrixBlock> IntBlockMap;
63 void clear(
bool dealloc =
false);
99 template <
class MatrixTransposedType>
106 template <
class MatrixResultType,
class MatrixFactorType>
110 void multiply(g_type*& dest,
const g_type* src)
const;
133 int fillCCS(
int* Cp,
int* Ci, g_type* Cx,
bool upperTriangle =
false)
const;
139 int fillCCS(g_type* Cx,
bool upperTriangle =
false)
const;
182 EIGEN_MAKE_ALIGNED_OPERATOR_NEW
185#include "sparse_block_matrix.hpp"
The equivelent of std::vector but with a bit more control.
representing the structure of a matrix in column compressed structure (only the upper triangular part...
Sparse matrix which uses blocks.
Sparse matrix which uses blocks based on hash structures.
const Buffer< int > & rowBlockIndices() const
indices of the row blocks
void multiply(g_type *&dest, const g_type *src) const
dest = (*this) * src
void scale(g_type a)
*this *= a
int cols() const
columns of the matrix
int fillSparseBlockMatrixCCS(SparseBlockMatrixCCS< MatrixType > &blockCCS) const
copy into CCS structure
bool symmPermutation(SparseBlockMatrix< MatrixType > *&dest, const int *pinv, bool onlyUpper=false) const
writes in dest a block permutaton specified by pinv.
int fillCCS(int *Cp, int *Ci, g_type *Cx, bool upperTriangle=false) const
fill the CCS arrays of a matrix, arrays have to be allocated beforehand
SparseBlockMatrix * slice(int rmin, int rmax, int cmin, int cmax, bool alloc=true) const
returns a view or a copy of the block matrix
Buffer< IntBlockMap > _blockCols
const Buffer< IntBlockMap > & blockCols() const
the block matrices per block-column
int rows() const
rows of the matrix
void multiplySymmetricUpperTriangle(g_type *&dest, const g_type *src) const
compute dest = (*this) * src However, assuming that this is a symmetric matrix where only the upper t...
Buffer< int > _rowBlockIndices
bool add(SparseBlockMatrix< MatrixType > &dest) const
adds the current matrix to the destination
int fillCCS(g_type *Cx, bool upperTriangle=false) const
fill the CCS arrays of a matrix, arrays have to be allocated beforehand.
SparseMatrixBlock * block(int r, int c, bool alloc=false)
returns the block at location r,c. if alloc=true he block is created if it does not exist
uint04 nonZeroBlocks() const
number of allocated blocks
void fillBlockStructure(MatrixStructure &ms) const
exports the non zero blocks in the structure matrix ms
bool multiply(SparseBlockMatrix< MatrixResultType > *&dest, const SparseBlockMatrix< MatrixFactorType > *M) const
dest = (*this) * M
void rightMultiply(g_type *&dest, const g_type *src) const
dest = M * (*this)
const Buffer< int > & colBlockIndices() const
indices of the column blocks
void takePatternFromHash(SparseBlockMatrixHashMap< MatrixType > &hashMatrix)
take over the memory and matrix pattern from a hash matrix.
uint04 nonZeros() const
number of non-zero elements
int rowsOfBlock(int r) const
how many rows does the block at block-row r has?
int fillSparseBlockMatrixCCSTransposed(SparseBlockMatrixCCS< MatrixType > &blockCCS) const
copy as transposed into a CCS structure
bool transpose(SparseBlockMatrix< MatrixTransposedType > *&dest) const
transposes a block matrix, The transposed type should match the argument false on failure
PoseMatrixType SparseMatrixBlock
SparseBlockMatrix(const int *rbi, const int *cbi, int rb, int cb, bool hasStorage=true)
constructs a sparse block matrix having a specific layout
int rowBaseOfBlock(int r) const
where does the row at block-row r starts?
const SparseMatrixBlock * block(int r, int c) const
returns the block at location r,c
void clear(bool dealloc=false)
this zeroes all the blocks. If dealloc=true the blocks are removed from memory
int colsOfBlock(int c) const
how many cols does the block at block-col c has?
int colBaseOfBlock(int c) const
where does the col at block-col r starts?
Buffer< int > _colBlockIndices
Internal helper functions for block-wise matrix-vector products (axpy and atxpy).
The primary namespace for the NDEVR SDK.
uint32_t uint04
-Defines an alias representing a 4 byte, unsigned integer -Can represent exact integer values 0 throu...