Skip to content

datatypes::timeseries::TTimeSeries

A template for univariate, single realisasion time series. More...

#include <time_series.hpp>

Public Types

Name
using T ElementType
The type of each element in this time series.

Public Functions

Name
bool IsMissingValue(const T & value) const
T GetMissingValue() const
TTimeSeries(StoragePolicy< T > * storage =nullptr, MissingValuePolicy< T > * mvp =nullptr)
TTimeSeries(T default_value, size_t length, const ptime & startDate, const TimeStep & timeStep =TimeStep::GetHourly(), StoragePolicy< T > * storage =nullptr, MissingValuePolicy< T > * mvp =nullptr)
TTimeSeries(size_t length, const ptime & startDate, const TimeStep & timeStep =TimeStep::GetHourly(), StoragePolicy< T > * storage =nullptr, MissingValuePolicy< T > * mvp =nullptr)
TTimeSeries(const vector< T > & values, const ptime & startDate, const TimeStep & timeStep =TimeStep::GetHourly(), StoragePolicy< T > * storage =nullptr, MissingValuePolicy< T > * mvp =nullptr)
TTimeSeries(const T * values, size_t length, const ptime & startDate, const TimeStep & timeStep =TimeStep::GetHourly(), StoragePolicy< T > * storage =nullptr, MissingValuePolicy< T > * mvp =nullptr)
TTimeSeries(std::function< T(size_t)> & valueGen, size_t length, const ptime & startDate, const TimeStep & timeStep =TimeStep::GetHourly(), StoragePolicy< T > * storage =nullptr, MissingValuePolicy< T > * mvp =nullptr)
TTimeSeries(const TTimeSeries< T > & src)
TTimeSeries(const TTimeSeries< T > & src, StoragePolicy< T > * storage)
TTimeSeries(const TTimeSeries< T > * src)
TTimeSeries(TTimeSeries< T > && src)
Constructor using the move semantics.
TTimeSeries< T > & operator=(TTimeSeries< T > && src)
TTimeSeries< T > & operator=(const TTimeSeries< T > & src)
virtual ~TTimeSeries()
T GetValueNoConst(const size_t & index)
const T & GetValueConst(const size_t & index) const
T GetValue(const size_t & index)
const T & GetValue(const size_t & index) const
T GetValueNoConst(const ptime & instant)
T GetValue(const ptime & instant)
const T & GetValue(const ptime & instant) const
T GetLastValue()
void CopyTo(T * dest, size_t from =0, size_t to =-1) const
void CopyWithMissingValueTo(T * dest, const T & missingValueValue, size_t from =0, size_t to =-1) const
void CopyValues(const TTimeSeries< T > & src)
void CopyTo(vector< T > & dest, size_t from =0, size_t to =-1) const
T * GetValues(size_t from =0, size_t to =std::numeric_limits< size_t >::max()) const
vector< T > GetValuesVector(size_t from =0, size_t to =std::numeric_limits< size_t >::max()) const
TTimeSeries< T > Subset(size_t from =0, size_t to =std::numeric_limits< size_t >::max()) const
void SetValue(size_t index, T value)
void SetValue(const ptime & instant, T value)
void Reset(size_t length, const ptime & startDate, const TimeStep & timeStep)
void Reset(size_t length, const ptime & startDate, const T * values =nullptr)
void Reset(size_t length, const ptime & startDate, T value)
void Reset(const vector< T > & values, const ptime & startDate)
void Reset(const vector< T > & values, const ptime & startDate, const TimeStep & timeStep)
size_t GetLength() const
ptime GetStartDate() const
ptime GetEndDate() const
TimeStep GetTimeStep() const
void SetTimeStep(const TimeStep & timeStep)
void SetStartDate(const ptime & start)
ptime TimeForIndex(size_t timeIndex) const
vector< ptime > TimeIndices() const
size_t IndexForTime(const ptime & instant) const
size_t UpperIndexForTime(const ptime & instant) const
size_t LowerIndexForTime(const ptime & instant) const
string GetSummary() const
T & operator[](const ptime & instant)
T & operator[](const size_t i)
const T & operator[](const ptime & instant) const
const T & operator[](const size_t i) const
TTimeSeries< T > operator+(const TTimeSeries< T > & rhs) const
TTimeSeries< T > operator+(T value) const
template <typename M >
TTimeSeries< T >
operator*(M multiplicator) const
int NumInstances()

Protected Functions

Name
T GetNACode() const

Public Attributes

Name
string Tag

Detailed Description

template <typename T  =double>
class datatypes::timeseries::TTimeSeries;

A template for univariate, single realisasion time series.

Template Parameters:

  • T Element type, typically double or float, but possibly a more complicated type such as another TTimeSeries.

Public Types Documentation

using ElementType

using datatypes::timeseries::TTimeSeries< T >::ElementType =  T;

The type of each element in this time series.

Public Functions Documentation

function IsMissingValue

inline bool IsMissingValue(
    const T & value
) const

function GetMissingValue

inline T GetMissingValue() const

function TTimeSeries

inline TTimeSeries(
    StoragePolicy< T > * storage =nullptr,
    MissingValuePolicy< T > * mvp =nullptr
)

function TTimeSeries

inline TTimeSeries(
    T default_value,
    size_t length,
    const ptime & startDate,
    const TimeStep & timeStep =TimeStep::GetHourly(),
    StoragePolicy< T > * storage =nullptr,
    MissingValuePolicy< T > * mvp =nullptr
)

function TTimeSeries

inline TTimeSeries(
    size_t length,
    const ptime & startDate,
    const TimeStep & timeStep =TimeStep::GetHourly(),
    StoragePolicy< T > * storage =nullptr,
    MissingValuePolicy< T > * mvp =nullptr
)

