g2o
|
Sparse matrix which uses blocks. More...
#include <sparse_block_matrix.h>
Public Types | |
typedef MatrixType | SparseMatrixBlock |
this is the type of the elementary block, it is an Eigen::Matrix. More... | |
typedef std::map< int, SparseMatrixBlock * > | IntBlockMap |
Public Member Functions | |
int | cols () const |
columns of the matrix More... | |
int | rows () const |
rows of the matrix More... | |
SparseBlockMatrix (const int *rbi, const int *cbi, int rb, int cb, bool hasStorage=true) | |
SparseBlockMatrix () | |
~SparseBlockMatrix () | |
void | clear (bool dealloc=false) |
this zeroes all the blocks. If dealloc=true the blocks are removed from memory More... | |
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 More... | |
const SparseMatrixBlock * | block (int r, int c) const |
returns the block at location r,c More... | |
int | rowsOfBlock (int r) const |
how many rows does the block at block-row r has? More... | |
int | colsOfBlock (int c) const |
how many cols does the block at block-col c has? More... | |
int | rowBaseOfBlock (int r) const |
where does the row at block-row r starts? More... | |
int | colBaseOfBlock (int c) const |
where does the col at block-col r starts? More... | |
size_t | nonZeros () const |
number of non-zero elements More... | |
size_t | nonZeroBlocks () const |
number of allocated blocks More... | |
SparseBlockMatrix * | clone () const |
deep copy of a sparse-block-matrix; More... | |
SparseBlockMatrix * | slice (int rmin, int rmax, int cmin, int cmax, bool alloc=true) const |
template<class MatrixTransposedType > | |
bool | transpose (SparseBlockMatrix< MatrixTransposedType > *&dest) const |
transposes a block matrix, The transposed type should match the argument false on failure More... | |
bool | add (SparseBlockMatrix< MatrixType > *&dest) const |
adds the current matrix to the destination More... | |
template<class MatrixResultType , class MatrixFactorType > | |
bool | multiply (SparseBlockMatrix< MatrixResultType > *&dest, const SparseBlockMatrix< MatrixFactorType > *M) const |
dest = (*this) * M More... | |
void | multiply (double *&dest, const double *src) const |
dest = (*this) * src More... | |
void | multiplySymmetricUpperTriangle (double *&dest, const double *src) const |
void | rightMultiply (double *&dest, const double *src) const |
dest = M * (*this) More... | |
void | scale (double a) |
*this *= a More... | |
bool | symmPermutation (SparseBlockMatrix< MatrixType > *&dest, const int *pinv, bool onlyUpper=false) const |
int | fillCCS (int *Cp, int *Ci, double *Cx, bool upperTriangle=false) const |
int | fillCCS (double *Cx, bool upperTriangle=false) const |
void | fillBlockStructure (MatrixStructure &ms) const |
exports the non zero blocks in the structure matrix ms More... | |
const std::vector< IntBlockMap > & | blockCols () const |
the block matrices per block-column More... | |
std::vector< IntBlockMap > & | blockCols () |
const std::vector< int > & | rowBlockIndices () const |
indices of the row blocks More... | |
std::vector< int > & | rowBlockIndices () |
const std::vector< int > & | colBlockIndices () const |
indices of the column blocks More... | |
std::vector< int > & | colBlockIndices () |
bool | writeOctave (const char *filename, bool upperTriangle=true) const |
int | fillSparseBlockMatrixCCS (SparseBlockMatrixCCS< MatrixType > &blockCCS) const |
int | fillSparseBlockMatrixCCSTransposed (SparseBlockMatrixCCS< MatrixType > &blockCCS) const |
void | takePatternFromHash (SparseBlockMatrixHashMap< MatrixType > &hashMatrix) |
Protected Attributes | |
std::vector< int > | _rowBlockIndices |
vector of the indices of the blocks along the rows. More... | |
std::vector< int > | _colBlockIndices |
std::vector< IntBlockMap > | _blockCols |
bool | _hasStorage |
Sparse matrix which uses blocks.
Template class that specifies a sparse block matrix. A block matrix is a sparse matrix made of dense blocks. These blocks cannot have a random pattern, but follow a (variable) grid structure. This structure is specified by a partition of the rows and the columns of the matrix. The blocks are represented by the Eigen::Matrix structure, thus they can be statically or dynamically allocated. For efficiency reasons it is convenient to allocate them statically, when possible. A static block matrix has all blocks of the same size, and the size of the block is specified by the template argument. If this is not the case, and you have different block sizes than you have to use a dynamic-block matrix (default template argument).
Definition at line 61 of file sparse_block_matrix.h.
typedef std::map<int, SparseMatrixBlock*> g2o::SparseBlockMatrix< MatrixType >::IntBlockMap |
Definition at line 72 of file sparse_block_matrix.h.
typedef MatrixType g2o::SparseBlockMatrix< MatrixType >::SparseMatrixBlock |
this is the type of the elementary block, it is an Eigen::Matrix.
Definition at line 65 of file sparse_block_matrix.h.
g2o::SparseBlockMatrix< MatrixType >::SparseBlockMatrix | ( | const int * | rbi, |
const int * | cbi, | ||
int | rb, | ||
int | cb, | ||
bool | hasStorage = true |
||
) |
constructs a sparse block matrix having a specific layout
rbi | array of int containing the row layout of the blocks. the component i of the array should contain the index of the first row of the block i+1. |
rbi | array of int containing the column layout of the blocks. the component i of the array should contain the index of the first col of the block i+1. |
rb | number of row blocks |
cb | number of col blocks |
hasStorage | set it to true if the matrix "owns" the blocks, thus it deletes it on destruction. if false the matrix is only a "view" over an existing structure. |
Definition at line 53 of file sparse_block_matrix.hpp.
g2o::SparseBlockMatrix< MatrixType >::SparseBlockMatrix | ( | ) |
Definition at line 61 of file sparse_block_matrix.hpp.
Referenced by g2o::SparseBlockMatrix< MatrixType >::add(), g2o::SparseBlockMatrix< MatrixType >::clone(), g2o::SparseBlockMatrix< MatrixType >::slice(), and g2o::SparseBlockMatrix< MatrixType >::symmPermutation().
g2o::SparseBlockMatrix< MatrixType >::~SparseBlockMatrix | ( | ) |
Definition at line 85 of file sparse_block_matrix.hpp.
References g2o::SparseBlockMatrix< MatrixType >::_hasStorage, and g2o::SparseBlockMatrix< MatrixType >::clear().
bool g2o::SparseBlockMatrix< MatrixType >::add | ( | SparseBlockMatrix< MatrixType > *& | dest | ) | const |
adds the current matrix to the destination
Definition at line 168 of file sparse_block_matrix.hpp.
References g2o::SparseBlockMatrix< MatrixType >::_blockCols, g2o::SparseBlockMatrix< MatrixType >::_colBlockIndices, g2o::SparseBlockMatrix< MatrixType >::_hasStorage, g2o::SparseBlockMatrix< MatrixType >::_rowBlockIndices, g2o::SparseBlockMatrix< MatrixType >::block(), and g2o::SparseBlockMatrix< MatrixType >::SparseBlockMatrix().
Referenced by g2o::SparseBlockMatrix< PoseMatrixType >::colBaseOfBlock(), main(), and g2o::BlockSolver< Traits >::solve().
SparseBlockMatrix< MatrixType >::SparseMatrixBlock * g2o::SparseBlockMatrix< MatrixType >::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
Definition at line 91 of file sparse_block_matrix.hpp.
References g2o::SparseBlockMatrix< MatrixType >::_blockCols, g2o::SparseBlockMatrix< MatrixType >::_hasStorage, g2o::SparseBlockMatrix< MatrixType >::colsOfBlock(), and g2o::SparseBlockMatrix< MatrixType >::rowsOfBlock().
Referenced by g2o::SparseBlockMatrix< MatrixType >::add(), g2o::BlockSolver< Traits >::buildStructure(), g2o::MarginalCovarianceCholesky::computeCovariance(), g2o::EdgeLabeler::labelEdge(), main(), g2o::SparseBlockMatrix< MatrixType >::multiply(), g2o::BlockSolver< Traits >::restoreDiagonal(), g2o::BlockSolver< Traits >::setLambda(), g2o::SparseBlockMatrix< MatrixType >::symmPermutation(), testMarginals(), g2o::SparseBlockMatrix< MatrixType >::transpose(), and g2o::BlockSolver< Traits >::updateStructure().
const SparseBlockMatrix< MatrixType >::SparseMatrixBlock * g2o::SparseBlockMatrix< MatrixType >::block | ( | int | r, |
int | c | ||
) | const |
returns the block at location r,c
Definition at line 113 of file sparse_block_matrix.hpp.
References g2o::SparseBlockMatrix< MatrixType >::_blockCols.
|
inline |
the block matrices per block-column
Definition at line 177 of file sparse_block_matrix.h.
Referenced by g2o::BlockSolver< Traits >::buildStructure(), g2o::LinearSolverEigen< MatrixType >::computeSymbolicDecomposition(), g2o::SparseBlockMatrix< MatrixType >::fillSparseBlockMatrixCCS(), g2o::SparseBlockMatrix< MatrixType >::fillSparseBlockMatrixCCSTransposed(), g2o::LinearSolverEigen< MatrixType >::fillSparseMatrix(), g2o::operator<<(), g2o::LinearSolverDense< MatrixType >::solve(), g2o::BlockSolver< Traits >::solve(), g2o::SparseBlockMatrix< MatrixType >::takePatternFromHash(), and g2o::BlockSolver< Traits >::updateStructure().
|
inline |
Definition at line 178 of file sparse_block_matrix.h.
void g2o::SparseBlockMatrix< MatrixType >::clear | ( | bool | dealloc = false | ) |
this zeroes all the blocks. If dealloc=true the blocks are removed from memory
Definition at line 67 of file sparse_block_matrix.hpp.
References g2o::SparseBlockMatrix< MatrixType >::_blockCols, and g2o::SparseBlockMatrix< MatrixType >::_hasStorage.
Referenced by g2o::BlockSolver< Traits >::buildSystem(), g2o::BlockSolver< Traits >::init(), main(), g2o::BlockSolver< Traits >::solve(), g2o::SparseBlockMatrix< MatrixType >::symmPermutation(), and g2o::SparseBlockMatrix< MatrixType >::~SparseBlockMatrix().
SparseBlockMatrix< MatrixType > * g2o::SparseBlockMatrix< MatrixType >::clone | ( | ) | const |
deep copy of a sparse-block-matrix;
Definition at line 122 of file sparse_block_matrix.hpp.
References g2o::SparseBlockMatrix< MatrixType >::_blockCols, g2o::SparseBlockMatrix< MatrixType >::_colBlockIndices, g2o::SparseBlockMatrix< MatrixType >::_hasStorage, g2o::SparseBlockMatrix< MatrixType >::_rowBlockIndices, and g2o::SparseBlockMatrix< MatrixType >::SparseBlockMatrix().
Referenced by g2o::SparseBlockMatrix< PoseMatrixType >::colBaseOfBlock().
|
inline |
where does the col at block-col r starts?
Definition at line 110 of file sparse_block_matrix.h.
Referenced by g2o::MarginalCovarianceCholesky::computeCovariance(), g2o::LinearSolverEigen< MatrixType >::computeSymbolicDecomposition(), g2o::LinearSolverCholmodOnline< MatrixType >::computeSymbolicDecomposition(), g2o::LinearSolverCSparse< MatrixType >::computeSymbolicDecomposition(), g2o::LinearSolverCholmod< MatrixType >::computeSymbolicDecomposition(), g2o::LinearSolverEigen< MatrixType >::fillSparseMatrix(), g2o::SparseBlockMatrix< MatrixType >::multiplySymmetricUpperTriangle(), g2o::SparseBlockMatrix< MatrixType >::rightMultiply(), g2o::LinearSolverDense< MatrixType >::solve(), and g2o::SparseBlockMatrix< MatrixType >::writeOctave().
|
inline |
indices of the column blocks
Definition at line 185 of file sparse_block_matrix.h.
Referenced by g2o::BlockSolver< Traits >::buildStructure(), g2o::LinearSolverCCS< MatrixType >::initMatrixStructure(), g2o::BlockSolver< Traits >::resize(), and g2o::BlockSolver< Traits >::updateStructure().
|
inline |
Definition at line 186 of file sparse_block_matrix.h.
|
inline |
columns of the matrix
Definition at line 68 of file sparse_block_matrix.h.
Referenced by g2o::SparseOptimizerIncremental::computeCholeskyUpdate(), g2o::LinearSolverEigen< MatrixType >::computeSymbolicDecomposition(), g2o::LinearSolverCholmodOnline< MatrixType >::fillCholmodExt(), g2o::LinearSolverCholmod< MatrixType >::fillCholmodExt(), g2o::LinearSolverCSparse< MatrixType >::fillCSparse(), g2o::SparseBlockMatrix< MatrixType >::multiply(), g2o::SparseBlockMatrix< MatrixType >::multiplySymmetricUpperTriangle(), g2o::SparseBlockMatrix< MatrixType >::nonZeros(), g2o::SparseBlockMatrix< MatrixType >::rightMultiply(), g2o::LinearSolverDense< MatrixType >::solve(), g2o::LinearSolverEigen< MatrixType >::solve(), g2o::BlockSolver< Traits >::solve(), g2o::SparseBlockMatrix< MatrixType >::symmPermutation(), and g2o::SparseBlockMatrix< MatrixType >::writeOctave().
|
inline |
how many cols does the block at block-col c has?
Definition at line 104 of file sparse_block_matrix.h.
Referenced by g2o::SparseBlockMatrix< MatrixType >::block(), g2o::LinearSolverEigen< MatrixType >::computeSymbolicDecomposition(), g2o::LinearSolverCholmodOnline< MatrixType >::computeSymbolicDecomposition(), g2o::LinearSolverCSparse< MatrixType >::computeSymbolicDecomposition(), g2o::LinearSolverCholmod< MatrixType >::computeSymbolicDecomposition(), g2o::SparseBlockMatrix< MatrixType >::fillCCS(), g2o::SparseBlockMatrix< MatrixType >::slice(), g2o::LinearSolverDense< MatrixType >::solve(), g2o::LinearSolverCSparse< MatrixType >::solveBlocks(), and g2o::LinearSolverCholmod< MatrixType >::solveBlocks().
void g2o::SparseBlockMatrix< MatrixType >::fillBlockStructure | ( | MatrixStructure & | ms | ) | const |
exports the non zero blocks in the structure matrix ms
Definition at line 519 of file sparse_block_matrix.hpp.
References g2o::SparseBlockMatrix< MatrixType >::_blockCols, g2o::SparseBlockMatrix< MatrixType >::_colBlockIndices, g2o::SparseBlockMatrix< MatrixType >::_rowBlockIndices, g2o::MatrixStructure::Aii, g2o::MatrixStructure::alloc(), g2o::MatrixStructure::Ap, g2o::MatrixStructure::m, and g2o::SparseBlockMatrix< MatrixType >::nonZeroBlocks().
Referenced by g2o::SparseBlockMatrix< PoseMatrixType >::colBaseOfBlock(), g2o::LinearSolverCholmodOnline< MatrixType >::computeSymbolicDecomposition(), g2o::LinearSolverCSparse< MatrixType >::computeSymbolicDecomposition(), and g2o::LinearSolverCholmod< MatrixType >::computeSymbolicDecomposition().
int g2o::SparseBlockMatrix< MatrixType >::fillCCS | ( | int * | Cp, |
int * | Ci, | ||
double * | Cx, | ||
bool | upperTriangle = false |
||
) | const |
fill the CCS arrays of a matrix, arrays have to be allocated beforehand
Definition at line 489 of file sparse_block_matrix.hpp.
References g2o::SparseBlockMatrix< MatrixType >::_blockCols, g2o::SparseBlockMatrix< MatrixType >::_colBlockIndices, g2o::SparseBlockMatrix< MatrixType >::_rowBlockIndices, g2o::SparseBlockMatrix< MatrixType >::colsOfBlock(), and g2o::SparseBlockMatrix< MatrixType >::rows().
Referenced by g2o::SparseBlockMatrix< PoseMatrixType >::colBaseOfBlock(), g2o::SparseOptimizerIncremental::computeCholeskyUpdate(), g2o::LinearSolverCholmodOnline< MatrixType >::fillCholmodExt(), and g2o::LinearSolverEigen< MatrixType >::fillSparseMatrix().
int g2o::SparseBlockMatrix< MatrixType >::fillCCS | ( | double * | Cx, |
bool | upperTriangle = false |
||
) | const |
fill the CCS arrays of a matrix, arrays have to be allocated beforehand. This function only writes the values and assumes that column and row structures have already been written.
Definition at line 464 of file sparse_block_matrix.hpp.
References g2o::SparseBlockMatrix< MatrixType >::_blockCols, g2o::SparseBlockMatrix< MatrixType >::_colBlockIndices, g2o::SparseBlockMatrix< MatrixType >::_rowBlockIndices, g2o::SparseBlockMatrix< MatrixType >::colsOfBlock(), and g2o::SparseBlockMatrix< MatrixType >::rows().
int g2o::SparseBlockMatrix< MatrixType >::fillSparseBlockMatrixCCS | ( | SparseBlockMatrixCCS< MatrixType > & | blockCCS | ) | const |
copy into CCS structure
Definition at line 591 of file sparse_block_matrix.hpp.
References g2o::SparseBlockMatrixCCS< MatrixType >::blockCols(), and g2o::SparseBlockMatrix< MatrixType >::blockCols().
Referenced by g2o::BlockSolver< Traits >::buildStructure(), g2o::SparseBlockMatrix< PoseMatrixType >::colBlockIndices(), and g2o::LinearSolverCCS< MatrixType >::initMatrixStructure().
int g2o::SparseBlockMatrix< MatrixType >::fillSparseBlockMatrixCCSTransposed | ( | SparseBlockMatrixCCS< MatrixType > & | blockCCS | ) | const |
copy as transposed into a CCS structure
Definition at line 609 of file sparse_block_matrix.hpp.
References g2o::SparseBlockMatrix< MatrixType >::_rowBlockIndices, g2o::SparseBlockMatrixCCS< MatrixType >::blockCols(), and g2o::SparseBlockMatrix< MatrixType >::blockCols().
Referenced by g2o::BlockSolver< Traits >::buildStructure(), and g2o::SparseBlockMatrix< PoseMatrixType >::colBlockIndices().
bool g2o::SparseBlockMatrix< MatrixType >::multiply | ( | SparseBlockMatrix< MatrixResultType > *& | dest, |
const SparseBlockMatrix< MatrixFactorType > * | M | ||
) | const |
dest = (*this) * M
Definition at line 199 of file sparse_block_matrix.hpp.
References g2o::SparseBlockMatrix< MatrixType >::_blockCols, g2o::SparseBlockMatrix< MatrixType >::_colBlockIndices, g2o::SparseBlockMatrix< MatrixType >::_hasStorage, g2o::SparseBlockMatrix< MatrixType >::_rowBlockIndices, g2o::SparseBlockMatrix< MatrixType >::block(), g2o::SparseBlockMatrix< MatrixType >::cols(), and g2o::SparseBlockMatrix< MatrixType >::rows().
Referenced by g2o::SparseBlockMatrix< PoseMatrixType >::colBaseOfBlock(), and main().
void g2o::SparseBlockMatrix< MatrixType >::multiply | ( | double *& | dest, |
const double * | src | ||
) | const |
dest = (*this) * src
Definition at line 234 of file sparse_block_matrix.hpp.
References g2o::SparseBlockMatrix< MatrixType >::_blockCols, g2o::SparseBlockMatrix< MatrixType >::_colBlockIndices, g2o::SparseBlockMatrix< MatrixType >::_rowBlockIndices, g2o::SparseBlockMatrix< MatrixType >::cols(), and g2o::SparseBlockMatrix< MatrixType >::rows().
void g2o::SparseBlockMatrix< MatrixType >::multiplySymmetricUpperTriangle | ( | double *& | dest, |
const double * | src | ||
) | const |
compute dest = (*this) * src However, assuming that this is a symmetric matrix where only the upper triangle is stored
Definition at line 257 of file sparse_block_matrix.hpp.
References g2o::SparseBlockMatrix< MatrixType >::_blockCols, g2o::SparseBlockMatrix< MatrixType >::_rowBlockIndices, g2o::SparseBlockMatrix< MatrixType >::colBaseOfBlock(), g2o::SparseBlockMatrix< MatrixType >::cols(), g2o::SparseBlockMatrix< MatrixType >::rowBaseOfBlock(), and g2o::SparseBlockMatrix< MatrixType >::rows().
Referenced by g2o::SparseBlockMatrix< PoseMatrixType >::colBaseOfBlock().
size_t g2o::SparseBlockMatrix< MatrixType >::nonZeroBlocks | ( | ) | const |
number of allocated blocks
Definition at line 353 of file sparse_block_matrix.hpp.
References g2o::SparseBlockMatrix< MatrixType >::_blockCols.
Referenced by g2o::SparseBlockMatrix< PoseMatrixType >::colBaseOfBlock(), g2o::SparseBlockMatrix< MatrixType >::fillBlockStructure(), and g2o::SparseBlockMatrix< MatrixType >::nonZeros().
size_t g2o::SparseBlockMatrix< MatrixType >::nonZeros | ( | ) | const |
number of non-zero elements
Definition at line 361 of file sparse_block_matrix.hpp.
References g2o::SparseBlockMatrix< MatrixType >::_blockCols, g2o::SparseBlockMatrix< MatrixType >::cols(), g2o::SparseBlockMatrix< MatrixType >::nonZeroBlocks(), and g2o::SparseBlockMatrix< MatrixType >::rows().
Referenced by g2o::SparseBlockMatrix< PoseMatrixType >::colBaseOfBlock(), g2o::SparseOptimizerIncremental::computeCholeskyUpdate(), g2o::LinearSolverCholmodOnline< MatrixType >::fillCholmodExt(), g2o::LinearSolverCholmod< MatrixType >::fillCholmodExt(), g2o::LinearSolverCSparse< MatrixType >::fillCSparse(), and g2o::LinearSolverEigen< MatrixType >::fillSparseMatrix().
void g2o::SparseBlockMatrix< MatrixType >::rightMultiply | ( | double *& | dest, |
const double * | src | ||
) | const |
dest = M * (*this)
Definition at line 284 of file sparse_block_matrix.hpp.
References g2o::SparseBlockMatrix< MatrixType >::_blockCols, g2o::SparseBlockMatrix< MatrixType >::colBaseOfBlock(), g2o::SparseBlockMatrix< MatrixType >::cols(), g2o::SparseBlockMatrix< MatrixType >::rowBaseOfBlock(), and g2o::SparseBlockMatrix< MatrixType >::rows().
Referenced by g2o::SparseBlockMatrix< PoseMatrixType >::colBaseOfBlock().
|
inline |
where does the row at block-row r starts?
Definition at line 107 of file sparse_block_matrix.h.
Referenced by g2o::MarginalCovarianceCholesky::computeCovariance(), g2o::LinearSolverEigen< MatrixType >::fillSparseMatrix(), g2o::SparseBlockMatrix< MatrixType >::multiplySymmetricUpperTriangle(), g2o::SparseBlockMatrix< MatrixType >::rightMultiply(), g2o::LinearSolverDense< MatrixType >::solve(), g2o::BlockSolver< Traits >::solve(), and g2o::SparseBlockMatrix< MatrixType >::writeOctave().
|
inline |
indices of the row blocks
Definition at line 181 of file sparse_block_matrix.h.
Referenced by g2o::BlockSolver< Traits >::buildStructure(), g2o::LinearSolverCCS< MatrixType >::initMatrixStructure(), g2o::BlockSolver< Traits >::resize(), g2o::LinearSolverCSparse< MatrixType >::solveBlocks(), g2o::LinearSolverCholmod< MatrixType >::solveBlocks(), g2o::LinearSolverCSparse< MatrixType >::solvePattern(), g2o::LinearSolverCholmod< MatrixType >::solvePattern(), and g2o::BlockSolver< Traits >::updateStructure().
|
inline |
Definition at line 182 of file sparse_block_matrix.h.
|
inline |
rows of the matrix
Definition at line 70 of file sparse_block_matrix.h.
Referenced by g2o::SparseOptimizerIncremental::computeCholeskyUpdate(), g2o::LinearSolverEigen< MatrixType >::computeSymbolicDecomposition(), g2o::SparseBlockMatrix< MatrixType >::fillCCS(), g2o::LinearSolverCholmodOnline< MatrixType >::fillCholmodExt(), g2o::LinearSolverCholmod< MatrixType >::fillCholmodExt(), g2o::LinearSolverCSparse< MatrixType >::fillCSparse(), g2o::SparseBlockMatrix< MatrixType >::multiply(), g2o::SparseBlockMatrix< MatrixType >::multiplySymmetricUpperTriangle(), g2o::SparseBlockMatrix< MatrixType >::nonZeros(), g2o::SparseBlockMatrix< MatrixType >::rightMultiply(), g2o::LinearSolverEigen< MatrixType >::solve(), g2o::LinearSolverCSparse< MatrixType >::solveBlocks(), g2o::LinearSolverCholmod< MatrixType >::solveBlocks(), g2o::SparseBlockMatrix< MatrixType >::symmPermutation(), and g2o::SparseBlockMatrix< MatrixType >::writeOctave().
|
inline |
how many rows does the block at block-row r has?
Definition at line 101 of file sparse_block_matrix.h.
Referenced by g2o::SparseBlockMatrix< MatrixType >::block(), g2o::SparseBlockMatrix< MatrixType >::slice(), g2o::LinearSolverDense< MatrixType >::solve(), g2o::LinearSolverCSparse< MatrixType >::solveBlocks(), and g2o::LinearSolverCholmod< MatrixType >::solveBlocks().
void g2o::SparseBlockMatrix< MatrixType >::scale | ( | double | a | ) |
*this *= a
Definition at line 314 of file sparse_block_matrix.hpp.
References g2o::SparseBlockMatrix< MatrixType >::_blockCols.
Referenced by g2o::SparseBlockMatrix< PoseMatrixType >::colBaseOfBlock().
SparseBlockMatrix< MatrixType > * g2o::SparseBlockMatrix< MatrixType >::slice | ( | int | rmin, |
int | rmax, | ||
int | cmin, | ||
int | cmax, | ||
bool | alloc = true |
||
) | const |
returns a view or a copy of the block matrix
rmin | starting block row |
rmax | ending block row |
cmin | starting block col |
cmax | ending block col |
alloc | if true it makes a deep copy, if false it creates a view. |
Definition at line 324 of file sparse_block_matrix.hpp.
References g2o::SparseBlockMatrix< MatrixType >::_blockCols, g2o::SparseBlockMatrix< MatrixType >::_hasStorage, g2o::SparseBlockMatrix< MatrixType >::colsOfBlock(), g2o::SparseBlockMatrix< MatrixType >::rowsOfBlock(), and g2o::SparseBlockMatrix< MatrixType >::SparseBlockMatrix().
Referenced by g2o::SparseBlockMatrix< PoseMatrixType >::colBaseOfBlock().
bool g2o::SparseBlockMatrix< MatrixType >::symmPermutation | ( | SparseBlockMatrix< MatrixType > *& | dest, |
const int * | pinv, | ||
bool | onlyUpper = false |
||
) | const |
writes in dest a block permutaton specified by pinv.
pinv | array such that new_block[i] = old_block[pinv[i]] |
Definition at line 399 of file sparse_block_matrix.hpp.
References g2o::SparseBlockMatrix< MatrixType >::_blockCols, g2o::SparseBlockMatrix< MatrixType >::_colBlockIndices, g2o::SparseBlockMatrix< MatrixType >::_rowBlockIndices, g2o::SparseBlockMatrix< MatrixType >::block(), g2o::SparseBlockMatrix< MatrixType >::clear(), g2o::SparseBlockMatrix< MatrixType >::cols(), g2o::SparseBlockMatrix< MatrixType >::rows(), g2o::SparseBlockMatrix< MatrixType >::SparseBlockMatrix(), and g2o::SparseBlockMatrix< MatrixType >::transpose().
Referenced by g2o::SparseBlockMatrix< PoseMatrixType >::colBaseOfBlock(), and main().
void g2o::SparseBlockMatrix< MatrixType >::takePatternFromHash | ( | SparseBlockMatrixHashMap< MatrixType > & | hashMatrix | ) |
take over the memory and matrix pattern from a hash matrix. The structure of the hash matrix will be cleared.
Definition at line 626 of file sparse_block_matrix.hpp.
References g2o::SparseBlockMatrix< MatrixType >::blockCols(), and g2o::SparseBlockMatrixHashMap< MatrixType >::blockCols().
Referenced by g2o::BlockSolver< Traits >::buildStructure(), and g2o::SparseBlockMatrix< PoseMatrixType >::colBlockIndices().
bool g2o::SparseBlockMatrix< MatrixType >::transpose | ( | SparseBlockMatrix< MatrixTransposedType > *& | dest | ) | const |
transposes a block matrix, The transposed type should match the argument false on failure
Definition at line 137 of file sparse_block_matrix.hpp.
References g2o::SparseBlockMatrix< MatrixType >::_blockCols, g2o::SparseBlockMatrix< MatrixType >::_colBlockIndices, g2o::SparseBlockMatrix< MatrixType >::_hasStorage, g2o::SparseBlockMatrix< MatrixType >::_rowBlockIndices, g2o::SparseBlockMatrix< MatrixType >::block(), and g2o::SparseBlockMatrix< MatrixType >::transpose().
Referenced by g2o::SparseBlockMatrix< PoseMatrixType >::colBaseOfBlock(), main(), g2o::LinearSolverDense< MatrixType >::solve(), g2o::SparseBlockMatrix< MatrixType >::symmPermutation(), and g2o::SparseBlockMatrix< MatrixType >::transpose().
bool g2o::SparseBlockMatrix< MatrixType >::writeOctave | ( | const char * | filename, |
bool | upperTriangle = true |
||
) | const |
write the content of this matrix to a stream loadable by Octave
upperTriangle | does this matrix store only the upper triangular blocks |
Definition at line 547 of file sparse_block_matrix.hpp.
References g2o::SparseBlockMatrix< MatrixType >::_blockCols, g2o::SparseBlockMatrix< MatrixType >::colBaseOfBlock(), g2o::SparseBlockMatrix< MatrixType >::cols(), g2o::SparseBlockMatrix< MatrixType >::rowBaseOfBlock(), and g2o::SparseBlockMatrix< MatrixType >::rows().
Referenced by g2o::SparseBlockMatrix< PoseMatrixType >::colBlockIndices(), g2o::BlockSolver< Traits >::saveHessian(), and g2o::LinearSolverEigen< MatrixType >::solve().
|
protected |
array of maps of blocks. The index of the array represent a block column of the matrix and the block column is stored as a map row_block -> matrix_block_ptr.
Definition at line 217 of file sparse_block_matrix.h.
Referenced by g2o::SparseBlockMatrix< MatrixType >::add(), g2o::SparseBlockMatrix< MatrixType >::block(), g2o::SparseBlockMatrix< PoseMatrixType >::blockCols(), g2o::SparseBlockMatrix< MatrixType >::clear(), g2o::SparseBlockMatrix< MatrixType >::clone(), g2o::SparseBlockMatrix< MatrixType >::fillBlockStructure(), g2o::SparseBlockMatrix< MatrixType >::fillCCS(), g2o::SparseBlockMatrix< MatrixType >::multiply(), g2o::SparseBlockMatrix< MatrixType >::multiplySymmetricUpperTriangle(), g2o::SparseBlockMatrix< MatrixType >::nonZeroBlocks(), g2o::SparseBlockMatrix< MatrixType >::nonZeros(), g2o::SparseBlockMatrix< MatrixType >::rightMultiply(), g2o::SparseBlockMatrix< MatrixType >::scale(), g2o::SparseBlockMatrix< MatrixType >::slice(), g2o::SparseBlockMatrix< MatrixType >::symmPermutation(), g2o::SparseBlockMatrix< MatrixType >::transpose(), and g2o::SparseBlockMatrix< MatrixType >::writeOctave().
|
protected |
vector of the indices of the blocks along the cols
Definition at line 214 of file sparse_block_matrix.h.
Referenced by g2o::SparseBlockMatrix< MatrixType >::add(), g2o::SparseBlockMatrix< MatrixType >::clone(), g2o::SparseBlockMatrix< PoseMatrixType >::colBaseOfBlock(), g2o::SparseBlockMatrix< PoseMatrixType >::colBlockIndices(), g2o::SparseBlockMatrix< PoseMatrixType >::cols(), g2o::SparseBlockMatrix< PoseMatrixType >::colsOfBlock(), g2o::SparseBlockMatrix< MatrixType >::fillBlockStructure(), g2o::SparseBlockMatrix< MatrixType >::fillCCS(), g2o::SparseBlockMatrix< MatrixType >::multiply(), g2o::SparseBlockMatrix< MatrixType >::symmPermutation(), and g2o::SparseBlockMatrix< MatrixType >::transpose().
|
protected |
Definition at line 218 of file sparse_block_matrix.h.
Referenced by g2o::SparseBlockMatrix< MatrixType >::add(), g2o::SparseBlockMatrix< MatrixType >::block(), g2o::SparseBlockMatrix< MatrixType >::clear(), g2o::SparseBlockMatrix< MatrixType >::clone(), g2o::SparseBlockMatrix< MatrixType >::multiply(), g2o::SparseBlockMatrix< MatrixType >::slice(), g2o::SparseBlockMatrix< MatrixType >::transpose(), and g2o::SparseBlockMatrix< MatrixType >::~SparseBlockMatrix().
|
protected |
vector of the indices of the blocks along the rows.
Definition at line 213 of file sparse_block_matrix.h.
Referenced by g2o::SparseBlockMatrix< MatrixType >::add(), g2o::SparseBlockMatrix< MatrixType >::clone(), g2o::SparseBlockMatrix< MatrixType >::fillBlockStructure(), g2o::SparseBlockMatrix< MatrixType >::fillCCS(), g2o::SparseBlockMatrix< MatrixType >::fillSparseBlockMatrixCCSTransposed(), g2o::SparseBlockMatrix< MatrixType >::multiply(), g2o::SparseBlockMatrix< MatrixType >::multiplySymmetricUpperTriangle(), g2o::SparseBlockMatrix< PoseMatrixType >::rowBaseOfBlock(), g2o::SparseBlockMatrix< PoseMatrixType >::rowBlockIndices(), g2o::SparseBlockMatrix< PoseMatrixType >::rows(), g2o::SparseBlockMatrix< PoseMatrixType >::rowsOfBlock(), g2o::SparseBlockMatrix< MatrixType >::symmPermutation(), and g2o::SparseBlockMatrix< MatrixType >::transpose().