aligator  0.16.0
A versatile and efficient C++ library for real-time constrained trajectory optimization.
Loading...
Searching...
No Matches
aligator::BlkMatrix< _MatrixType, _N, _M > Class Template Reference

Block matrix class, with a fixed or dynamic-size number of row and column blocks. More...

#include <aligator/gar/blk-matrix.hpp>

Public Types

enum  { N = _N , M = _M , Options = PlainObject::Options }
 
using MatrixType = _MatrixType
 
using PlainObject = typename MatrixType::PlainObject
 
using Scalar = typename MatrixType::Scalar
 
using Index = Eigen::Index
 
using RowDimsType
 
using ColDimsType
 

Public Member Functions

 BlkMatrix ()
 
 BlkMatrix (const RowDimsType &rowDims, const ColDimsType &colDims)
 
template<typename Other>
 BlkMatrix (const Eigen::MatrixBase< Other > &data, const RowDimsType &rowDims, const ColDimsType &colDims)
 
template<typename Other>
 BlkMatrix (Eigen::MatrixBase< Other > &data, const RowDimsType &rowDims, const ColDimsType &colDims)
 
template<typename Other>
 BlkMatrix (const Eigen::MatrixBase< Other > &data, const RowDimsType &dims)
 Only-rows constructor (only for vectors)
 
template<typename Other>
 BlkMatrix (Eigen::MatrixBase< Other > &data, const RowDimsType &dims)
 Only-rows constructor (only for vectors)
 
 operator Eigen::Ref< PlainObject > ()
 
 operator Eigen::Ref< const PlainObject > () const
 
 BlkMatrix (const RowDimsType &dims)
 Only-rows constructor (only for vectors)
 
auto operator() (size_t i, size_t j)
 Get the block in position ( i, j )
 
auto operator() (size_t i, size_t j) const
 
auto blockRow (size_t i)
 
auto blockRow (size_t i) const
 
auto blockCol (size_t j) const
 
auto blockCol (size_t j)
 
auto blockSegment (size_t i)
 
auto blockSegment (size_t i) const
 
auto operator[] (size_t i)
 
auto operator[] (size_t i) const
 
template<typename Other>
BlkMatrixoperator= (const Eigen::MatrixBase< Other > &other)
 Set the data to be equal to some other Eigen object.
 
void setZero ()
 
template<typename Other>
void swap (BlkMatrix< Other, N, M > &other)
 
MatrixTypematrix ()
 
const MatrixTypematrix () const
 
const RowDimsTyperowDims () const
 
const RowDimsTyperowIndices () const
 
const ColDimsTypecolDims () const
 
const ColDimsTypecolIndices () const
 
Index rows () const
 
Index cols () const
 
auto topBlkRows (size_t n)
 
template<size_t n>
auto topBlkRows ()
 

Static Public Member Functions

static BlkMatrix Zero (const RowDimsType &rowDims, const ColDimsType &colDims)
 

Static Public Attributes

static constexpr bool IsVectorAtCompileTime
 

Protected Member Functions

void initialize ()
 

Protected Attributes

MatrixType m_data
 
RowDimsType m_rowDims
 
ColDimsType m_colDims
 
RowDimsType m_rowIndices
 
ColDimsType m_colIndices
 
Index m_totalRows
 
Index m_totalCols
 

Friends

std::ostream & operator<< (std::ostream &oss, const BlkMatrix &self)
 

Detailed Description

template<typename _MatrixType, int _N, int _M>
class aligator::BlkMatrix< _MatrixType, _N, _M >

Block matrix class, with a fixed or dynamic-size number of row and column blocks.

Template Parameters
Baselinematrix type; the user can use an Eigen::Ref type to create a blocked view to an existing matrix.
Nnumber of block rows.
Mnumber of block columns.

Definition at line 19 of file blk-matrix.hpp.

Member Typedef Documentation

◆ MatrixType

template<typename _MatrixType, int _N, int _M>
using aligator::BlkMatrix< _MatrixType, _N, _M >::MatrixType = _MatrixType

Definition at line 21 of file blk-matrix.hpp.

◆ PlainObject

template<typename _MatrixType, int _N, int _M>
using aligator::BlkMatrix< _MatrixType, _N, _M >::PlainObject = typename MatrixType::PlainObject

Definition at line 22 of file blk-matrix.hpp.

◆ Scalar

