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

Class to inherit common methods for static and dynamic sized vectors. More...

Public Member Functions

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::internal::KeyedVectorBase< Scalar, RowKeyType, Rows >

Class to inherit common methods for static and dynamic sized vectors.

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

◆ KeyedVectorBase() [1/6]

template<typename Scalar , typename RowKeyType , int Rows>
template<typename Derived >
NAV::internal::KeyedVectorBase< Scalar, RowKeyType, Rows >::KeyedVectorBase ( const Eigen::MatrixBase< Derived > & vector)
inlineexplicit

Constructor.

Parameters
vectorEigen vector to initialize from

◆ KeyedVectorBase() [2/6]

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

Constructor.

Parameters
vectorEigen vector to initialize from
rowKeysRow keys describing the vector

◆ KeyedVectorBase() [3/6]

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

Copy constructor.

Parameters
otherThe other object

◆ KeyedVectorBase() [4/6]

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

Move constructor.

Parameters
otherThe other object

◆ KeyedVectorBase() [5/6]

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

Copy constructor.

Parameters
otherThe other object

◆ KeyedVectorBase() [6/6]

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

Move constructor.

Parameters
otherThe other object

Member Function Documentation

◆ operator()() [1/4]

template<typename Scalar , typename RowKeyType , int Rows>
Scalar & NAV::internal::KeyedVectorBase< Scalar, RowKeyType, Rows >::operator() ( const RowKeyType & rowKey)
inline

Gets the value for the row key.

Parameters
rowKeyRow Key
Returns
Scalar value

◆ operator()() [2/4]

template<typename Scalar , typename RowKeyType , int Rows>
const Scalar & NAV::internal::KeyedVectorBase< Scalar, RowKeyType, Rows >::operator() ( const RowKeyType & rowKey) const
inline

Gets the value for the row key.

Parameters
rowKeyRow Key
Returns
Scalar value

◆ operator()() [3/4]

template<typename Scalar , typename RowKeyType , int Rows>
decltype(auto) NAV::internal::KeyedVectorBase< Scalar, RowKeyType, Rows >::operator() ( const std::vector< RowKeyType > & rowKeys)
inline

Gets the values for the row keys.

Parameters
rowKeysRow Keys
Returns
View into the matrix for the row keys

◆ operator()() [4/4]

template<typename Scalar , typename RowKeyType , int Rows>
decltype(auto) NAV::internal::KeyedVectorBase< Scalar, RowKeyType, Rows >::operator() ( const std::vector< RowKeyType > & rowKeys) const
inline

Gets the values for the row keys.

Parameters
rowKeysRow Keys
Returns
View into the matrix for the row keys

◆ operator=() [1/4]

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

Copy assignment operator.

Parameters
otherThe other object

◆ operator=() [2/4]

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

Copy assignment operator.

Parameters
otherThe other object

◆ operator=() [3/4]

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

Move assignment operator.

Parameters
otherThe other object

◆ operator=() [4/4]

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

Move assignment operator.

Parameters
otherThe other object

◆ segment() [1/4]

template<typename Scalar , typename RowKeyType , int Rows>
template<size_t P>
decltype(auto) NAV::internal::KeyedVectorBase< Scalar, RowKeyType, Rows >::segment ( const std::vector< RowKeyType > & rowKeys)
inline

Gets the values for the row keys.

Parameters
rowKeysRow Keys
Returns
View into the matrix for the row keys

◆ segment() [2/4]

template<typename Scalar , typename RowKeyType , int Rows>
decltype(auto) NAV::internal::KeyedVectorBase< Scalar, RowKeyType, Rows >::segment ( const std::vector< RowKeyType > & rowKeys)
inline

Gets the values for the row keys.

Parameters
rowKeysRow Keys
Returns
View into the matrix for the row keys

◆ segment() [3/4]

template<typename Scalar , typename RowKeyType , int Rows>
template<size_t P>
decltype(auto) NAV::internal::KeyedVectorBase< Scalar, RowKeyType, Rows >::segment ( const std::vector< RowKeyType > & rowKeys) const
inline

Gets the values for the row keys.

Parameters
rowKeysRow Keys
Returns
View into the matrix for the row keys

◆ segment() [4/4]

template<typename Scalar , typename RowKeyType , int Rows>
decltype(auto) NAV::internal::KeyedVectorBase< Scalar, RowKeyType, Rows >::segment ( const std::vector< RowKeyType > & rowKeys) const
inline

Gets the values for the row keys.

Parameters
rowKeysRow Keys
Returns
View into the matrix for the row keys

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