function TTimeSeries

inline TTimeSeries(
    const vector< T > & values,
    const ptime & startDate,
    const TimeStep & timeStep =TimeStep::GetHourly(),
    StoragePolicy< T > * storage =nullptr,
    MissingValuePolicy< T > * mvp =nullptr
)

function TTimeSeries

inline TTimeSeries(
    const T * values,
    size_t length,
    const ptime & startDate,
    const TimeStep & timeStep =TimeStep::GetHourly(),
    StoragePolicy< T > * storage =nullptr,
    MissingValuePolicy< T > * mvp =nullptr
)

function TTimeSeries

inline TTimeSeries(
    std::function< T(size_t)> & valueGen,
    size_t length,
    const ptime & startDate,
    const TimeStep & timeStep =TimeStep::GetHourly(),
    StoragePolicy< T > * storage =nullptr,
    MissingValuePolicy< T > * mvp =nullptr
)

function TTimeSeries

inline TTimeSeries(
    const TTimeSeries< T > & src
)

function TTimeSeries

inline TTimeSeries(
    const TTimeSeries< T > & src,
    StoragePolicy< T > * storage
)

function TTimeSeries

inline TTimeSeries(
    const TTimeSeries< T > * src
)

function TTimeSeries

inline TTimeSeries(
    TTimeSeries< T > && src
)

Constructor using the move semantics.

Parameters:

  • src time series from which to move data.

Remark: C++ for the Impatient Appendix A. A Painless Introduction to Rvalue References (C++11) See also http://stackoverflow.com/a/3109981/2752565 for information on move semantic

function operator=

inline TTimeSeries< T > & operator=(
    TTimeSeries< T > && src
)

function operator=

inline TTimeSeries< T > & operator=(
    const TTimeSeries< T > & src
)

function ~TTimeSeries

inline virtual ~TTimeSeries()

function GetValueNoConst

inline T GetValueNoConst(
    const size_t & index
)

function GetValueConst

inline const T & GetValueConst(
    const size_t & index
) const

function GetValue

inline T GetValue(
    const size_t & index
)

function GetValue

inline const T & GetValue(
    const size_t & index
) const

function GetValueNoConst

inline T GetValueNoConst(
    const ptime & instant
)

function GetValue

inline T GetValue(
    const ptime & instant
)

function GetValue

inline const T & GetValue(
    const ptime & instant
) const

function GetLastValue

inline T GetLastValue()

function CopyTo

inline void CopyTo(
    T * dest,
    size_t from =0,
    size_t to =-1
) const

function CopyWithMissingValueTo

inline void CopyWithMissingValueTo(
    T * dest,
    const T & missingValueValue,
    size_t from =0,
    size_t to =-1
) const

function CopyValues

inline void CopyValues(
    const TTimeSeries< T > & src
)

function CopyTo

inline void CopyTo(
    vector< T > & dest,
    size_t from =0,
    size_t to =-1
) const

function GetValues

inline T * GetValues(
    size_t from =0,
    size_t to =std::numeric_limits< size_t >::max()
) const

function GetValuesVector

inline vector< T > GetValuesVector(
    size_t from =0,
    size_t to =std::numeric_limits< size_t >::max()
) const

function Subset

inline TTimeSeries< T > Subset(
    size_t from =0,
    size_t to =std::numeric_limits< size_t >::max()
) const

function SetValue

inline void SetValue(
    size_t index,
    T value
)

function SetValue

inline void SetValue(
    const ptime & instant,
    T value
)

function Reset

inline void Reset(
    size_t length,
    const ptime & startDate,
    const TimeStep & timeStep
)

function Reset

inline void Reset(
    size_t length,
    const ptime & startDate,
    const T * values =nullptr
)

function Reset

inline void Reset(
    size_t length,
    const ptime & startDate,
    T value
)

function Reset

inline void Reset(
    const vector< T > & values,
    const ptime & startDate
)

function Reset

inline void Reset(
    const vector< T > & values,
    const ptime & startDate,
    const TimeStep & timeStep
)

function GetLength

inline size_t GetLength() const

function GetStartDate

inline ptime GetStartDate() const

function GetEndDate

inline ptime GetEndDate() const

function GetTimeStep

inline TimeStep GetTimeStep() const

function SetTimeStep

inline void SetTimeStep(
    const TimeStep & timeStep
)

function SetStartDate

inline void SetStartDate(
    const ptime & start
)

function TimeForIndex

inline ptime TimeForIndex(
    size_t timeIndex
) const

function TimeIndices

inline vector< ptime > TimeIndices() const

function IndexForTime

inline size_t IndexForTime(
    const ptime & instant
) const

function UpperIndexForTime

inline size_t UpperIndexForTime(
    const ptime & instant
) const

function LowerIndexForTime

inline size_t LowerIndexForTime(
    const ptime & instant
) const

function GetSummary

inline string GetSummary() const

function operator[]

inline T & operator[](
    const ptime & instant
)

function operator[]

inline T & operator[](
    const size_t i
)

function operator[]

inline const T & operator[](
    const ptime & instant
) const

function operator[]

inline const T & operator[](
    const size_t i
) const

function operator+

inline TTimeSeries< T > operator+(
    const TTimeSeries< T > & rhs
) const

function operator+

inline TTimeSeries< T > operator+(
    T value
) const

function operator*

template <typename M >
inline TTimeSeries< T > operator*(
    M multiplicator
) const

function NumInstances

static inline int NumInstances()

Protected Functions Documentation

function GetNACode

inline T GetNACode() const

Public Attributes Documentation

variable Tag

string Tag;

Updated on 2022-08-21 at 18:10:33 +1000