template<typename _MatrixType, int _N, int _M>
using aligator::BlkMatrix< _MatrixType, _N, _M >::Scalar = typename MatrixType::Scalar

Definition at line 23 of file blk-matrix.hpp.

◆ Index

template<typename _MatrixType, int _N, int _M>
using aligator::BlkMatrix< _MatrixType, _N, _M >::Index = Eigen::Index

Definition at line 24 of file blk-matrix.hpp.

◆ RowDimsType

template<typename _MatrixType, int _N, int _M>
using aligator::BlkMatrix< _MatrixType, _N, _M >::RowDimsType
Initial value:
std::conditional_t<N != -1, std::array<Index, size_t(N)>,
std::vector<Index>>
Eigen::Index Index

Definition at line 29 of file blk-matrix.hpp.

◆ ColDimsType

template<typename _MatrixType, int _N, int _M>
using aligator::BlkMatrix< _MatrixType, _N, _M >::ColDimsType
Initial value:
std::conditional_t<M != -1, std::array<Index, size_t(M)>,
std::vector<Index>>

Definition at line 31 of file blk-matrix.hpp.

Member Enumeration Documentation

◆ anonymous enum

template<typename _MatrixType, int _N, int _M>
anonymous enum
Enumerator
Options 

Definition at line 25 of file blk-matrix.hpp.

Constructor & Destructor Documentation

◆ BlkMatrix() [1/7]

template<typename _MatrixType, int _N, int _M>
aligator::BlkMatrix< _MatrixType, _N, _M >::BlkMatrix ( )
inline

Definition at line 41 of file blk-matrix.hpp.

◆ BlkMatrix() [2/7]

template<typename _MatrixType, int _N, int _M>
aligator::BlkMatrix< _MatrixType, _N, _M >::BlkMatrix ( const RowDimsType & rowDims,
const ColDimsType & colDims )
inline

Definition at line 50 of file blk-matrix.hpp.

◆ BlkMatrix() [3/7]

template<typename _MatrixType, int _N, int _M>
template<typename Other>
aligator::BlkMatrix< _MatrixType, _N, _M >::BlkMatrix ( const Eigen::MatrixBase< Other > & data,
const RowDimsType & rowDims,
const ColDimsType & colDims )
inline

Definition at line 62 of file blk-matrix.hpp.

◆ BlkMatrix() [4/7]

template<typename _MatrixType, int _N, int _M>
template<typename Other>
aligator::BlkMatrix< _MatrixType, _N, _M >::BlkMatrix ( Eigen::MatrixBase< Other > & data,
const RowDimsType & rowDims,
const ColDimsType & colDims )
inline

Definition at line 75 of file blk-matrix.hpp.

◆ BlkMatrix() [5/7]

template<typename _MatrixType, int _N, int _M>
template<typename Other>
aligator::BlkMatrix< _MatrixType, _N, _M >::BlkMatrix ( const Eigen::MatrixBase< Other > & data,
const RowDimsType & dims )
inline

Only-rows constructor (only for vectors)

Definition at line 89 of file blk-matrix.hpp.

◆ BlkMatrix() [6/7]

template<typename _MatrixType, int _N, int _M>
template<typename Other>
aligator::BlkMatrix< _MatrixType, _N, _M >::BlkMatrix ( Eigen::MatrixBase< Other > & data,
const RowDimsType & dims )
inline

Only-rows constructor (only for vectors)

Definition at line 94 of file blk-matrix.hpp.

◆ BlkMatrix() [7/7]

template<typename _MatrixType, int _N, int _M>
aligator::BlkMatrix< _MatrixType, _N, _M >::BlkMatrix ( const RowDimsType & dims)
inlineexplicit

Only-rows constructor (only for vectors)

Definition at line 101 of file blk-matrix.hpp.

Member Function Documentation

◆ operator Eigen::Ref< PlainObject >()

template<typename _MatrixType, int _N, int _M>
aligator::BlkMatrix< _MatrixType, _N, _M >::operator Eigen::Ref< PlainObject > ( )
inline

Definition at line 97 of file blk-matrix.hpp.

◆ operator Eigen::Ref< const PlainObject >()

template<typename _MatrixType, int _N, int _M>
aligator::BlkMatrix< _MatrixType, _N, _M >::operator Eigen::Ref< const PlainObject > ( ) const
inline

