0.3.0
Loading...
Searching...
No Matches
Vector.hpp File Reference

Vector Utility functions. More...

Go to the source code of this file.

Functions

template<typename Scalar>
std::vector< Scalar > NAV::genRangeVector (Scalar start, Scalar stepSize, Scalar end)
 Returns a container filled with the given range.
 
template<typename T>
void NAV::move (std::vector< T > &v, size_t sourceIdx, size_t targetIdx)
 Moves an element within a vector to a new position.
 
template<typename T>
bool NAV::operator== (const std::vector< T > &lhs, std::span< const T > rhs)
 Comparison operator for span and vector.
 
template<typename T>
bool NAV::operator== (std::span< const T > lhs, const std::vector< T > &rhs)
 Comparison operator for span and vector.
 

Detailed Description

Vector Utility functions.

Author
T. Topp (topp@.nosp@m.ins..nosp@m.uni-s.nosp@m.tutt.nosp@m.gart..nosp@m.de)
Date
2022-03-07

Function Documentation

◆ genRangeVector()

template<typename Scalar>
std::vector< Scalar > NAV::genRangeVector ( Scalar start,
Scalar stepSize,
Scalar end )

Returns a container filled with the given range.

Parameters
startInclusive start value of the range
stepSizeStep size of the range
endExclusive end value of the range

◆ move()

template<typename T>
void NAV::move ( std::vector< T > & v,
size_t sourceIdx,
size_t targetIdx )

Moves an element within a vector to a new position.

Parameters
[in,out]vVector with the elements
[in]sourceIdxOld index which will be moved
[in]targetIdxNew index which is the target

◆ operator==() [1/2]

template<typename T>
bool NAV::operator== ( const std::vector< T > & lhs,
std::span< const T > rhs )
nodiscard

Comparison operator for span and vector.

Parameters
lhsLeft-hand side
rhsRight-hand side
Returns
True if all elements are equal

◆ operator==() [2/2]

template<typename T>
bool NAV::operator== ( std::span< const T > lhs,
const std::vector< T > & rhs )
nodiscard

Comparison operator for span and vector.

Parameters
lhsLeft-hand side
rhsRight-hand side
Returns
True if all elements are equal