Logo
Reference manual - version orea_version
Public Member Functions | Protected Member Functions | List of all members
NPVCube Class Referenceabstract

NPV Cube class stores both future and current NPV values. More...

#include <orea/cube/npvcube.hpp>

+ Inheritance diagram for NPVCube:

Public Member Functions

 NPVCube ()
 default ctor
 
 NPVCube (NPVCube &)=delete
 Do not allow cube copying.
 
NPVCubeoperator= (NPVCube const &)=delete
 
virtual ~NPVCube ()
 dtor
 
virtual Size numIds () const =0
 Return the length of each dimension.
 
virtual Size numDates () const =0
 
virtual Size samples () const =0
 
virtual Size depth () const =0
 
virtual const std::map< std::string, Size > & idsAndIndexes () const =0
 Get a map of id and their index position in this cube.
 
const std::set< std::string > ids () const
 Get a set of all ids in the cube.
 
virtual const std::vector< QuantLib::Date > & dates () const =0
 Get the vector of dates for this cube.
 
virtual QuantLib::Date asof () const =0
 Return the asof date (T0 date)
 
virtual Real getT0 (Size id, Size depth=0) const =0
 Get a T0 value from the cube using index.
 
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, Size id, Size depth=0)=0
 Set a value in the cube using index.
 
virtual void setT0 (Real value, const std::string &id, Size depth=0)
 Set a value in the cube using trade id.
 
virtual Real get (Size id, Size date, Size sample, Size depth=0) const =0
 Get a value from the cube using index.
 
virtual void set (Real value, Size id, Size date, Size sample, Size depth=0)=0
 Set a value in the cube using index.
 
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
 

Protected Member Functions

virtual Size index (const std::string &id) const
 
virtual Size index (const QuantLib::Date &date) const
 

Detailed Description

NPV Cube class stores both future and current NPV values.

The cube class stores future NPV values in a 4-D array.

This abstract base class is just used for the storage of a cube. This class also stores the tradeIds, dates and vector of T0 NPVs

The values in the cube must be set according to the following rules to ensure consistent behavior:

Member Function Documentation

◆ remove() [1/2]

void remove ( Size  id)
virtual

remove all values for a given id, i.e. change the state as if setT0() and set() has never been called for the id the default implementation has generelly to be overriden in derived classes depending on how values are stored

Reimplemented in JointNPVSensiCube, and SensiCube< T >.

◆ remove() [2/2]

void remove ( Size  id,
Size  sample 
)
virtual

simliar as above, but remove all values for a given id and scenario and keep T0 values

Reimplemented in JointNPVSensiCube, and SensiCube< T >.