0.5.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, std::span< const 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, std::span< const 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() (std::span< const RowKeyType > rowKeys)
 Gets the values for the row keys.
decltype(auto) operator() (std::span< const 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 (std::span< const RowKeyType > rowKeys)
 Gets the values for the row keys.
decltype(auto) segment (std::span< const RowKeyType > rowKeys)
 Gets the values for the row keys.
template<size_t P>
decltype(auto) segment (std::span< const RowKeyType > rowKeys) const
 Gets the values for the row keys.
decltype(auto) segment (std::span< const 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 (std::span< const 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 (std::span< const 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 >
std::mutex _sliceMutex
 Mutex for accessing the slices.
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

Definition at line 1467 of file KeyedMatrix.hpp.

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,
std::span< const RowKeyType > rowKeys )
inline

Vector constructor.

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

Definition at line 1475 of file KeyedMatrix.hpp.

◆ ~KeyedVector()

template<typename Scalar, typename RowKeyType, int Rows>
NAV::KeyedVector< Scalar, RowKeyType, Rows >::~KeyedVector ( )
default

Destructor.

◆ 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

Definition at line 1487 of file KeyedMatrix.hpp.

◆ 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

Definition at line 1503 of file KeyedMatrix.hpp.

◆ 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

Definition at line 1524 of file KeyedMatrix.hpp.

◆ 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

Definition at line 1544 of file KeyedMatrix.hpp.

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

Definition at line 1492 of file KeyedMatrix.hpp.

◆ 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

Definition at line 1531 of file KeyedMatrix.hpp.

◆ 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

Definition at line 1508 of file KeyedMatrix.hpp.

◆ 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

Definition at line 1551 of file KeyedMatrix.hpp.

◆ transposed()

template<typename Scalar, typename RowKeyType, int Rows>
KeyedRowVector< Scalar, RowKeyType, Rows > NAV::KeyedVector< Scalar, RowKeyType, Rows >::transposed ( ) const
inlinenodiscard

Calculates the transposed vector.

Definition at line 1568 of file KeyedMatrix.hpp.


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