0.2.0
Loading...
Searching...
No Matches
NAV::KeyedMatrix< Scalar, RowKeyType, ColKeyType, Rows, Cols > Class Template Reference

Static sized KeyedMatrix. More...

Public Member Functions

KeyedMatrix< Scalar, RowKeyType, ColKeyType, Eigen::Dynamic, Eigen::Dynamic > getSubMatrix (const std::vector< RowKeyType > &rowKeys, const std::vector< ColKeyType > &colKeys) const
 Returns a submatrix specified by the row and col keys.
 
KeyedMatrix< Scalar, RowKeyType, ColKeyType, Rows, Cols > inverse () const
 Calculates the inverse matrix.
 
template<typename Derived >
 KeyedMatrix (const Eigen::MatrixBase< Derived > &matrix, const std::vector< RowKeyType > &keys)
 Symmetric matrix constructor.
 
template<typename Derived >
 KeyedMatrix (const Eigen::MatrixBase< Derived > &matrix, const std::vector< RowKeyType > &rowKeys, const std::vector< ColKeyType > &colKeys)
 Non-symmetric matrix constructor.
 
 KeyedMatrix (const KeyedMatrix &other)
 Copy constructor.
 
 KeyedMatrix (const KeyedMatrix< Scalar, RowKeyType, ColKeyType, Eigen::Dynamic, Eigen::Dynamic > &other)
 Copy constructor.
 
 KeyedMatrix (KeyedMatrix &&other) noexcept
 Move constructor.
 
 KeyedMatrix (KeyedMatrix< Scalar, RowKeyType, ColKeyType, Eigen::Dynamic, Eigen::Dynamic > &&other) noexcept
 Move constructor.
 
KeyedMatrixoperator= (const KeyedMatrix &other)
 Copy assignment operator.
 
KeyedMatrixoperator= (const KeyedMatrix< Scalar, RowKeyType, ColKeyType, Eigen::Dynamic, Eigen::Dynamic > &other)
 Copy assignment operator.
 
KeyedMatrixoperator= (KeyedMatrix &&other) noexcept
 Move assignment operator.
 
KeyedMatrixoperator= (KeyedMatrix< Scalar, RowKeyType, ColKeyType, Eigen::Dynamic, Eigen::Dynamic > &&other) noexcept
 Move assignment operator.
 
KeyedMatrix< Scalar, RowKeyType, ColKeyType, Rows, Cols > transposed () const
 Calculates the transposed matrix.
 
 ~KeyedMatrix ()=default
 Destructor.
 
- Public Member Functions inherited from NAV::internal::KeyedMatrixBase< Scalar, RowKeyType, ColKeyType, Rows, Cols >
Eigen::Matrix< Scalar, Rows, Cols > & block (all_t, all_t)
 Requests the full matrix.
 
const Eigen::Matrix< Scalar, Rows, Cols > & block (all_t, all_t) const
 Requests the full matrix.
 
template<size_t Q>
decltype(auto) block (const RowKeyType &rowKey, const std::vector< ColKeyType > &colKeys)
 Gets the values for the row and col keys.
 
decltype(auto) block (const RowKeyType &rowKey, const std::vector< ColKeyType > &colKeys)
 Gets the values for the row and col keys.
 
template<size_t Q>
decltype(auto) block (const RowKeyType &rowKey, const std::vector< ColKeyType > &colKeys) const
 Gets the values for the row and col keys.
 
decltype(auto) block (const RowKeyType &rowKey, const std::vector< ColKeyType > &colKeys) const
 Gets the values for the row and col keys.
 
template<size_t P>
decltype(auto) block (const std::vector< RowKeyType > &rowKeys, const ColKeyType &colKey)
 Gets the values for the row and col keys.
 
decltype(auto) block (const std::vector< RowKeyType > &rowKeys, const ColKeyType &colKey)
 Gets the values for the row and col keys.
 
template<size_t P>
decltype(auto) block (const std::vector< RowKeyType > &rowKeys, const ColKeyType &colKey) const
 Gets the values for the row and col keys.
 
decltype(auto) block (const std::vector< RowKeyType > &rowKeys, const ColKeyType &colKey) const
 Gets the values for the row and col keys.
 
template<size_t P, size_t Q = P>
decltype(auto) block (const std::vector< RowKeyType > &rowKeys, const std::vector< ColKeyType > &colKeys)
 Gets the values for the row and col keys.
 
decltype(auto) block (const std::vector< RowKeyType > &rowKeys, const std::vector< ColKeyType > &colKeys)
 Gets the values for the row and col keys.
 
template<size_t P, size_t Q = P>
decltype(auto) block (const std::vector< RowKeyType > &rowKeys, const std::vector< ColKeyType > &colKeys) const
 Gets the values for the row and col keys.
 
decltype(auto) block (const std::vector< RowKeyType > &rowKeys, const std::vector< ColKeyType > &colKeys) const
 Gets the values for the row and col keys.
 
decltype(auto) col (const ColKeyType &colKey)
 Gets the values for the col key.
 
decltype(auto) col (const ColKeyType &colKey) const
 Gets the values for the col key.
 
KeyedMatrixBase< Scalar, RowKeyType, ColKeyType, Rows, Cols > inverse () const
 Calculates the inverse matrix.
 
template<typename Derived >
 KeyedMatrixBase (const Eigen::MatrixBase< Derived > &matrix)
 Constructor.
 
template<typename Derived >
 KeyedMatrixBase (const Eigen::MatrixBase< Derived > &matrix, const std::vector< RowKeyType > &rowKeys, const std::vector< ColKeyType > &colKeys)
 Non-symmetric matrix constructor.
 
 KeyedMatrixBase (const KeyedMatrixBase &other)
 Copy constructor.
 
template<int oRows, int oCols>
 KeyedMatrixBase (const KeyedMatrixBase< Scalar, RowKeyType, ColKeyType, oRows, oCols > &other)
 Copy constructor.
 
 KeyedMatrixBase (KeyedMatrixBase &&other) noexcept
 Move constructor.
 
template<int oRows, int oCols>
 KeyedMatrixBase (KeyedMatrixBase< Scalar, RowKeyType, ColKeyType, oRows, oCols > &&other) noexcept
 Move constructor.
 
template<size_t Q>
decltype(auto) middleCols (const std::vector< ColKeyType > &colKeys)
 Gets the values for the col keys.
 
decltype(auto) middleCols (const std::vector< ColKeyType > &colKeys)
 Gets the values for the col keys.
 
template<size_t Q>
decltype(auto) middleCols (const std::vector< ColKeyType > &colKeys) const
 Gets the values for the col keys.
 
decltype(auto) middleCols (const std::vector< ColKeyType > &colKeys) const
 Gets the values for the col keys.
 
template<size_t P>
decltype(auto) middleRows (const std::vector< RowKeyType > &rowKeys)
 Gets the values for the row keys.
 
decltype(auto) middleRows (const std::vector< RowKeyType > &rowKeys)
 Gets the values for the row keys.
 
template<size_t P>
decltype(auto) middleRows (const std::vector< RowKeyType > &rowKeys) const
 Gets the values for the row keys.
 
decltype(auto) middleRows (const std::vector< RowKeyType > &rowKeys) const
 Gets the values for the row keys.
 
 operator Eigen::Matrix< Scalar, Rows, Cols > ()
 Conversion into Eigen::Matrix.
 
Eigen::Matrix< Scalar, Rows, Cols > & operator() (all_t, all_t)
 Requests the full matrix.
 
const Eigen::Matrix< Scalar, Rows, Cols > & operator() (all_t, all_t) const
 Requests the full matrix.
 
decltype(auto) operator() (all_t, const ColKeyType &colKey)
 Gets the values for the col keys.
 
