- 3.0.2 core module.
ct::core::Interpolation< Data_T, Alloc_Data, SCALAR > Class Template Reference

Class that performs interpolation of data in time. More...

#include <Interpolation.h>

Public Member Functions

 Interpolation (const InterpolationType &type=LIN)
 Default constructor. More...
 
 Interpolation (const Interpolation &arg)
 Copy Constructor. More...
 
void interpolate (const tpl::TimeArray< SCALAR > &timeArray, const DiscreteArray_t &dataArray, const SCALAR &enquiryTime, Data_T &enquiryData, int greatestLessTimeStampIndex=-1)
 This method performs the interpolation. More...
 
int getGreatestLessTimeStampIndex ()
 access the greatest index which is smaller than the inquired interpolation time More...
 
InterpolationType getInterpolationType () const
 get the employed interpolation type More...
 
void changeInterpolationType (const InterpolationType &type)
 change the interpolation type More...
 
int findIndex (const tpl::TimeArray< SCALAR > &timeArray, const SCALAR &enquiryTime)
 find an index corresponding to a certain inquiry time More...
 

Public Attributes

EIGEN_MAKE_ALIGNED_OPERATOR_NEW typedef DiscreteArray< Data_T, Alloc_Data > DiscreteArray_t
 

Protected Attributes

int index_
 
InterpolationType type_
 

Detailed Description

template<typename Data_T, class Alloc_Data = Eigen::aligned_allocator<Data_T>, typename SCALAR = double>
class ct::core::Interpolation< Data_T, Alloc_Data, SCALAR >

Class that performs interpolation of data in time.

This class performs interpolation of a data array based on timestamps

Template Parameters
Data_Tthe data type for interpolation, e.g. a scalar or a StateVector
Alloc_DataAn optional allocator for the data type
Alloc_TimeAn optional allocator for the time data type
Examples:
InterpolationTest.cpp.

Constructor & Destructor Documentation

◆ Interpolation() [1/2]

template<typename Data_T, class Alloc_Data = Eigen::aligned_allocator<Data_T>, typename SCALAR = double>
ct::core::Interpolation< Data_T, Alloc_Data, SCALAR >::Interpolation ( const InterpolationType type = LIN)
inline

Default constructor.

Warning
This does not initialize the underlying data or time series and thus all evaluating calls will fail.
Parameters
typeThe interpolation strategy to use

◆ Interpolation() [2/2]

template<typename Data_T, class Alloc_Data = Eigen::aligned_allocator<Data_T>, typename SCALAR = double>
ct::core::Interpolation< Data_T, Alloc_Data, SCALAR >::Interpolation ( const Interpolation< Data_T, Alloc_Data, SCALAR > &  arg)
inline

Copy Constructor.

Member Function Documentation

◆ interpolate()

template<typename Data_T, class Alloc_Data = Eigen::aligned_allocator<Data_T>, typename SCALAR = double>
void ct::core::Interpolation< Data_T, Alloc_Data, SCALAR >::interpolate ( const tpl::TimeArray< SCALAR > &  timeArray,
const DiscreteArray_t dataArray,
const SCALAR enquiryTime,
Data_T &  enquiryData,
int  greatestLessTimeStampIndex = -1 
)
inline

This method performs the interpolation.

Parameters
timeArraytiming information of the data points
dataArraythe data points in form of a DiscreteArray
enquiryTimethe time where to evaluate the interpolation
enquiryDatathe result of the interpolation
greatestLessTimeStampIndexthe smallest index corresponding to a time smaller than the inquired Time

Referenced by ct::core::DiscreteTrajectoryBase< STATE_DIM, CONTROL_DIM, SCALAR >::eval(), and TEST().

◆ getGreatestLessTimeStampIndex()

template<typename Data_T, class Alloc_Data = Eigen::aligned_allocator<Data_T>, typename SCALAR = double>
int ct::core::Interpolation< Data_T, Alloc_Data, SCALAR >::getGreatestLessTimeStampIndex ( )
inline

access the greatest index which is smaller than the inquired interpolation time

◆ getInterpolationType()

template<typename Data_T, class Alloc_Data = Eigen::aligned_allocator<Data_T>, typename SCALAR = double>
InterpolationType ct::core::Interpolation< Data_T, Alloc_Data, SCALAR >::getInterpolationType ( ) const
inline

get the employed interpolation type

Referenced by ct::core::DiscreteTrajectoryBase< STATE_DIM, CONTROL_DIM, SCALAR >::operator=().

◆ changeInterpolationType()

template<typename Data_T, class Alloc_Data = Eigen::aligned_allocator<Data_T>, typename SCALAR = double>
void ct::core::Interpolation< Data_T, Alloc_Data, SCALAR >::changeInterpolationType ( const InterpolationType type)
inline

◆ findIndex()

template<typename Data_T, class Alloc_Data = Eigen::aligned_allocator<Data_T>, typename SCALAR = double>
int ct::core::Interpolation< Data_T, Alloc_Data, SCALAR >::findIndex ( const tpl::TimeArray< SCALAR > &  timeArray,
const SCALAR enquiryTime 
)
inline

Member Data Documentation

◆ DiscreteArray_t

template<typename Data_T, class Alloc_Data = Eigen::aligned_allocator<Data_T>, typename SCALAR = double>
EIGEN_MAKE_ALIGNED_OPERATOR_NEW typedef DiscreteArray<Data_T, Alloc_Data> ct::core::Interpolation< Data_T, Alloc_Data, SCALAR >::DiscreteArray_t

◆ index_

template<typename Data_T, class Alloc_Data = Eigen::aligned_allocator<Data_T>, typename SCALAR = double>
int ct::core::Interpolation< Data_T, Alloc_Data, SCALAR >::index_
protected

◆ type_


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