GTSAM  4.0.2
C++ library for smoothing and mapping (SAM)
Public Types | Public Member Functions | Static Public Member Functions | Protected Member Functions | Protected Attributes | Friends | List of all members
gtsam::VerticalBlockMatrix Class Reference

#include <VerticalBlockMatrix.h>

Public Types

typedef VerticalBlockMatrix This
 
typedef Eigen::Block< Matrix > Block
 
typedef Eigen::Block< const Matrix > constBlock
 

Public Member Functions

 VerticalBlockMatrix ()
 
template<typename CONTAINER >
 VerticalBlockMatrix (const CONTAINER &dimensions, DenseIndex height, bool appendOneDimension=false)
 
template<typename CONTAINER , typename DERIVED >
 VerticalBlockMatrix (const CONTAINER &dimensions, const Eigen::MatrixBase< DERIVED > &matrix, bool appendOneDimension=false)
 
template<typename ITERATOR >
 VerticalBlockMatrix (ITERATOR firstBlockDim, ITERATOR lastBlockDim, DenseIndex height, bool appendOneDimension=false)
 
DenseIndex rows () const
 Row size.
 
DenseIndex cols () const
 Column size.
 
DenseIndex nBlocks () const
 Block count.
 
Block operator() (DenseIndex block)
 
const constBlock operator() (DenseIndex block) const
 
Block range (DenseIndex startBlock, DenseIndex endBlock)
 
const constBlock range (DenseIndex startBlock, DenseIndex endBlock) const
 
Block full ()
 
const constBlock full () const
 
DenseIndex offset (DenseIndex block) const
 
const DenseIndexrowStart () const
 
DenseIndexrowStart ()
 
const DenseIndexrowEnd () const
 
DenseIndexrowEnd ()
 
const DenseIndexfirstBlock () const
 
DenseIndexfirstBlock ()
 
const Matrix & matrix () const
 
Matrix & matrix ()
 

Static Public Member Functions

static VerticalBlockMatrix LikeActiveViewOf (const VerticalBlockMatrix &rhs)
 
static VerticalBlockMatrix LikeActiveViewOf (const SymmetricBlockMatrix &rhs, DenseIndex height)
 

Protected Member Functions

void assertInvariants () const
 
void checkBlock (DenseIndex block) const
 
template<typename ITERATOR >
void fillOffsets (ITERATOR firstBlockDim, ITERATOR lastBlockDim, bool appendOneDimension)
 

Protected Attributes

Matrix matrix_
 The full matrix.
 
FastVector< DenseIndexvariableColOffsets_
 the starting columns of each block (0-based)
 
DenseIndex rowStart_
 Changes apparent matrix view, see main class comment.
 
DenseIndex rowEnd_
 Changes apparent matrix view, see main class comment.
 
DenseIndex blockStart_
 Changes apparent matrix view, see main class comment.
 

Friends

class SymmetricBlockMatrix
 

Detailed Description

This class stores a dense matrix and allows it to be accessed as a collection of vertical blocks. The dimensions of the blocks are provided when constructing this class.

This class also has three parameters that can be changed after construction that change the apparent view of the matrix without any reallocation or data copying. firstBlock() determines the block that has index 0 for all operations (except for re-setting firstBlock()). rowStart() determines the apparent first row of the matrix for all operations (except for setting rowStart() and rowEnd()). rowEnd() determines the apparent exclusive (one-past-the-last) last row for all operations. To include all rows, rowEnd() should be set to the number of rows in the matrix (i.e. one after the last true row index).

Constructor & Destructor Documentation

◆ VerticalBlockMatrix() [1/4]

gtsam::VerticalBlockMatrix::VerticalBlockMatrix ( )
inline

Construct an empty VerticalBlockMatrix

◆ VerticalBlockMatrix() [2/4]

template<typename CONTAINER >
gtsam::VerticalBlockMatrix::VerticalBlockMatrix ( const CONTAINER &  dimensions,
DenseIndex  height,
bool  appendOneDimension = false 
)
inline

Construct from a container of the sizes of each vertical block.

◆ VerticalBlockMatrix() [3/4]

