SRBA: Sparser Relative Bundle Adjustment
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends
Public Types | Public Member Functions | Static Public Member Functions
srba::SparseBlockMatrix< Scalar, NROWS, NCOLS, INFO, HAS_REMAP, INDEX_REMAP_MAP_IMPL > Struct Template Reference

Detailed Description

template<typename Scalar, int NROWS, int NCOLS, typename INFO, bool HAS_REMAP, typename INDEX_REMAP_MAP_IMPL = mrpt::utils::map_as_vector<size_t,size_t>>
struct srba::SparseBlockMatrix< Scalar, NROWS, NCOLS, INFO, HAS_REMAP, INDEX_REMAP_MAP_IMPL >

A wrapper of mrpt::math::MatrixBlockSparseCols<> with extended functionality. Refer to the docs of the base class. A templated column-indexed efficient storage of block-sparse Jacobian or Hessian matrices, together with other arbitrary information. Columns are stored in a non-associative container, but the contents of each column are kept within an std::map<> indexed by row. All submatrix blocks have the same size, which allows dense storage of them in fixed-size matrices, avoiding costly memory allocations.

Definition at line 319 of file srba_types.h.

#include <srba_types.h>

Inheritance diagram for srba::SparseBlockMatrix< Scalar, NROWS, NCOLS, INFO, HAS_REMAP, INDEX_REMAP_MAP_IMPL >:
mrpt::math::MatrixBlockSparseCols< Scalar, NROWS, NCOLS, INFO, HAS_REMAP, INDEX_REMAP_MAP_IMPL >

List of all members.

Public Types

typedef
mrpt::math::MatrixBlockSparseCols
< Scalar, NROWS, NCOLS, INFO,
HAS_REMAP,
INDEX_REMAP_MAP_IMPL > 
base_t
typedef Eigen::Matrix< Scalar,
NROWS, NCOLS > 
matrix_t
typedef INFO symbolic_t
typedef
mrpt::aligned_containers
< size_t, TEntry >::map_t 
col_t

Public Member Functions

size_t findRowSpan (size_t *row_min_idx=NULL, size_t *row_max_idx=NULL) const
void getSparsityStats (size_t &nMaxBlocks, size_t &nNonZeroBlocks) const
col_tgetCol (const size_t idx)
const col_tgetCol (const size_t idx) const
const
mrpt::utils::map_as_vector
< size_t, size_t > & 
getColInverseRemappedIndices () const
const std::vector< size_t > & getColRemappedIndices () const
col_tappendCol (const size_t remapIndex)
void setColCount (const size_t nCols)
size_t getColCount () const
void clearColEntries ()
void clearAll ()
void saveToTextFileAsDense (const std::string &filename, const bool force_symmetry=false, const bool is_col_compressed=true) const
void getAsDense (mrpt::math::CMatrixDouble &D, const bool force_symmetry=false, const bool is_col_compressed=true) const
size_t findCurrentNumberOfRows () const
void getBinaryBlocksRepresentation (MATRIX &out) const
void copyNumericalValuesFrom (const MatrixBlockSparseCols< Scalar, NROWS, NCOLS, INFO, HAS_REMAP > &o)

Static Public Member Functions

static size_t findRowSpan (const std::vector< typename base_t::col_t * > &lstColumns, size_t *row_min_idx=NULL, size_t *row_max_idx=NULL)
static void getSparsityStats (const std::vector< typename base_t::col_t * > &lstColumns, size_t &nMaxBlocks, size_t &nNonZeroBlocks)

Member Function Documentation

template<typename Scalar , int NROWS, int NCOLS, typename INFO , bool HAS_REMAP, typename INDEX_REMAP_MAP_IMPL = mrpt::utils::map_as_vector<size_t,size_t>>
size_t srba::SparseBlockMatrix< Scalar, NROWS, NCOLS, INFO, HAS_REMAP, INDEX_REMAP_MAP_IMPL >::findRowSpan ( size_t *  row_min_idx = NULL,
size_t *  row_max_idx = NULL 
) const [inline]

Goes over all the columns and keep the largest span MAX_ROW_INDEX - MIN_ROW_INDEX, the column length

Definition at line 324 of file srba_types.h.

template<typename Scalar , int NROWS, int NCOLS, typename INFO , bool HAS_REMAP, typename INDEX_REMAP_MAP_IMPL = mrpt::utils::map_as_vector<size_t,size_t>>
static size_t srba::SparseBlockMatrix< Scalar, NROWS, NCOLS, INFO, HAS_REMAP, INDEX_REMAP_MAP_IMPL >::findRowSpan ( const std::vector< typename base_t::col_t * > &  lstColumns,
size_t *  row_min_idx = NULL,
size_t *  row_max_idx = NULL 
) [inline, static]

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

Definition at line 342 of file srba_types.h.

template<typename Scalar , int NROWS, int NCOLS, typename INFO , bool HAS_REMAP, typename INDEX_REMAP_MAP_IMPL = mrpt::utils::map_as_vector<size_t,size_t>>
void srba::SparseBlockMatrix< Scalar, NROWS, NCOLS, INFO, HAS_REMAP, INDEX_REMAP_MAP_IMPL >::getSparsityStats ( size_t &  nMaxBlocks,
size_t &  nNonZeroBlocks 
) const [inline]

Returns the number of (symbolically) non-zero blocks, etc.

Parameters:
[out]nMaxBlocksThe maximum number of block matrices fitting in this sparse matrix if it was totally dense
[out]nNonZeroBlocksThe number of non-zero blocks

Definition at line 362 of file srba_types.h.

template<typename Scalar , int NROWS, int NCOLS, typename INFO , bool HAS_REMAP, typename INDEX_REMAP_MAP_IMPL = mrpt::utils::map_as_vector<size_t,size_t>>
static void srba::SparseBlockMatrix< Scalar, NROWS, NCOLS, INFO, HAS_REMAP, INDEX_REMAP_MAP_IMPL >::getSparsityStats ( const std::vector< typename base_t::col_t * > &  lstColumns,
size_t &  nMaxBlocks,
size_t &  nNonZeroBlocks 
) [inline, static]

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

Definition at line 372 of file srba_types.h.


The documentation for this struct was generated from the following file:
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends