Logo
Reference manual - version orea_version
Public Member Functions | List of all members
InMemoryCube1< T > Class Template Reference

InMemoryCube of fixed depth 1. More...

#include <orea/cube/inmemorycube.hpp>

+ Inheritance diagram for InMemoryCube1< T >:

Public Member Functions

 InMemoryCube1 (const Date &asof, const std::set< std::string > &ids, const vector< Date > &dates, Size samples, const T &t=T())
 ctor
 
 InMemoryCube1 ()
 default
 
Size depth () const override
 Fixed depth.
 
virtual Real getT0 (Size i, Size d) const override
 Get a T0 value from the cube.
 
virtual void setT0 (Real value, Size i, Size d) override
 Set a value in the cube.
 
Real get (Size i, Size j, Size k, Size d) const override
 Get a value from the cube.
 
void set (Real value, Size i, Size j, Size k, Size d) override
 Set a value in the cube.
 
- Public Member Functions inherited from InMemoryCubeBase< T >
 InMemoryCubeBase (const Date &asof, const std::set< std::string > &ids, const vector< Date > &dates, Size samples, const T &t=T())
 default ctor
 
 InMemoryCubeBase ()
 default constructor
 
Size numIds () const override
 Return the length of each dimension.
 
Size numDates () const override
 
virtual Size samples () const override
 
const std::map< std::string, Size > & idsAndIndexes () const override
 Return a map of all ids and their position in the cube.
 
const std::vector< QuantLib::Date > & dates () const override
 Get the vector of dates for this cube.
 
QuantLib::Date asof () const override
 Return the asof date (T0 date)
 
- Public Member Functions inherited from NPVCube
 NPVCube ()
 default ctor
 
 NPVCube (NPVCube &)=delete
 Do not allow cube copying.
 
NPVCubeoperator= (NPVCube const &)=delete
 
virtual ~NPVCube ()
 dtor
 
const std::set< std::string > ids () const
 Get a set of all ids in the cube.
 
virtual Real getT0 (const std::string &id, Size depth=0) const
 Get a T0 value from the cube using trade id.
 
virtual void setT0 (Real value, const std::string &id, Size depth=0)
 Set a value in the cube using trade id.
 
virtual Real get (const std::string &id, const QuantLib::Date &date, Size sample, Size depth=0) const
 Get a value from the cube using trade id and date.
 
virtual void set (Real value, const std::string &id, const QuantLib::Date &date, Size sample, Size depth=0)
 Set a value in the cube using trade id and date.
 
virtual void remove (Size id)
 
virtual void remove (Size id, Size sample)
 
Size getTradeIndex (const std::string &id) const
 

Additional Inherited Members

- Protected Member Functions inherited from InMemoryCubeBase< T >
void check (Size i, Size j, Size k, Size d) const
 
- Protected Member Functions inherited from NPVCube
virtual Size index (const std::string &id) const
 
virtual Size index (const QuantLib::Date &date) const
 
- Protected Attributes inherited from InMemoryCubeBase< T >
QuantLib::Date asof_
 
vector< QuantLib::Date > dates_
 
Size samples_
 
vector< T > t0Data_
 
vector< vector< vector< T > > > data_
 
std::map< std::string, Size > idIdx_
 

Detailed Description

template<typename T>
class ore::analytics::InMemoryCube1< T >

InMemoryCube of fixed depth 1.

This implementation stores the type directly in an InMemoryCubeBase to avoid us having nested vectors all of length 1