Definition at line 98 of file blk-matrix.hpp.

◆ operator()() [1/2]

template<typename _MatrixType, int _N, int _M>
auto aligator::BlkMatrix< _MatrixType, _N, _M >::operator() ( size_t i,
size_t j )
inline

Get the block in position ( i, j )

Definition at line 108 of file blk-matrix.hpp.

◆ operator()() [2/2]

template<typename _MatrixType, int _N, int _M>
auto aligator::BlkMatrix< _MatrixType, _N, _M >::operator() ( size_t i,
size_t j ) const
inline

Definition at line 114 of file blk-matrix.hpp.

◆ blockRow() [1/2]

template<typename _MatrixType, int _N, int _M>
auto aligator::BlkMatrix< _MatrixType, _N, _M >::blockRow ( size_t i)
inline

Definition at line 119 of file blk-matrix.hpp.

◆ blockRow() [2/2]

template<typename _MatrixType, int _N, int _M>
auto aligator::BlkMatrix< _MatrixType, _N, _M >::blockRow ( size_t i) const
inline

Definition at line 123 of file blk-matrix.hpp.

◆ blockCol() [1/2]

template<typename _MatrixType, int _N, int _M>
auto aligator::BlkMatrix< _MatrixType, _N, _M >::blockCol ( size_t j) const
inline

Definition at line 127 of file blk-matrix.hpp.

◆ blockCol() [2/2]

template<typename _MatrixType, int _N, int _M>
auto aligator::BlkMatrix< _MatrixType, _N, _M >::blockCol ( size_t j)
inline

Definition at line 131 of file blk-matrix.hpp.

◆ blockSegment() [1/2]

template<typename _MatrixType, int _N, int _M>
auto aligator::BlkMatrix< _MatrixType, _N, _M >::blockSegment ( size_t i)
inline

Definition at line 135 of file blk-matrix.hpp.

◆ blockSegment() [2/2]

template<typename _MatrixType, int _N, int _M>
auto aligator::BlkMatrix< _MatrixType, _N, _M >::blockSegment ( size_t i) const
inline

Definition at line 140 of file blk-matrix.hpp.

◆ operator[]() [1/2]

template<typename _MatrixType, int _N, int _M>
auto aligator::BlkMatrix< _MatrixType, _N, _M >::operator[] ( size_t i)
inline

Definition at line 145 of file blk-matrix.hpp.

◆ operator[]() [2/2]

template<typename _MatrixType, int _N, int _M>
auto aligator::BlkMatrix< _MatrixType, _N, _M >::operator[] ( size_t i) const
inline

Definition at line 147 of file blk-matrix.hpp.

◆ operator=()

template<typename _MatrixType, int _N, int _M>
template<typename Other>
BlkMatrix & aligator::BlkMatrix< _MatrixType, _N, _M >::operator= ( const Eigen::MatrixBase< Other > & other)
inline

Set the data to be equal to some other Eigen object.

Definition at line 151 of file blk-matrix.hpp.

◆ setZero()

template<typename _MatrixType, int _N, int _M>
void aligator::BlkMatrix< _MatrixType, _N, _M >::setZero ( )
inline

Definition at line 158 of file blk-matrix.hpp.

◆ Zero()

template<typename _MatrixType, int _N, int _M>
static BlkMatrix aligator::BlkMatrix< _MatrixType, _N, _M >::Zero ( const RowDimsType & rowDims,
const ColDimsType & colDims )
inlinestatic

Definition at line 159 of file blk-matrix.hpp.

◆ swap()

template<typename _MatrixType, int _N, int _M>
template<typename Other>
void aligator::BlkMatrix< _MatrixType, _N, _M >::swap ( BlkMatrix< Other, N, M > & other)
inline

Definition at line 167 of file blk-matrix.hpp.

◆ matrix() [1/2]

template<typename _MatrixType, int _N, int _M>
MatrixType & aligator::BlkMatrix< _MatrixType, _N, _M >::matrix ( )
inline

Definition at line 171 of file blk-matrix.hpp.

◆ matrix() [2/2]

template<typename _MatrixType, int _N, int _M>
const MatrixType & aligator::BlkMatrix< _MatrixType, _N, _M >::matrix ( ) const
inline

Definition at line 172 of file blk-matrix.hpp.

◆ rowDims()

