TimeSeriesFunctor< FP > Class Template Reference

CPP API: mio::TimeSeriesFunctor< FP > Class Template Reference
mio::TimeSeriesFunctor< FP > Class Template Reference

#include <time_series_functor.h>

Public Member Functions

auto default_serialize ()
 This method is used by the default serialization feature. More...
 
FP operator() (FP time) const
 Function returning a scalar value. More...
 
 TimeSeriesFunctor ()
 Creates a Zero functor. More...
 
 TimeSeriesFunctor (TimeSeriesFunctorType type, const TimeSeries< FP > &data)
 Creates a functor using the given data. More...
 
 TimeSeriesFunctor (TimeSeriesFunctorType type, std::vector< std::vector< FP >> &&table)
 Creates a functor using the given table. More...
 

Private Attributes

TimeSeries< FP > m_data
 Data used by the functor to compute its values. Its shape depends on type. More...
 
TimeSeriesFunctorType m_type
 Determines what kind of functor this is, e.g. linear interpolation. More...
 

Constructor & Destructor Documentation

◆ TimeSeriesFunctor() [1/3]

template<class FP >
mio::TimeSeriesFunctor< FP >::TimeSeriesFunctor ( TimeSeriesFunctorType  type,
const TimeSeries< FP > &  data 
)
inline

Creates a functor using the given data.

Note the data requirements of the given functor type.

Parameters
typeThe type of the functor.
tableA list of time points, passed to the TimeSeries constructor.

◆ TimeSeriesFunctor() [2/3]

template<class FP >
mio::TimeSeriesFunctor< FP >::TimeSeriesFunctor ( TimeSeriesFunctorType  type,
std::vector< std::vector< FP >> &&  table 
)
inline

Creates a functor using the given table.

Note the data requirements of the given functor type.

Parameters
typeThe type of the functor.
tableA list of time points, passed to the TimeSeries constructor.

◆ TimeSeriesFunctor() [3/3]

template<class FP >
mio::TimeSeriesFunctor< FP >::TimeSeriesFunctor ( )
inline

Creates a Zero functor.

Member Function Documentation

◆ default_serialize()

template<class FP >
auto mio::TimeSeriesFunctor< FP >::default_serialize ( )
inline

This method is used by the default serialization feature.

◆ operator()()

template<class FP >
FP mio::TimeSeriesFunctor< FP >::operator() ( FP  time) const
inline

Function returning a scalar value.

Parameters
timeA scalar value.
Returns
A scalar value computed from data, depending on the functor's type.

Member Data Documentation

◆ m_data

template<class FP >
TimeSeries<FP> mio::TimeSeriesFunctor< FP >::m_data
private

Data used by the functor to compute its values. Its shape depends on type.

◆ m_type

template<class FP >
TimeSeriesFunctorType mio::TimeSeriesFunctor< FP >::m_type
private

Determines what kind of functor this is, e.g. linear interpolation.