NPV Cube class stores both future and current NPV values. More...
#include <orea/cube/npvcube.hpp>
Public Member Functions | |
NPVCube () | |
default ctor More... | |
NPVCube (NPVCube &)=delete | |
Do not allow cube copying. More... | |
NPVCube & | operator= (NPVCube const &)=delete |
virtual | ~NPVCube () |
dtor More... | |
virtual Size | numIds () const =0 |
Return the length of each dimension. More... | |
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. More... | |
const std::set< std::string > | ids () const |
Get a set of all ids in the cube. More... | |
virtual const std::vector< QuantLib::Date > & | dates () const =0 |
Get the vector of dates for this cube. More... | |
virtual QuantLib::Date | asof () const =0 |
Return the asof date (T0 date) More... | |
virtual Real | getT0 (Size id, Size depth=0) const =0 |
Get a T0 value from the cube using index. More... | |
virtual Real | getT0 (const std::string &id, Size depth=0) const |
Get a T0 value from the cube using trade id. More... | |
virtual void | setT0 (Real value, Size id, Size depth=0)=0 |
Set a value in the cube using index. More... | |
virtual void | setT0 (Real value, const std::string &id, Size depth=0) |
Set a value in the cube using trade id. More... | |
virtual Real | get (Size id, Size date, Size sample, Size depth=0) const =0 |
Get a value from the cube using index. More... | |
virtual void | set (Real value, Size id, Size date, Size sample, Size depth=0)=0 |
Set a value in the cube using index. More... | |
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. More... | |
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. More... | |
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 |
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:
Definition at line 53 of file npvcube.hpp.
NPVCube | ( | ) |
|
virtual |
|
pure virtual |
Return the length of each dimension.
Implemented in InMemoryCubeBase< T >, InMemoryCubeBase< vector< T > >, JaggedCube< T >, JointNPVCube, JointNPVSensiCube, SensiCube< T >, and SparseNpvCube< T >.
|
pure virtual |
Implemented in InMemoryCubeBase< T >, InMemoryCubeBase< vector< T > >, JaggedCube< T >, JointNPVCube, JointNPVSensiCube, NPVSensiCube, and SparseNpvCube< T >.
|
pure virtual |
Implemented in InMemoryCubeBase< T >, InMemoryCubeBase< vector< T > >, JaggedCube< T >, JointNPVCube, JointNPVSensiCube, SensiCube< T >, and SparseNpvCube< T >.
|
pure virtual |
Implemented in InMemoryCube1< T >, InMemoryCubeN< T >, JaggedCube< T >, JointNPVCube, JointNPVSensiCube, NPVSensiCube, and SparseNpvCube< T >.
|
pure virtual |
Get a map of id and their index position in this cube.
Implemented in InMemoryCubeBase< T >, InMemoryCubeBase< vector< T > >, JaggedCube< T >, JointNPVCube, JointNPVSensiCube, SensiCube< T >, and SparseNpvCube< T >.
const std::set< std::string > ids | ( | ) | const |
Get a set of all ids in the cube.
Definition at line 75 of file npvcube.hpp.
|
pure virtual |
Get the vector of dates for this cube.
Implemented in InMemoryCubeBase< T >, InMemoryCubeBase< vector< T > >, JaggedCube< T >, JointNPVCube, JointNPVSensiCube, SensiCube< T >, and SparseNpvCube< T >.
|
pure virtual |
Return the asof date (T0 date)
Implemented in InMemoryCubeBase< T >, InMemoryCubeBase< vector< T > >, JaggedCube< T >, JointNPVCube, JointNPVSensiCube, SensiCube< T >, and SparseNpvCube< T >.
|
pure virtual |
Get a T0 value from the cube using index.
Implemented in InMemoryCube1< T >, InMemoryCubeN< T >, JaggedCube< T >, SparseNpvCube< T >, SensiCube< T >, JointNPVCube, and JointNPVSensiCube.
|
virtual |
Get a T0 value from the cube using trade id.
Definition at line 91 of file npvcube.hpp.
|
pure virtual |
Set a value in the cube using index.
Implemented in InMemoryCube1< T >, InMemoryCubeN< T >, JaggedCube< T >, SparseNpvCube< T >, SensiCube< T >, JointNPVCube, and JointNPVSensiCube.
|
virtual |
Set a value in the cube using trade id.
Definition at line 95 of file npvcube.hpp.
|
pure virtual |
Get a value from the cube using index.
Implemented in InMemoryCube1< T >, InMemoryCubeN< T >, JaggedCube< T >, SparseNpvCube< T >, SensiCube< T >, JointNPVCube, JointNPVSensiCube, and NPVSensiCube.
|
pure virtual |
Set a value in the cube using index.
Implemented in InMemoryCube1< T >, InMemoryCubeN< T >, JaggedCube< T >, SparseNpvCube< T >, SensiCube< T >, JointNPVCube, JointNPVSensiCube, and NPVSensiCube.
|
virtual |
Get a value from the cube using trade id and date.
Reimplemented in NPVSensiCube.
Definition at line 103 of file npvcube.hpp.
|
virtual |
Set a value in the cube using trade id and date.
Reimplemented in NPVSensiCube.
Definition at line 107 of file npvcube.hpp.
|
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 SensiCube< T >, and JointNPVSensiCube.
Definition at line 137 of file npvcube.hpp.
|
virtual |
simliar as above, but remove all values for a given id and scenario and keep T0 values
Reimplemented in SensiCube< T >, and JointNPVSensiCube.
Definition at line 148 of file npvcube.hpp.
Size getTradeIndex | ( | const std::string & | id | ) | const |
|
protectedvirtual |
Definition at line 121 of file npvcube.hpp.
|
protectedvirtual |
Definition at line 127 of file npvcube.hpp.