NPV Cube class stores both future and current NPV values. More...
#include <orea/cube/npvcube.hpp>
Public Member Functions | |
| NPVCube () | |
| default ctor | |
| NPVCube (NPVCube &)=delete | |
| Do not allow cube copying. | |
| NPVCube & | operator= (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 | removeT0 (Size id) |
| virtual void | remove (Size id, Size sample, bool setToT0Value) |
| Size | getTradeIndex (const std::string &id) const |
| Size | getDateIndex (const QuantLib::Date &date) const |
| virtual bool | usesDoublePrecision () const =0 |
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:
|
pure virtual |
Return the length of each dimension.
Implemented in InMemoryCubeOpt< T >, InMemoryCubeOpt< double >, InMemoryCubeOpt< float >, JaggedCube< T >, JaggedCube< double >, JaggedCube< float >, JointNPVCube, JointNPVSensiCube, SensiCube, SparseNpvCube< T >, SparseNpvCube< float >, and SparseNpvCube< Real >.
|
pure virtual |
Implemented in NPVSensiCube.
|
pure virtual |
Implemented in NPVSensiCube.
|
pure virtual |
Get a map of id and their index position in this cube.
Implemented in InMemoryCubeOpt< T >, InMemoryCubeOpt< double >, InMemoryCubeOpt< float >, JaggedCube< T >, JaggedCube< double >, JaggedCube< float >, JointNPVCube, JointNPVSensiCube, SensiCube, SparseNpvCube< T >, SparseNpvCube< float >, and SparseNpvCube< Real >.
|
pure virtual |
Get the vector of dates for this cube.
Implemented in InMemoryCubeOpt< T >, InMemoryCubeOpt< double >, InMemoryCubeOpt< float >, JaggedCube< T >, JaggedCube< double >, JaggedCube< float >, JointNPVCube, JointNPVSensiCube, SensiCube, SparseNpvCube< T >, SparseNpvCube< float >, and SparseNpvCube< Real >.
|
pure virtual |
Return the asof date (T0 date).
Implemented in InMemoryCubeOpt< T >, InMemoryCubeOpt< double >, InMemoryCubeOpt< float >, JaggedCube< T >, JaggedCube< double >, JaggedCube< float >, JointNPVCube, JointNPVSensiCube, SensiCube, SparseNpvCube< T >, SparseNpvCube< float >, and SparseNpvCube< Real >.
|
pure virtual |
Get a T0 value from the cube using index.
Implemented in InMemoryCubeOpt< T >, InMemoryCubeOpt< double >, InMemoryCubeOpt< float >, JaggedCube< T >, JaggedCube< double >, JaggedCube< float >, JointNPVCube, JointNPVSensiCube, SensiCube, SparseNpvCube< T >, SparseNpvCube< float >, and SparseNpvCube< Real >.
|
pure virtual |
Set a value in the cube using index.
Implemented in InMemoryCubeOpt< T >, InMemoryCubeOpt< double >, InMemoryCubeOpt< float >, JaggedCube< T >, JaggedCube< double >, JaggedCube< float >, JointNPVCube, JointNPVSensiCube, SensiCube, SparseNpvCube< T >, SparseNpvCube< float >, and SparseNpvCube< Real >.
|
pure virtual |
Get a value from the cube using index.
Implemented in InMemoryCubeOpt< T >, InMemoryCubeOpt< double >, InMemoryCubeOpt< float >, JaggedCube< T >, JaggedCube< double >, JaggedCube< float >, JointNPVCube, JointNPVSensiCube, NPVSensiCube, SensiCube, SparseNpvCube< T >, SparseNpvCube< float >, and SparseNpvCube< Real >.
|
pure virtual |
Set a value in the cube using index.
Implemented in InMemoryCubeOpt< T >, InMemoryCubeOpt< double >, InMemoryCubeOpt< float >, JaggedCube< T >, JaggedCube< double >, JaggedCube< float >, JointNPVCube, JointNPVSensiCube, NPVSensiCube, SensiCube, SparseNpvCube< T >, SparseNpvCube< float >, and SparseNpvCube< Real >.
|
virtual |
Get a value from the cube using trade id and date.
Reimplemented in NPVSensiCube.
|
virtual |
Set a value in the cube using trade id and date.
Reimplemented in NPVSensiCube.
|
virtual |
Remove t0 values for a given id
Reimplemented in JointNPVSensiCube, and SensiCube.
|
virtual |
Set non-t0 value to either 0 or the t0 value for a given id and sample. If sample is null, all samples are removed
Reimplemented in JointNPVSensiCube, and SensiCube.