g2o
Loading...
Searching...
No Matches
g2o::SparseBlockMatrixDiagonal< MatrixType > Class Template Reference

Sparse matrix which uses blocks on the diagonal. More...

#include <sparse_block_matrix_diagonal.h>

Public Types

typedef MatrixType SparseMatrixBlock
 this is the type of the elementary block, it is an Eigen::Matrix.
using DiagonalVector = std::vector<MatrixType>

Public Member Functions

int cols () const
 columns of the matrix
int rows () const
 rows of the matrix
 SparseBlockMatrixDiagonal (const std::vector< int > &blockIndices)
int dimOfBlock (int r) const
 how many rows/cols does the block at block-row / block-column r has?
int baseOfBlock (int r) const
 where does the row /col at block-row / block-column r starts?
const DiagonalVector & diagonal () const
 the block matrices per block-column
DiagonalVector & diagonal ()
const std::vector< int > & blockIndices () const
 indices of the row blocks
void multiply (double *&dest, const double *src) const

Protected Attributes

const std::vector< int > & _blockIndices
DiagonalVector _diagonal

Detailed Description

template<class MatrixType>
class g2o::SparseBlockMatrixDiagonal< MatrixType >

Sparse matrix which uses blocks on the diagonal.

This class is used as a const view on a SparseBlockMatrix which allows a faster iteration over the elements of the matrix.

Definition at line 46 of file sparse_block_matrix_diagonal.h.

Member Typedef Documentation

◆ DiagonalVector

template<class MatrixType>
using g2o::SparseBlockMatrixDiagonal< MatrixType >::DiagonalVector = std::vector<MatrixType>

Definition at line 56 of file sparse_block_matrix_diagonal.h.

◆ SparseMatrixBlock

template<class MatrixType>
typedef MatrixType g2o::SparseBlockMatrixDiagonal< MatrixType >::SparseMatrixBlock

this is the type of the elementary block, it is an Eigen::Matrix.

Definition at line 49 of file sparse_block_matrix_diagonal.h.

Constructor & Destructor Documentation

◆ SparseBlockMatrixDiagonal()

template<class MatrixType>
g2o::SparseBlockMatrixDiagonal< MatrixType >::SparseBlockMatrixDiagonal ( const std::vector< int > & blockIndices)
inline

Definition at line 58 of file sparse_block_matrix_diagonal.h.

References _blockIndices, and blockIndices().

Member Function Documentation

◆ baseOfBlock()

template<class MatrixType>
int g2o::SparseBlockMatrixDiagonal< MatrixType >::baseOfBlock ( int r) const
inline

where does the row /col at block-row / block-column r starts?

Definition at line 67 of file sparse_block_matrix_diagonal.h.

References _blockIndices.

Referenced by multiply().

◆ blockIndices()

template<class MatrixType>
const std::vector< int > & g2o::SparseBlockMatrixDiagonal< MatrixType >::blockIndices ( ) const
inline

indices of the row blocks

Definition at line 74 of file sparse_block_matrix_diagonal.h.

References _blockIndices.

Referenced by SparseBlockMatrixDiagonal().

◆ cols()

template<class MatrixType>
int g2o::SparseBlockMatrixDiagonal< MatrixType >::cols ( ) const
inline

columns of the matrix

Definition at line 52 of file sparse_block_matrix_diagonal.h.

References _blockIndices.

Referenced by multiply().

◆ diagonal() [1/2]

template<class MatrixType>
DiagonalVector & g2o::SparseBlockMatrixDiagonal< MatrixType >::diagonal ( )
inline

Definition at line 71 of file sparse_block_matrix_diagonal.h.

References _diagonal.

◆ diagonal() [2/2]

template<class MatrixType>
const DiagonalVector & g2o::SparseBlockMatrixDiagonal< MatrixType >::diagonal ( ) const
inline

the block matrices per block-column

Definition at line 70 of file sparse_block_matrix_diagonal.h.

References _diagonal.

◆ dimOfBlock()

template<class MatrixType>
int g2o::SparseBlockMatrixDiagonal< MatrixType >::dimOfBlock ( int r) const
inline

how many rows/cols does the block at block-row / block-column r has?

Definition at line 62 of file sparse_block_matrix_diagonal.h.

References _blockIndices.

◆ multiply()

template<class MatrixType>
void g2o::SparseBlockMatrixDiagonal< MatrixType >::multiply ( double *& dest,
const double * src ) const
inline

Definition at line 76 of file sparse_block_matrix_diagonal.h.

References _diagonal, baseOfBlock(), cols(), and rows().

◆ rows()

template<class MatrixType>
int g2o::SparseBlockMatrixDiagonal< MatrixType >::rows ( ) const
inline

rows of the matrix

Definition at line 54 of file sparse_block_matrix_diagonal.h.

References _blockIndices.

Referenced by multiply().

Member Data Documentation

◆ _blockIndices

template<class MatrixType>
const std::vector<int>& g2o::SparseBlockMatrixDiagonal< MatrixType >::_blockIndices
protected

vector of the indices of the blocks along the diagonal

Definition at line 101 of file sparse_block_matrix_diagonal.h.

Referenced by baseOfBlock(), blockIndices(), cols(), dimOfBlock(), rows(), and SparseBlockMatrixDiagonal().

◆ _diagonal

template<class MatrixType>
DiagonalVector g2o::SparseBlockMatrixDiagonal< MatrixType >::_diagonal
protected

Definition at line 103 of file sparse_block_matrix_diagonal.h.

Referenced by diagonal(), diagonal(), and multiply().


The documentation for this class was generated from the following file: