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

Static sized KeyedVector. More...

Public Member Functions

template<typename Derived >
 KeyedVector (const Eigen::MatrixBase< Derived > &vector, const std::vector< RowKeyType > &rowKeys)
 Vector constructor.
 
 KeyedVector (const KeyedVector &other)
 Copy constructor.
 
 KeyedVector (const KeyedVector< Scalar, RowKeyType, Eigen::Dynamic > &other)
 Copy constructor.
 
 KeyedVector (KeyedVector &&other) noexcept
 Move constructor.
 
 KeyedVector (KeyedVector< Scalar, RowKeyType, Eigen::Dynamic > &&other) noexcept
 Move constructor.
 
KeyedVectoroperator= (const KeyedVector &other)
 Copy assignment operator.
 
KeyedVectoroperator= (const KeyedVector< Scalar, RowKeyType, Eigen::Dynamic > &other)
 Copy assignment operator.
 
KeyedVectoroperator= (KeyedVector &&other) noexcept
 Move assignment operator.
 
KeyedVectoroperator= (KeyedVector< Scalar, RowKeyType, Eigen::Dynamic > &&other) noexcept
 Move assignment operator.
 
KeyedRowVector< Scalar, RowKeyType, Rows > transposed () const
 Calculates the transposed vector.
 
 ~KeyedVector ()=default
 Destructor.
 
- Public Member Functions inherited from NAV::internal::KeyedVectorBase< Scalar, RowKeyType, Rows >
template<typename Derived >
 KeyedVectorBase (const Eigen::MatrixBase< Derived > &vector)
 Constructor.
 
template<typename Derived >
 KeyedVectorBase (const Eigen::MatrixBase< Derived > &vector, const std::vector< RowKeyType > &rowKeys)
 Constructor.
 
 KeyedVectorBase (const KeyedVectorBase &other)
 Copy constructor.
 
template<int oRows>
 KeyedVectorBase (const KeyedVectorBase< Scalar, RowKeyType, oRows > &other)
 Copy constructor.
 
 KeyedVectorBase (KeyedVectorBase &&other) noexcept
 Move constructor.
 
template<int oRows>
 KeyedVectorBase (KeyedVectorBase< Scalar, RowKeyType, oRows > &&other) noexcept
 Move constructor.
 
 operator Eigen::Vector< Scalar, Rows > ()
 Conversion into Eigen::Vector.
 
Eigen::Matrix< Scalar, Rows, 1 > & operator() (all_t)
 Requests the full vector.
 
const Eigen::Matrix< Scalar, Rows, 1 > & operator() (all_t) const
 Requests the full vector.
 
Scalar & operator() (const RowKeyType &rowKey)
 Gets the value for the row key.
 
const Scalar & operator() (const RowKeyType &rowKey) const
 Gets the value for the row key.
 
decltype(auto) operator() (const std::vector< RowKeyType > &rowKeys)
 Gets the values for the row keys.
 
decltype(auto) operator() (const std::vector< RowKeyType > &rowKeys) const
 Gets the values for the row keys.
 
KeyedVectorBaseoperator= (const KeyedVectorBase &other)
 Copy assignment operator.
 
template<int oRows>
KeyedVectorBaseoperator= (const KeyedVectorBase< Scalar, RowKeyType, oRows > &other)
 Copy assignment operator.
 
KeyedVectorBaseoperator= (KeyedVectorBase &&other) noexcept
 Move assignment operator.
 
template<int oRows>
KeyedVectorBaseoperator= (KeyedVectorBase< Scalar, RowKeyType, oRows > &&other) noexcept
 Move assignment operator.
 
template<size_t P>
decltype(auto) segment (const std::vector< RowKeyType > &rowKeys)
 Gets the values for the row keys.
 
decltype(auto) segment (const std::vector< RowKeyType > &rowKeys)
 Gets the values for the row keys.
 
template<size_t P>
decltype(auto) segment (const std::vector< RowKeyType > &rowKeys) const
 Gets the values for the row keys.
 
decltype(auto) segment (const std::vector< RowKeyType > &rowKeys) const
 Gets the values for the row keys.
 
KeyedRowVectorBase< Scalar, RowKeyType, Rows > transposed () const
 Calculates the transposed vector.
 
 ~KeyedVectorBase ()=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.
 

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.
 

Detailed Description

template<typename Scalar, typename RowKeyType, int Rows>
class NAV::KeyedVector< Scalar, RowKeyType, Rows >

Static sized KeyedVector.

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

Constructor & Destructor Documentation

◆ KeyedVector() [1/5]

template<typename Scalar , typename RowKeyType , int Rows>
template<typename Derived >
NAV::KeyedVector< Scalar, RowKeyType, Rows >::KeyedVector ( const Eigen::MatrixBase< Derived > & vector,
const std::vector< RowKeyType > & rowKeys )
inline

Vector constructor.

Template Parameters
DerivedDerived Eigen Type
Parameters
vectorEigen vector to initialize from
rowKeysRow keys describing the vector

◆ KeyedVector() [2/5]

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

Copy constructor.

Parameters
otherThe other object

◆ KeyedVector() [3/5]

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

Move constructor.

Parameters
otherThe other object

◆ KeyedVector() [4/5]

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

Copy constructor.

Parameters
otherThe other object

◆ KeyedVector() [5/5]

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

Move constructor.

Parameters
otherThe other object

Member Function Documentation

◆ operator=() [1/4]

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

Copy assignment operator.

Parameters
otherThe other object

◆ operator=() [2/4]

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

Copy assignment operator.

Parameters
otherThe other object

◆ operator=() [3/4]

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

Move assignment operator.

Parameters
otherThe other object

◆ operator=() [4/4]

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

Move assignment operator.

Parameters
otherThe other object

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