0.4.1
Loading...
Searching...
No Matches
NAV::internal::KeyedRowVectorBase< Scalar, ColKeyType, Cols > Class Template Reference

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

Public Member Functions

template<typename Derived>
 KeyedRowVectorBase (const Eigen::MatrixBase< Derived > &vector)
 Constructor.
 
template<typename Derived>
 KeyedRowVectorBase (const Eigen::MatrixBase< Derived > &vector, std::span< const ColKeyType > colKeys)
 Constructor.
 
 KeyedRowVectorBase (const KeyedRowVectorBase &other)
 Copy constructor.
 
template<int oCols>
 KeyedRowVectorBase (const KeyedRowVectorBase< Scalar, ColKeyType, oCols > &other)
 Copy constructor.
 
 KeyedRowVectorBase (KeyedRowVectorBase &&other) noexcept
 Move constructor.
 
template<int oCols>
 KeyedRowVectorBase (KeyedRowVectorBase< Scalar, ColKeyType, oCols > &&other) noexcept
 Move constructor.
 
 operator Eigen::RowVector< Scalar, Cols > ()
 Conversion into Eigen::RowVector.
 
Eigen::Matrix< Scalar, 1, Cols > & operator() (all_t)
 Requests the full vector.
 
const Eigen::Matrix< Scalar, 1, Cols > & operator() (all_t) const
 Requests the full vector.
 
Scalar & operator() (const ColKeyType &colKey)
 Gets the value for the col key.
 
const Scalar & operator() (const ColKeyType &colKey) const
 Gets the value for the col key.
 
decltype(auto) operator() (std::span< const ColKeyType > colKeys)
 Gets the values for the col keys.
 
decltype(auto) operator() (std::span< const ColKeyType > colKeys) const
 Gets the values for the col keys.
 
KeyedRowVectorBaseoperator= (const KeyedRowVectorBase &other)
 Copy assignment operator.
 
template<int oCols>
KeyedRowVectorBaseoperator= (const KeyedRowVectorBase< Scalar, ColKeyType, oCols > &other)
 Copy assignment operator.
 
KeyedRowVectorBaseoperator= (KeyedRowVectorBase &&other) noexcept
 Move assignment operator.
 
template<int oCols>
KeyedRowVectorBaseoperator= (KeyedRowVectorBase< Scalar, ColKeyType, oCols > &&other) noexcept
 Move assignment operator.
 
template<size_t Q>
decltype(auto) segment (std::span< const ColKeyType > colKeys)
 Gets the values for the col keys.
 
decltype(auto) segment (std::span< const ColKeyType > colKeys)
 Gets the values for the col keys.
 
template<size_t Q>
decltype(auto) segment (std::span< const ColKeyType > colKeys) const
 Gets the values for the col keys.
 
decltype(auto) segment (std::span< const ColKeyType > colKeys) const
 Gets the values for the col keys.
 
KeyedVectorBase< Scalar, ColKeyType, Cols > transposed () const
 Calculates the transposed vector.
 
 ~KeyedRowVectorBase ()=default
 Destructor.
 