template<typename _MatrixType, int _N, int _M>
const RowDimsType & aligator::BlkMatrix< _MatrixType, _N, _M >::rowDims ( ) const
inline

Definition at line 174 of file blk-matrix.hpp.

◆ rowIndices()

template<typename _MatrixType, int _N, int _M>
const RowDimsType & aligator::BlkMatrix< _MatrixType, _N, _M >::rowIndices ( ) const
inline

Definition at line 175 of file blk-matrix.hpp.

◆ colDims()

template<typename _MatrixType, int _N, int _M>
const ColDimsType & aligator::BlkMatrix< _MatrixType, _N, _M >::colDims ( ) const
inline

Definition at line 176 of file blk-matrix.hpp.

◆ colIndices()

template<typename _MatrixType, int _N, int _M>
const ColDimsType & aligator::BlkMatrix< _MatrixType, _N, _M >::colIndices ( ) const
inline

Definition at line 177 of file blk-matrix.hpp.

◆ rows()

template<typename _MatrixType, int _N, int _M>
Index aligator::BlkMatrix< _MatrixType, _N, _M >::rows ( ) const
inline

Definition at line 179 of file blk-matrix.hpp.

◆ cols()

template<typename _MatrixType, int _N, int _M>
Index aligator::BlkMatrix< _MatrixType, _N, _M >::cols ( ) const
inline

Definition at line 180 of file blk-matrix.hpp.

◆ topBlkRows() [1/2]

template<typename _MatrixType, int _N, int _M>
auto aligator::BlkMatrix< _MatrixType, _N, _M >::topBlkRows ( size_t n)
inline

Definition at line 182 of file blk-matrix.hpp.

◆ topBlkRows() [2/2]

template<typename _MatrixType, int _N, int _M>
template<size_t n>
auto aligator::BlkMatrix< _MatrixType, _N, _M >::topBlkRows ( )
inline

Definition at line 191 of file blk-matrix.hpp.

◆ initialize()

template<typename _MatrixType, int _N, int _M>
void aligator::BlkMatrix< _MatrixType, _N, _M >::initialize ( )
inlineprotected

Definition at line 215 of file blk-matrix.hpp.

Friends And Related Symbol Documentation

◆ operator<<

template<typename _MatrixType, int _N, int _M>
std::ostream & operator<< ( std::ostream & oss,
const BlkMatrix< _MatrixType, _N, _M > & self )
friend

Definition at line 202 of file blk-matrix.hpp.

Member Data Documentation

◆ IsVectorAtCompileTime

template<typename _MatrixType, int _N, int _M>
bool aligator::BlkMatrix< _MatrixType, _N, _M >::IsVectorAtCompileTime
staticconstexpr
Initial value:
=
MatrixType::IsVectorAtCompileTime

Definition at line 26 of file blk-matrix.hpp.

◆ m_data

template<typename _MatrixType, int _N, int _M>
MatrixType aligator::BlkMatrix< _MatrixType, _N, _M >::m_data
protected

Definition at line 207 of file blk-matrix.hpp.

◆ m_rowDims

template<typename _MatrixType, int _N, int _M>
RowDimsType aligator::BlkMatrix< _MatrixType, _N, _M >::m_rowDims
protected

Definition at line 208 of file blk-matrix.hpp.

◆ m_colDims

template<typename _MatrixType, int _N, int _M>
ColDimsType aligator::BlkMatrix< _MatrixType, _N, _M >::m_colDims
protected

Definition at line 209 of file blk-matrix.hpp.

◆ m_rowIndices

template<typename _MatrixType, int _N, int _M>
RowDimsType aligator::BlkMatrix< _MatrixType, _N, _M >::m_rowIndices
protected

Definition at line 210 of file blk-matrix.hpp.

◆ m_colIndices

template<typename _MatrixType, int _N, int _M>
ColDimsType aligator::BlkMatrix< _MatrixType, _N, _M >::m_colIndices
protected

Definition at line 211 of file blk-matrix.hpp.

◆ m_totalRows

template<typename _MatrixType, int _N, int _M>
Index aligator::BlkMatrix< _MatrixType, _N, _M >::m_totalRows
protected

Definition at line 212 of file blk-matrix.hpp.

◆ m_totalCols

template<typename _MatrixType, int _N, int _M>
Index aligator::BlkMatrix< _MatrixType, _N, _M >::m_totalCols
protected

Definition at line 213 of file blk-matrix.hpp.


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