Eigen::MatrixBlocks< _allRows, _allCols > Class Template Reference

Collection of indices of matrix blocks. More...

#include <hpp/constraints/matrix-view.hh>

Inheritance diagram for Eigen::MatrixBlocks< _allRows, _allCols >:
[legend]
Collaboration diagram for Eigen::MatrixBlocks< _allRows, _allCols >:
[legend]

Public Member Functions

 MatrixBlocks ()
 Empty constructor. More...
 
 MatrixBlocks (const segments_t &rows, const segments_t &cols)
 Constructor by vectors of segments. More...
 
 MatrixBlocks (const size_type &nbRows, const RowIndices_t &rows, const size_type &nbCols, const ColIndices_t &cols)
 Constructor by vectors of segments. More...
 
 MatrixBlocks (size_type start, size_type size)
 Constructor of single block. More...
 
 MatrixBlocks (const segments_t &idx)
 Constructor by a collection of indices. More...
 
 MatrixBlocks (const segment_t &idx)
 Constructor of a single block. More...
 
template<typename MBDerived >
 MatrixBlocks (const MatrixBlocksBase< MBDerived > &other)
 Copy constructor. More...
 
void clearRows ()
 Clear rows. More...
 
void clearCols ()
 Clear cols. More...
 
void addRow (const size_type &row, const size_type size)
 Add consecutive rows. More...
 
void addCol (const size_type &col, const size_type size)
 Add consecutive columns. More...
 
template<bool Sort, bool Shrink, bool Cardinal>
void updateRows ()
 Selectively recompute set of rows. More...
 
template<bool Sort, bool Shrink, bool Cardinal>
void updateCols ()
 Selectively recompute set of columns. More...
 
const RowIndices_trows () const
 Return row indices. More...
 
const ColIndices_tcols () const
 Return column indices. More...
 
const size_typenbRows () const
 Return number of row indices. More...
 
const size_typenbCols () const
 Return number of column indices. More...
 
template<bool Sort, bool Shrink, bool Cardinal>
void updateIndices ()
 
- Public Member Functions inherited from Eigen::MatrixBlocksBase< MatrixBlocks< _allRows, _allCols > >
MatrixBlocks< _allRows, _allCols >const & derived () const
 
MatrixBlocks< _allRows, _allCols > & derived ()
 
EIGEN_STRONG_INLINE View< MatrixType >::type lview (const MatrixBase< MatrixType > &other) const
 Writable view of the smaller matrix. More...
 
EIGEN_STRONG_INLINE View< const MatrixType >::type rview (const MatrixBase< MatrixType > &other) const
 Non-writable view of the smaller matrix. More...
 
MatrixBlocksRef< AllCols, AllRowstranspose () const
 
MatrixBlocksRef< AllRows, true > keepRows () const
 
MatrixBlocksRef< true, AllColskeepCols () const
 
const segments_tindices () const
 Return row or column indices as a vector of segments. More...
 
const RowIndices_trows () const
 Return row indices. More...
 
const ColIndices_tcols () const
 Return column indices. More...
 
const size_typenbIndices () const
 Return number of row or column indices. More...
 
const size_typenbRows () const
 Return number of row indices. More...
 
const size_typenbCols () const
 Return number of column indices. More...
 
MatrixBlocks< AllRows, AllColsblock (size_type i, size_type j, size_type ni, size_type nj) const
 Extract a block. More...
 
MatrixBlocks< AllRows, AllColsmiddleRows (size_type i, size_type ni) const
 Extract a set of rows. More...
 
MatrixBlocks< AllRows, AllColsmiddleCols (size_type j, size_type nj) const
 Extract a set of cols. More...
 

Public Attributes

size_type m_nbRows
 
size_type m_nbCols
 
RowIndices_t m_rows
 
ColIndices_t m_cols
 

Additional Inherited Members

- Public Types inherited from Eigen::MatrixBlocksBase< MatrixBlocks< _allRows, _allCols > >
enum  
 
typedef hpp::constraints::size_type size_type
 Index of vector or matrix. More...
 
typedef BlockIndex::segment_t segment_t
 Interval of indices [first, first + second - 1]. More...
 
typedef BlockIndex::segments_t segments_t
 vector of segments More...
 
typedef internal::traits< MatrixBlocks< _allRows, _allCols > >::RowIndices_t RowIndices_t
 
typedef internal::traits< MatrixBlocks< _allRows, _allCols > >::ColIndices_t ColIndices_t
 
- Protected Member Functions inherited from Eigen::MatrixBlocksBase< MatrixBlocks< _allRows, _allCols > >
 MatrixBlocksBase ()
 Empty constructor. More...
 
 MatrixBlocksBase (const MatrixBlocksBase &)
 Copy constructor. More...
 

Detailed Description

template<bool _allRows, bool _allCols>
class Eigen::MatrixBlocks< _allRows, _allCols >

Collection of indices of matrix blocks.

Parameters
_allRowswhether the collection is composed of full columns
_allColswhether the collection is composed of full rows

This class enables a user to virtually create a matrix that concatenates blocks of a larger matrix.

The smaller matrix is built by methods lview and rview

  • lview returns a smaller matrix that can be written in,
  • rview returns a smaller matrix that cannot be written in.

Constructor & Destructor Documentation

template<bool _allRows, bool _allCols>
Eigen::MatrixBlocks< _allRows, _allCols >::MatrixBlocks ( )
inline