decltype(auto) operator() (all_t, const ColKeyType &colKey) const
 Gets the values for the col key.
 
decltype(auto) operator() (all_t, const std::vector< ColKeyType > &colKeys)
 Gets the values for the col keys.
 
decltype(auto) operator() (all_t, const std::vector< ColKeyType > &colKeys) const
 Gets the values for the col keys.
 
decltype(auto) operator() (const RowKeyType &rowKey, all_t)
 Gets the values for the row key.
 
decltype(auto) operator() (const RowKeyType &rowKey, all_t) const
 Gets the values for the row key.
 
Scalar & operator() (const RowKeyType &rowKey, const ColKeyType &colKey)
 Gets the value for the row and col key.
 
const Scalar & operator() (const RowKeyType &rowKey, const ColKeyType &colKey) const
 Gets the value for the row and col key.
 
decltype(auto) operator() (const RowKeyType &rowKey, const std::vector< ColKeyType > &colKeys)
 Gets the values for the row and col keys.
 
decltype(auto) operator() (const RowKeyType &rowKey, const std::vector< ColKeyType > &colKeys) const
 Gets the values for the row and col keys.
 
decltype(auto) operator() (const std::vector< RowKeyType > &rowKeys, all_t)
 Gets the values for the row keys.
 
decltype(auto) operator() (const std::vector< RowKeyType > &rowKeys, all_t) const
 Gets the values for the row keys.
 
decltype(auto) operator() (const std::vector< RowKeyType > &rowKeys, const ColKeyType &colKey)
 Gets the values for the row and col keys.
 
decltype(auto) operator() (const std::vector< RowKeyType > &rowKeys, const ColKeyType &colKey) const
 Gets the values for the row and col keys.
 
decltype(auto) operator() (const std::vector< RowKeyType > &rowKeys, const std::vector< ColKeyType > &colKeys)
 Gets the values for the row and col keys.
 
decltype(auto) operator() (const std::vector< RowKeyType > &rowKeys, const std::vector< ColKeyType > &colKeys) const
 Gets the values for the row and col keys.
 
KeyedMatrixBaseoperator= (const KeyedMatrixBase &other)
 Copy assignment operator.
 
template<int oRows, int oCols>
KeyedMatrixBaseoperator= (const KeyedMatrixBase< Scalar, RowKeyType, ColKeyType, oRows, oCols > &other)
 Copy assignment operator.
 
KeyedMatrixBaseoperator= (KeyedMatrixBase &&other) noexcept
 Move assignment operator.
 
template<int oRows, int oCols>
KeyedMatrixBaseoperator= (KeyedMatrixBase< Scalar, RowKeyType, ColKeyType, oRows, oCols > &&other) noexcept
 Move assignment operator.
 
decltype(auto) row (const RowKeyType &rowKey)
 Gets the values for the row key.
 
decltype(auto) row (const RowKeyType &rowKey) const
 Gets the values for the row key.
 
KeyedMatrixBase< Scalar, ColKeyType, RowKeyType, Cols, Rows > transposed () const
 Calculates the transposed matrix.
 
 ~KeyedMatrixBase ()=default
 Destructor.
 
- Public Member Functions inherited from NAV::internal::KeyedMatrixRowsBase< Scalar, RowKeyType, Rows, Cols >
bool hasAnyRows (const std::vector< RowKeyType > &keys) const
 Checks if the matrix has any key.
 
bool hasRow (const RowKeyType &key) const
 Checks if the matrix has the key.
 
bool hasRows (const std::vector< RowKeyType > &keys) const
 Checks if the matrix has multiple keys.
 
void replaceRowKey (const RowKeyType &oldKey, const RowKeyType &newKey)
 Replace the old with the new key.
 
const std::vector< RowKeyType > & rowKeys () const
 Returns the row keys.
 
decltype(auto) rows () const
 Return the rows of the underlying Eigen matrix.
 