template<typename CONTAINER , typename DERIVED >
gtsam::VerticalBlockMatrix::VerticalBlockMatrix ( const CONTAINER &  dimensions,
const Eigen::MatrixBase< DERIVED > &  matrix,
bool  appendOneDimension = false 
)
inline

Construct from a container of the sizes of each vertical block and a pre-prepared matrix.

◆ VerticalBlockMatrix() [4/4]

template<typename ITERATOR >
gtsam::VerticalBlockMatrix::VerticalBlockMatrix ( ITERATOR  firstBlockDim,
ITERATOR  lastBlockDim,
DenseIndex  height,
bool  appendOneDimension = false 
)
inline

Construct from iterator over the sizes of each vertical block.

Member Function Documentation

◆ firstBlock() [1/2]

const DenseIndex& gtsam::VerticalBlockMatrix::firstBlock ( ) const
inline

Get the apparent first block for all operations

◆ firstBlock() [2/2]

DenseIndex& gtsam::VerticalBlockMatrix::firstBlock ( )
inline

Get or set the apparent first block for all operations

◆ full() [1/2]

Block gtsam::VerticalBlockMatrix::full ( )
inline

Return the full matrix, not including any portions excluded by rowStart(), rowEnd(), and firstBlock()

◆ full() [2/2]

const constBlock gtsam::VerticalBlockMatrix::full ( ) const
inline

Return the full matrix, not including any portions excluded by rowStart(), rowEnd(), and firstBlock()

◆ LikeActiveViewOf() [1/2]

static VerticalBlockMatrix gtsam::VerticalBlockMatrix::LikeActiveViewOf ( const VerticalBlockMatrix rhs)
static

Copy the block structure and resize the underlying matrix, but do not copy the matrix data. If blockStart(), rowStart(), and/or rowEnd() have been modified, this copies the structure of the corresponding matrix view. In the destination VerticalBlockView, blockStart() and rowStart() will thus be 0, rowEnd() will be cols() of the source VerticalBlockView, and the underlying matrix will be the size of the view of the source matrix.

◆ LikeActiveViewOf() [2/2]

static VerticalBlockMatrix gtsam::VerticalBlockMatrix::LikeActiveViewOf ( const SymmetricBlockMatrix rhs,
DenseIndex  height 
)
static

Copy the block structure, but do not copy the matrix data. If blockStart() has been modified, this copies the structure of the corresponding matrix view. In the destination VerticalBlockMatrix, blockStart() will be 0.

◆ matrix() [1/2]

const Matrix& gtsam::VerticalBlockMatrix::matrix ( ) const
inline

Access to full matrix (including any portions excluded by rowStart(), rowEnd(), and firstBlock())

◆ matrix() [2/2]

Matrix& gtsam::VerticalBlockMatrix::matrix ( )
inline

Non-const access to full matrix (including any portions excluded by rowStart(), rowEnd(), and firstBlock())

◆ operator()() [1/2]

Block gtsam::VerticalBlockMatrix::operator() ( DenseIndex  block)
inline

Access a single block in the underlying matrix with read/write access

◆ operator()() [2/2]

const constBlock gtsam::VerticalBlockMatrix::operator() ( DenseIndex  block) const
inline

Access a const block view

◆ range()

Block gtsam::VerticalBlockMatrix::range ( DenseIndex  startBlock,
DenseIndex  endBlock 
)
inline

access ranges of blocks at a time

◆ rowEnd() [1/2]

const DenseIndex& gtsam::VerticalBlockMatrix::rowEnd ( ) const
inline

Get the apparent last row (exclusive, i.e. rows() == rowEnd() - rowStart()) of the underlying matrix for all operations

◆ rowEnd() [2/2]

DenseIndex& gtsam::VerticalBlockMatrix::rowEnd ( )
inline

Get or set the apparent last row (exclusive, i.e. rows() == rowEnd() - rowStart()) of the underlying matrix for all operations

◆ rowStart() [1/2]

const DenseIndex& gtsam::VerticalBlockMatrix::rowStart ( ) const
inline

Get the apparent first row of the underlying matrix for all operations

◆ rowStart() [2/2]

DenseIndex& gtsam::VerticalBlockMatrix::rowStart ( )
inline

Get or set the apparent first row of the underlying matrix for all operations


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