- 3.0.2 core module.
ct::core::DiscreteArray< T, Alloc > Class Template Reference

An discrete array (vector) of a particular data type. More...

#include <DiscreteArray.h>

Inheritance diagram for ct::core::DiscreteArray< T, Alloc >:

Public Types

typedef std::vector< T, Alloc > Base
 base class (std::vector) More...
 
typedef std::vector< T, Alloc >::iterator iterator
 iterator More...
 
typedef std::vector< T, Alloc >::const_iterator const_iterator
 const iterator More...
 

Public Member Functions

 DiscreteArray ()
 default constructor More...
 
 DiscreteArray (const DiscreteArray &&other)
 move constructor More...
 
 DiscreteArray (const DiscreteArray &other)
 copy constructor More...
 
 DiscreteArray (int n, const T &value=T())
 resize constructor More...
 
 DiscreteArray (iterator first, iterator last)
 copy constructor More...
 
 DiscreteArray (const_iterator first, const_iterator last)
 copy constructor More...
 
virtual ~DiscreteArray ()
 destructor More...
 
void swap (DiscreteArray &other)
 swaps the content of two arrays More...
 
DiscreteArray< T, Alloc > & operator= (const DiscreteArray< T, Alloc > &rhs)
 
DiscreteArray< T, Alloc > operator+ (const DiscreteArray< T, Alloc > &rhs) const
 overload + operator in order to be able to directly sum up two arrays More...
 
DiscreteArray< T, Alloc > operator- (const DiscreteArray< T, Alloc > &rhs) const
 overload - operator in order to be able to directly take the difference between two arrays More...
 
DiscreteArray< T, Alloc > & operator+= (const DiscreteArray< T, Alloc > &rhs)
 overload += operator More...
 
DiscreteArray< T, Alloc > & operator-= (const DiscreteArray< T, Alloc > &rhs)
 overload -= operator More...
 
template<typename SCALAR >
DiscreteArray< T, Alloc > operator* (const SCALAR &scalar) const
 overload * operator More...
 
template<typename SCALAR >
DiscreteArray< T, Alloc > operator/ (const SCALAR &scalar) const
 overload / operator More...
 
BasetoImplementation ()
 returns the underlying std::vector More...
 
const BasetoImplementation () const
 returns the underlying std::vector More...
 
void eraseFront (const size_t N)
 erase an element from the front More...
 
void setConstant (const T &data)
 sets all elements to a constant. More...
 
void addOffset (const T &offset)
 add an offset to each element More...
 

Public Attributes

EIGEN_MAKE_ALIGNED_OPERATOR_NEW typedef T value_type
 data type More...
 

Detailed Description

template<class T, class Alloc = Eigen::aligned_allocator<T>>
class ct::core::DiscreteArray< T, Alloc >

An discrete array (vector) of a particular data type.

This class is a discrete array/vector/sequence of data of a particular type.

Template Parameters
Tdata type
Allocmemory allocator type
Examples:
DiscreteTrajectoryTest.cpp, InterpolationTest.cpp, and LinspaceTest.cpp.

Member Typedef Documentation

◆ Base

template<class T, class Alloc = Eigen::aligned_allocator<T>>
typedef std::vector<T, Alloc> ct::core::DiscreteArray< T, Alloc >::Base

base class (std::vector)

◆ iterator

template<class T, class Alloc = Eigen::aligned_allocator<T>>
typedef std::vector<T, Alloc>::iterator ct::core::DiscreteArray< T, Alloc >::iterator

iterator

◆ const_iterator

template<class T, class Alloc = Eigen::aligned_allocator<T>>
typedef std::vector<T, Alloc>::const_iterator ct::core::DiscreteArray< T, Alloc >::const_iterator

const iterator

Constructor & Destructor Documentation

◆ DiscreteArray() [1/6]

template<class T, class Alloc = Eigen::aligned_allocator<T>>
ct::core::DiscreteArray< T, Alloc >::DiscreteArray ( )
inline

default constructor

◆ DiscreteArray() [2/6]

template<class T, class Alloc = Eigen::aligned_allocator<T>>
ct::core::DiscreteArray< T, Alloc >::DiscreteArray ( const DiscreteArray< T, Alloc > &&  other)
inline

move constructor

◆ DiscreteArray() [3/6]

template<class T, class Alloc = Eigen::aligned_allocator<T>>
ct::core::DiscreteArray< T, Alloc >::DiscreteArray ( const DiscreteArray< T, Alloc > &  other)
inline

copy constructor

◆ DiscreteArray() [4/6]

template<class T, class Alloc = Eigen::aligned_allocator<T>>
ct::core::DiscreteArray< T, Alloc >::DiscreteArray ( int  n,
const T &  value = T() 
)
inline