- Public Member Functions inherited from NAV::internal::KeyedMatrixColsBase< Scalar, ColKeyType, Rows, Cols >
const std::vector< ColKeyType > & colKeys () const
 Returns the col keys.
 
decltype(auto) cols () const
 Return the cols of the underlying Eigen matrix.
 
bool hasAnyCols (const std::vector< ColKeyType > &keys) const
 Checks if the matrix has any keys.
 
bool hasCol (const ColKeyType &key) const
 Checks if the matrix has the key.
 
bool hasCols (const std::vector< ColKeyType > &keys) const
 Checks if the matrix has multiple keys.
 
void replaceColKey (const ColKeyType &oldKey, const ColKeyType &newKey)
 Replace the old with the new key.
 

Additional Inherited Members

- Protected Attributes inherited from NAV::internal::KeyedMatrixRowsBase< Scalar, RowKeyType, Rows, Cols >
unordered_map< RowKeyType, Eigen::Index > rowIndices
 RowKey to Row Index mapping.
 
std::vector< RowKeyType > rowKeysVector
 Row Keys.
 
std::vector< Eigen::Index > rowSlice
 Row Slice used for accessing.
 
- Protected Attributes inherited from NAV::internal::KeyedMatrixStorage< Scalar, Rows, Cols >
Eigen::Matrix< Scalar, Rows, Cols > matrix
 Data storage of the type.
 
- Protected Attributes inherited from NAV::internal::KeyedMatrixColsBase< Scalar, ColKeyType, Rows, Cols >
unordered_map< ColKeyType, Eigen::Index > colIndices
 ColKey to Col Index mapping.
 
std::vector< ColKeyType > colKeysVector
 Col Keys.
 
std::vector< Eigen::Index > colSlice
 Col Slice used for accessing.
 

Detailed Description

template<typename Scalar, typename RowKeyType, typename ColKeyType, int Rows, int Cols>
class NAV::KeyedMatrix< Scalar, RowKeyType, ColKeyType, Rows, Cols >

Static sized KeyedMatrix.

Template Parameters
ScalarNumeric type, e.g. float, double, int or std::complex<float>.
RowKeyTypeType of the key used for row lookup
ColKeyTypeType of the key used for col lookup
RowsNumber of rows, or Dynamic
ColsNumber of columns, or Dynamic

Constructor & Destructor Documentation

◆ KeyedMatrix() [1/6]

template<typename Scalar , typename RowKeyType , typename ColKeyType , int Rows, int Cols>
template<typename Derived >
NAV::KeyedMatrix< Scalar, RowKeyType, ColKeyType, Rows, Cols >::KeyedMatrix ( const Eigen::MatrixBase< Derived > & matrix,
const std::vector< RowKeyType > & rowKeys,
const std::vector< ColKeyType > & colKeys )
inline

Non-symmetric matrix constructor.

Template Parameters
DerivedDerived Eigen Type
Parameters
matrixEigen matrix to initialize from
rowKeysRow keys describing the matrix
colKeysCol keys describing the matrix

◆ KeyedMatrix() [2/6]

template<typename Scalar , typename RowKeyType , typename ColKeyType , int Rows, int Cols>
template<typename Derived >
NAV::KeyedMatrix< Scalar, RowKeyType, ColKeyType, Rows, Cols >::KeyedMatrix ( const Eigen::MatrixBase< Derived > & matrix,
const std::vector< RowKeyType > & keys )
inline

Symmetric matrix constructor.

Template Parameters
DerivedDerived Eigen Type
Parameters
matrixEigen matrix to initialize from
keysRow and col keys describing the matrix

◆ KeyedMatrix() [3/6]

template<typename Scalar , typename RowKeyType , typename ColKeyType , int Rows, int Cols>
NAV::KeyedMatrix< Scalar, RowKeyType, ColKeyType, Rows, Cols >::KeyedMatrix ( const KeyedMatrix< Scalar, RowKeyType, ColKeyType, Rows, Cols > & other)
inline

