0.4.1
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, 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.
 

Private Member Functions

void checkContinuousSegment (std::span< const RowKeyType > rowKeys, size_t P) const
 Checks if the row keys are describing a continuous block.
 

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::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

Definition at line 365 of file KeyedMatrix.hpp.

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

Definition at line 371 of file KeyedMatrix.hpp.

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

Constructor.

Parameters
vectorEigen vector to initialize from
rowKeysRow keys describing the vector

Definition at line 380 of file KeyedMatrix.hpp.

◆ ~KeyedVectorBase()

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

Destructor.

◆ 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

Definition at line 402 of file KeyedMatrix.hpp.

◆ 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

Definition at line 424 of file KeyedMatrix.hpp.

◆ 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

Definition at line 452 of file KeyedMatrix.hpp.

◆ 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

Definition at line 480 of file KeyedMatrix.hpp.

Member Function Documentation

◆ checkContinuousSegment()

template<typename Scalar, typename RowKeyType, int Rows>
void NAV::internal::KeyedVectorBase< Scalar, RowKeyType, Rows >::checkContinuousSegment ( std::span< const RowKeyType > rowKeys,
size_t P ) const
inlineprivate

Checks if the row keys are describing a continuous block.

Parameters
rowKeysRow keys
PSize of the row keys

Definition at line 612 of file KeyedMatrix.hpp.

◆ operator Eigen::Vector< Scalar, Rows >()

template<typename Scalar, typename RowKeyType, int Rows>
NAV::internal::KeyedVectorBase< Scalar, RowKeyType, Rows >::operator Eigen::Vector< Scalar, Rows > ( )
inlineexplicit

Conversion into Eigen::Vector.

Definition at line 553 of file KeyedMatrix.hpp.

◆ operator()() [1/6]

template<typename Scalar, typename RowKeyType, int Rows>
Eigen::Matrix< Scalar, Rows, 1 > & NAV::internal::KeyedVectorBase< Scalar, RowKeyType, Rows >::operator() ( all_t )
inline

Requests the full vector.

Definition at line 551 of file KeyedMatrix.hpp.

◆ operator()() [2/6]

template<typename Scalar, typename RowKeyType, int Rows>
const Eigen::Matrix< Scalar, Rows, 1 > & NAV::internal::KeyedVectorBase< Scalar, RowKeyType, Rows >::operator() ( all_t ) const
inline

Requests the full vector.

Definition at line 549 of file KeyedMatrix.hpp.

◆ operator()() [3/6]

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

Definition at line 520 of file KeyedMatrix.hpp.

◆ operator()() [4/6]

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

Definition at line 513 of file KeyedMatrix.hpp.

◆ operator()() [5/6]

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

Gets the values for the row keys.

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

Definition at line 539 of file KeyedMatrix.hpp.

◆ operator()() [6/6]

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

Gets the values for the row keys.

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

Definition at line 528 of file KeyedMatrix.hpp.

◆ 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

Definition at line 411 of file KeyedMatrix.hpp.

◆ 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

Definition at line 464 of file KeyedMatrix.hpp.

◆ 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

Definition at line 433 of file KeyedMatrix.hpp.

◆ 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

Definition at line 492 of file KeyedMatrix.hpp.

◆ segment() [1/4]

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

Gets the values for the row keys.

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

Definition at line 573 of file KeyedMatrix.hpp.

◆ segment() [2/4]

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

Gets the values for the row keys.

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

Definition at line 591 of file KeyedMatrix.hpp.

◆ segment() [3/4]

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

Gets the values for the row keys.

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

Definition at line 563 of file KeyedMatrix.hpp.

◆ segment() [4/4]

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

Gets the values for the row keys.

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

Definition at line 582 of file KeyedMatrix.hpp.

◆ transposed()

template<typename Scalar, typename RowKeyType, int Rows>
KeyedRowVectorBase< Scalar, RowKeyType, Rows > NAV::internal::KeyedVectorBase< Scalar, RowKeyType, Rows >::transposed ( ) const
inlinenodiscard

Calculates the transposed vector.

Definition at line 603 of file KeyedMatrix.hpp.


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