resize constructor

initializes an array with a certain length and fills it with a default value

Parameters
nlength of array
valuedefault value

◆ DiscreteArray() [5/6]

template<class T, class Alloc = Eigen::aligned_allocator<T>>
ct::core::DiscreteArray< T, Alloc >::DiscreteArray ( iterator  first,
iterator  last 
)
inline

copy constructor

Copies a segment of another array

Parameters
firstiterator to first element
lastiterator to last element

◆ DiscreteArray() [6/6]

template<class T, class Alloc = Eigen::aligned_allocator<T>>
ct::core::DiscreteArray< T, Alloc >::DiscreteArray ( const_iterator  first,
const_iterator  last 
)
inline

copy constructor

Copies a segment of another array

Parameters
firstiterator to first element
lastiterator to last element

◆ ~DiscreteArray()

template<class T, class Alloc = Eigen::aligned_allocator<T>>
virtual ct::core::DiscreteArray< T, Alloc >::~DiscreteArray ( )
inlinevirtual

destructor

Member Function Documentation

◆ swap()

template<class T, class Alloc = Eigen::aligned_allocator<T>>
void ct::core::DiscreteArray< T, Alloc >::swap ( DiscreteArray< T, Alloc > &  other)
inline

◆ operator=()

template<class T, class Alloc = Eigen::aligned_allocator<T>>
DiscreteArray<T, Alloc>& ct::core::DiscreteArray< T, Alloc >::operator= ( const DiscreteArray< T, Alloc > &  rhs)
inline

◆ operator+()

template<class T, class Alloc = Eigen::aligned_allocator<T>>
DiscreteArray<T, Alloc> ct::core::DiscreteArray< T, Alloc >::operator+ ( const DiscreteArray< T, Alloc > &  rhs) const
inline

overload + operator in order to be able to directly sum up two arrays

create result container of correct size

◆ operator-()

template<class T, class Alloc = Eigen::aligned_allocator<T>>
DiscreteArray<T, Alloc> ct::core::DiscreteArray< T, Alloc >::operator- ( const DiscreteArray< T, Alloc > &  rhs) const
inline

overload - operator in order to be able to directly take the difference between two arrays

create result container of correct size

◆ operator+=()

template<class T, class Alloc = Eigen::aligned_allocator<T>>
DiscreteArray<T, Alloc>& ct::core::DiscreteArray< T, Alloc >::operator+= ( const DiscreteArray< T, Alloc > &  rhs)
inline

overload += operator

◆ operator-=()

template<class T, class Alloc = Eigen::aligned_allocator<T>>
DiscreteArray<T, Alloc>& ct::core::DiscreteArray< T, Alloc >::operator-= ( const DiscreteArray< T, Alloc > &  rhs)
inline

overload -= operator

◆ operator*()

template<class T, class Alloc = Eigen::aligned_allocator<T>>
template<typename SCALAR >
DiscreteArray<T, Alloc> ct::core::DiscreteArray< T, Alloc >::operator* ( const SCALAR scalar) const
inline

overload * operator

create result container of correct size

◆ operator/()

template<class T, class Alloc = Eigen::aligned_allocator<T>>
template<typename SCALAR >
DiscreteArray<T, Alloc> ct::core::DiscreteArray< T, Alloc >::operator/ ( const SCALAR scalar) const
inline

overload / operator

create result container of correct size

◆ toImplementation() [1/2]

template<class T, class Alloc = Eigen::aligned_allocator<T>>
Base& ct::core::DiscreteArray< T, Alloc >::toImplementation ( )
inline

returns the underlying std::vector

◆ toImplementation() [2/2]

template<class T, class Alloc = Eigen::aligned_allocator<T>>
const Base& ct::core::DiscreteArray< T, Alloc >::toImplementation ( ) const
inline

returns the underlying std::vector

◆ eraseFront()

template<class T, class Alloc = Eigen::aligned_allocator<T>>
void ct::core::DiscreteArray< T, Alloc >::eraseFront ( const size_t  N)
inline

erase an element from the front

◆ setConstant()

template<class T, class Alloc = Eigen::aligned_allocator<T>>
void ct::core::DiscreteArray< T, Alloc >::setConstant ( const T &  data)
inline

sets all elements to a constant.

◆ addOffset()

template<class T, class Alloc = Eigen::aligned_allocator<T>>
void ct::core::DiscreteArray< T, Alloc >::addOffset ( const T &  offset)
inline

add an offset to each element

Member Data Documentation

◆ value_type

template<class T, class Alloc = Eigen::aligned_allocator<T>>
EIGEN_MAKE_ALIGNED_OPERATOR_NEW typedef T ct::core::DiscreteArray< T, Alloc >::value_type

data type


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