Copy constructor.

Parameters
otherThe other object

◆ KeyedMatrix() [4/6]

template<typename Scalar , typename RowKeyType , typename ColKeyType , int Rows, int Cols>
NAV::KeyedMatrix< Scalar, RowKeyType, ColKeyType, Rows, Cols >::KeyedMatrix ( KeyedMatrix< Scalar, RowKeyType, ColKeyType, Rows, Cols > && other)
inlinenoexcept

Move constructor.

Parameters
otherThe other object

◆ KeyedMatrix() [5/6]

template<typename Scalar , typename RowKeyType , typename ColKeyType , int Rows, int Cols>
NAV::KeyedMatrix< Scalar, RowKeyType, ColKeyType, Rows, Cols >::KeyedMatrix ( const KeyedMatrix< Scalar, RowKeyType, ColKeyType, Eigen::Dynamic, Eigen::Dynamic > & other)
inline

Copy constructor.

Parameters
otherThe other object

◆ KeyedMatrix() [6/6]

template<typename Scalar , typename RowKeyType , typename ColKeyType , int Rows, int Cols>
NAV::KeyedMatrix< Scalar, RowKeyType, ColKeyType, Rows, Cols >::KeyedMatrix ( KeyedMatrix< Scalar, RowKeyType, ColKeyType, Eigen::Dynamic, Eigen::Dynamic > && other)
inlinenoexcept

Move constructor.

Parameters
otherThe other object

Member Function Documentation

◆ getSubMatrix()

template<typename Scalar , typename RowKeyType , typename ColKeyType , int Rows, int Cols>
KeyedMatrix< Scalar, RowKeyType, ColKeyType, Eigen::Dynamic, Eigen::Dynamic > NAV::KeyedMatrix< Scalar, RowKeyType, ColKeyType, Rows, Cols >::getSubMatrix ( const std::vector< RowKeyType > & rowKeys,
const std::vector< ColKeyType > & colKeys ) const
inline

Returns a submatrix specified by the row and col keys.

Parameters
rowKeysRow keys
colKeysCol keys

◆ operator=() [1/4]

template<typename Scalar , typename RowKeyType , typename ColKeyType , int Rows, int Cols>
KeyedMatrix & NAV::KeyedMatrix< Scalar, RowKeyType, ColKeyType, Rows, Cols >::operator= ( const KeyedMatrix< Scalar, RowKeyType, ColKeyType, Rows, Cols > & other)
inline

Copy assignment operator.

Parameters
otherThe other object

◆ operator=() [2/4]

template<typename Scalar , typename RowKeyType , typename ColKeyType , int Rows, int Cols>
KeyedMatrix & NAV::KeyedMatrix< Scalar, RowKeyType, ColKeyType, Rows, Cols >::operator= ( const KeyedMatrix< Scalar, RowKeyType, ColKeyType, Eigen::Dynamic, Eigen::Dynamic > & other)
inline

Copy assignment operator.

Parameters
otherThe other object

◆ operator=() [3/4]

template<typename Scalar , typename RowKeyType , typename ColKeyType , int Rows, int Cols>
KeyedMatrix & NAV::KeyedMatrix< Scalar, RowKeyType, ColKeyType, Rows, Cols >::operator= ( KeyedMatrix< Scalar, RowKeyType, ColKeyType, Rows, Cols > && other)
inlinenoexcept

Move assignment operator.

Parameters
otherThe other object

◆ operator=() [4/4]

template<typename Scalar , typename RowKeyType , typename ColKeyType , int Rows, int Cols>
KeyedMatrix & NAV::KeyedMatrix< Scalar, RowKeyType, ColKeyType, Rows, Cols >::operator= ( KeyedMatrix< Scalar, RowKeyType, ColKeyType, Eigen::Dynamic, Eigen::Dynamic > && other)
inlinenoexcept

Move assignment operator.

Parameters
otherThe other object

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