Empty constructor.

template<bool _allRows, bool _allCols>
Eigen::MatrixBlocks< _allRows, _allCols >::MatrixBlocks ( const segments_t rows,
const segments_t cols 
)
inline

Constructor by vectors of segments.

Parameters
rowsset of row indices,
colsset of column indices,
Warning
rows and cols must be sorted
template<bool _allRows, bool _allCols>
Eigen::MatrixBlocks< _allRows, _allCols >::MatrixBlocks ( const size_type nbRows,
const RowIndices_t rows,
const size_type nbCols,
const ColIndices_t cols 
)
inline

Constructor by vectors of segments.

Parameters
nbRowsnumber of rows,
nbColsnumber of columns,
rowsset of row indices,
colsset of column indices,
Warning
rows and cols must be sorted
template<bool _allRows, bool _allCols>
Eigen::MatrixBlocks< _allRows, _allCols >::MatrixBlocks ( size_type  start,
size_type  size 
)
inline

Constructor of single block.

Parameters
startindice for row and column
sizenumber of indices in the block (row and column)
Note
if all rows or all columns are selected (template parameter) the block will contain all rows, respectively all columns.
template<bool _allRows, bool _allCols>
Eigen::MatrixBlocks< _allRows, _allCols >::MatrixBlocks ( const segments_t idx)
inline

Constructor by a collection of indices.

Parameters
idxcollections of indices (for rows and columns)
Warning
idx must be sorted and shrinked
Note
if all rows or all columns are selected (template parameter) the block will contain all rows, respectively all columns.
template<bool _allRows, bool _allCols>
Eigen::MatrixBlocks< _allRows, _allCols >::MatrixBlocks ( const segment_t idx)
inline

Constructor of a single block.

Parameters
idxsegment of row and column indices
Note
if all rows or all columns are selected (template parameter) the block will contain all rows, respectively all columns.
template<bool _allRows, bool _allCols>
template<typename MBDerived >
Eigen::MatrixBlocks< _allRows, _allCols >::MatrixBlocks ( const MatrixBlocksBase< MBDerived > &  other)
inline

Copy constructor.

Member Function Documentation

template<bool _allRows, bool _allCols>
void Eigen::MatrixBlocks< _allRows, _allCols >::addCol ( const size_type col,
const size_type  size 
)
inline

Add consecutive columns.

Parameters
colfirst column to add
sizenumber of columns to add
template<bool _allRows, bool _allCols>
void Eigen::MatrixBlocks< _allRows, _allCols >::addRow ( const size_type row,
const size_type  size 
)
inline

Add consecutive rows.

Parameters
rowfirst row to add
sizenumber of rows to add
template<bool _allRows, bool _allCols>
void Eigen::MatrixBlocks< _allRows, _allCols >::clearCols ( )
inline

Clear cols.

template<bool _allRows, bool _allCols>
void Eigen::MatrixBlocks< _allRows, _allCols >::clearRows ( )
inline

Clear rows.

template<bool _allRows, bool _allCols>
const ColIndices_t& Eigen::MatrixBlocks< _allRows, _allCols >::cols ( ) const
inline

Return column indices.

Warning
_allCols should be false
template<bool _allRows, bool _allCols>
const size_type& Eigen::MatrixBlocks< _allRows, _allCols >::nbCols ( ) const
inline

Return number of column indices.

Warning
_allCols should be false
template<bool _allRows, bool _allCols>
const size_type& Eigen::MatrixBlocks< _allRows, _allCols >::nbRows ( ) const
inline

Return number of row indices.

Warning
_allRows should be false
template<bool _allRows, bool _allCols>
const RowIndices_t& Eigen::MatrixBlocks< _allRows, _allCols >::rows ( ) const
inline

Return row indices.

Warning
_allRows should be false
template<bool _allRows, bool _allCols>
template<bool Sort, bool Shrink, bool Cardinal>
void Eigen::MatrixBlocks< _allRows, _allCols >::updateCols ( )
inline

Selectively recompute set of columns.

Template Parameters
Sortwhether set of columns should be sorted,
Shrinkwhether set of columns should be shrunk,
Cardinalwhether number of columns should be recomputed
template<bool _allRows, bool _allCols>
template<bool Sort, bool Shrink, bool Cardinal>
void Eigen::MatrixBlocks< _allRows, _allCols >::updateIndices ( )
inline
template<bool _allRows, bool _allCols>
template<bool Sort, bool Shrink, bool Cardinal>
void Eigen::MatrixBlocks< _allRows, _allCols >::updateRows ( )
inline

Selectively recompute set of rows.

Template Parameters
Sortwhether set of rows should be sorted,
Shrinkwhether set of rows should be shrunk,
Cardinalwhether number of rows should be recomputed

Member Data Documentation

template<bool _allRows, bool _allCols>
ColIndices_t Eigen::MatrixBlocks< _allRows, _allCols >::m_cols
template<bool _allRows, bool _allCols>
size_type Eigen::MatrixBlocks< _allRows, _allCols >::m_nbCols
template<bool _allRows, bool _allCols>
size_type Eigen::MatrixBlocks< _allRows, _allCols >::m_nbRows
template<bool _allRows, bool _allCols>
RowIndices_t Eigen::MatrixBlocks< _allRows, _allCols >::m_rows