- 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 (std::span< const 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 (std::span< const 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.
 

Private Member Functions

void checkContinuousSegment (std::span< const ColKeyType > colKeys, size_t Q) const
 Checks if the col keys are describing a continuous block.
 

Additional Inherited Members

- 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.
 
- 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 ColKeyType, int Cols>
class NAV::internal::KeyedRowVectorBase< Scalar, ColKeyType, Cols >

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

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

Definition at line 632 of file KeyedMatrix.hpp.

Constructor & Destructor Documentation

◆ KeyedRowVectorBase() [1/6]

template<typename Scalar, typename ColKeyType, int Cols>
template<typename Derived>
NAV::internal::KeyedRowVectorBase< Scalar, ColKeyType, Cols >::KeyedRowVectorBase ( const Eigen::MatrixBase< Derived > & vector)
inlineexplicit

Constructor.

Parameters
vectorEigen vector to initialize from

Definition at line 638 of file KeyedMatrix.hpp.

◆ KeyedRowVectorBase() [2/6]

template<typename Scalar, typename ColKeyType, int Cols>
template<typename Derived>
NAV::internal::KeyedRowVectorBase< Scalar, ColKeyType, Cols >::KeyedRowVectorBase ( const Eigen::MatrixBase< Derived > & vector,
std::span< const ColKeyType > colKeys )
inline

Constructor.

Parameters
vectorEigen vector to initialize from
colKeysCol keys describing the vector

Definition at line 647 of file KeyedMatrix.hpp.

◆ ~KeyedRowVectorBase()

template<typename Scalar, typename ColKeyType, int Cols>
NAV::internal::KeyedRowVectorBase< Scalar, ColKeyType, Cols >::~KeyedRowVectorBase ( )
default

Destructor.

◆ KeyedRowVectorBase() [3/6]

template<typename Scalar, typename ColKeyType, int Cols>
NAV::internal::KeyedRowVectorBase< Scalar, ColKeyType, Cols >::KeyedRowVectorBase ( const KeyedRowVectorBase< Scalar, ColKeyType, Cols > & other)
inline

Copy constructor.

Parameters
otherThe other object

Definition at line 669 of file KeyedMatrix.hpp.

◆ KeyedRowVectorBase() [4/6]

template<typename Scalar, typename ColKeyType, int Cols>
NAV::internal::KeyedRowVectorBase< Scalar, ColKeyType, Cols >::KeyedRowVectorBase ( KeyedRowVectorBase< Scalar, ColKeyType, Cols > && other)
inlinenoexcept

Move constructor.

Parameters
otherThe other object

Definition at line 691 of file KeyedMatrix.hpp.

◆ KeyedRowVectorBase() [5/6]

template<typename Scalar, typename ColKeyType, int Cols>
template<int oCols>
NAV::internal::KeyedRowVectorBase< Scalar, ColKeyType, Cols >::KeyedRowVectorBase ( const KeyedRowVectorBase< Scalar, ColKeyType, oCols > & other)
inline

Copy constructor.

Parameters
otherThe other object

Definition at line 719 of file KeyedMatrix.hpp.

◆ KeyedRowVectorBase() [6/6]

template<typename Scalar, typename ColKeyType, int Cols>
template<int oCols>
NAV::internal::KeyedRowVectorBase< Scalar, ColKeyType, Cols >::KeyedRowVectorBase ( KeyedRowVectorBase< Scalar, ColKeyType, oCols > && other)
inlinenoexcept

Move constructor.

Parameters
otherThe other object

Definition at line 747 of file KeyedMatrix.hpp.

Member Function Documentation

◆ checkContinuousSegment()

template<typename Scalar, typename ColKeyType, int Cols>
void NAV::internal::KeyedRowVectorBase< Scalar, ColKeyType, Cols >::checkContinuousSegment ( std::span< const ColKeyType > colKeys,
size_t Q ) const
inlineprivate

Checks if the col keys are describing a continuous block.

Parameters
colKeysCol keys
QSize of the col keys

Definition at line 879 of file KeyedMatrix.hpp.

◆ operator Eigen::RowVector< Scalar, Cols >()

template<typename Scalar, typename ColKeyType, int Cols>
NAV::internal::KeyedRowVectorBase< Scalar, ColKeyType, Cols >::operator Eigen::RowVector< Scalar, Cols > ( )
inlineexplicit

Conversion into Eigen::RowVector.

Definition at line 820 of file KeyedMatrix.hpp.

◆ operator()() [1/6]

template<typename Scalar, typename ColKeyType, int Cols>
Eigen::Matrix< Scalar, 1, Cols > & NAV::internal::KeyedRowVectorBase< Scalar, ColKeyType, Cols >::operator() ( all_t )
inline

Requests the full vector.

Definition at line 818 of file KeyedMatrix.hpp.

◆ operator()() [2/6]

template<typename Scalar, typename ColKeyType, int Cols>
const Eigen::Matrix< Scalar, 1, Cols > & NAV::internal::KeyedRowVectorBase< Scalar, ColKeyType, Cols >::operator() ( all_t ) const
inline

Requests the full vector.

Definition at line 816 of file KeyedMatrix.hpp.

◆ operator()() [3/6]

template<typename Scalar, typename ColKeyType, int Cols>
Scalar & NAV::internal::KeyedRowVectorBase< Scalar, ColKeyType, Cols >::operator() ( const ColKeyType & colKey)
inline

Gets the value for the col key.

Parameters
colKeyCol Key
Returns
Scalar value

Definition at line 787 of file KeyedMatrix.hpp.

◆ operator()() [4/6]

template<typename Scalar, typename ColKeyType, int Cols>
const Scalar & NAV::internal::KeyedRowVectorBase< Scalar, ColKeyType, Cols >::operator() ( const ColKeyType & colKey) const
inline

Gets the value for the col key.

Parameters
colKeyCol Key
Returns
Scalar value

Definition at line 780 of file KeyedMatrix.hpp.

◆ operator()() [5/6]

template<typename Scalar, typename ColKeyType, int Cols>
decltype(auto) NAV::internal::KeyedRowVectorBase< Scalar, ColKeyType, Cols >::operator() ( std::span< const ColKeyType > colKeys)
inline

Gets the values for the col keys.

Parameters
colKeysCol Keys
Returns
View into the matrix for the col keys

Definition at line 806 of file KeyedMatrix.hpp.

◆ operator()() [6/6]

template<typename Scalar, typename ColKeyType, int Cols>
decltype(auto) NAV::internal::KeyedRowVectorBase< Scalar, ColKeyType, Cols >::operator() ( std::span< const ColKeyType > colKeys) const
inline

Gets the values for the col keys.

Parameters
colKeysCol Keys
Returns
View into the matrix for the col keys

Definition at line 795 of file KeyedMatrix.hpp.

◆ operator=() [1/4]

template<typename Scalar, typename ColKeyType, int Cols>
KeyedRowVectorBase & NAV::internal::KeyedRowVectorBase< Scalar, ColKeyType, Cols >::operator= ( const KeyedRowVectorBase< Scalar, ColKeyType, Cols > & other)
inline

Copy assignment operator.

Parameters
otherThe other object

Definition at line 678 of file KeyedMatrix.hpp.

◆ operator=() [2/4]

template<typename Scalar, typename ColKeyType, int Cols>
template<int oCols>
KeyedRowVectorBase & NAV::internal::KeyedRowVectorBase< Scalar, ColKeyType, Cols >::operator= ( const KeyedRowVectorBase< Scalar, ColKeyType, oCols > & other)
inline

Copy assignment operator.

Parameters
otherThe other object

Definition at line 731 of file KeyedMatrix.hpp.

◆ operator=() [3/4]

template<typename Scalar, typename ColKeyType, int Cols>
KeyedRowVectorBase & NAV::internal::KeyedRowVectorBase< Scalar, ColKeyType, Cols >::operator= ( KeyedRowVectorBase< Scalar, ColKeyType, Cols > && other)
inlinenoexcept

Move assignment operator.

Parameters
otherThe other object

Definition at line 700 of file KeyedMatrix.hpp.

◆ operator=() [4/4]

template<typename Scalar, typename ColKeyType, int Cols>
template<int oCols>
KeyedRowVectorBase & NAV::internal::KeyedRowVectorBase< Scalar, ColKeyType, Cols >::operator= ( KeyedRowVectorBase< Scalar, ColKeyType, oCols > && other)
inlinenoexcept

Move assignment operator.

Parameters
otherThe other object

Definition at line 759 of file KeyedMatrix.hpp.

◆ segment() [1/4]

template<typename Scalar, typename ColKeyType, int Cols>
template<size_t Q>
decltype(auto) NAV::internal::KeyedRowVectorBase< Scalar, ColKeyType, Cols >::segment ( std::span< const ColKeyType > colKeys)
inline

Gets the values for the col keys.

Parameters
colKeysCol Keys
Returns
View into the matrix for the col keys

Definition at line 840 of file KeyedMatrix.hpp.

◆ segment() [2/4]

template<typename Scalar, typename ColKeyType, int Cols>
decltype(auto) NAV::internal::KeyedRowVectorBase< Scalar, ColKeyType, Cols >::segment ( std::span< const ColKeyType > colKeys)
inline

Gets the values for the col keys.

Parameters
colKeysCol Keys
Returns
View into the matrix for the col keys

Definition at line 858 of file KeyedMatrix.hpp.

◆ segment() [3/4]

template<typename Scalar, typename ColKeyType, int Cols>
template<size_t Q>
decltype(auto) NAV::internal::KeyedRowVectorBase< Scalar, ColKeyType, Cols >::segment ( std::span< const ColKeyType > colKeys) const
inline

Gets the values for the col keys.

Parameters
colKeysCol Keys
Returns
View into the matrix for the col keys

Definition at line 830 of file KeyedMatrix.hpp.

◆ segment() [4/4]

template<typename Scalar, typename ColKeyType, int Cols>
decltype(auto) NAV::internal::KeyedRowVectorBase< Scalar, ColKeyType, Cols >::segment ( std::span< const ColKeyType > colKeys) const
inline

Gets the values for the col keys.

Parameters
colKeysCol Keys
Returns
View into the matrix for the col keys

Definition at line 849 of file KeyedMatrix.hpp.

◆ transposed()

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

Calculates the transposed vector.

Definition at line 870 of file KeyedMatrix.hpp.


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