41 JointNPVSensiCube(
const QuantLib::ext::shared_ptr<NPVSensiCube>& cube1,
const QuantLib::ext::shared_ptr<NPVSensiCube>& cube2,
42 const std::set<std::string>&
ids = {});
48 JointNPVSensiCube(
const std::vector<QuantLib::ext::shared_ptr<NPVSensiCube>>& cubes,
49 const std::set<std::string>&
ids = {});
52 Size
numIds()
const override;
55 Size
depth()
const override;
57 const std::map<std::string, Size>&
idsAndIndexes()
const override;
58 const std::vector<QuantLib::Date>&
dates()
const override;
59 QuantLib::Date
asof()
const override;
61 Real
getT0(Size
id, Size
depth = 0)
const override;
64 Real
get(Size
id, Size date, Size sample, Size
depth = 0)
const override;
65 void set(Real
value, Size
id, Size date, Size sample, Size
depth = 0)
override;
67 std::map<QuantLib::Size, QuantLib::Real>
getTradeNPVs(Size tradeIdx)
const override;
70 void remove(Size
id)
override;
71 void remove(Size
id, Size sample)
override;
74 const std::pair<QuantLib::ext::shared_ptr<NPVSensiCube>, Size>&
cubeAndId(Size
id)
const;
76 std::vector<std::pair<QuantLib::ext::shared_ptr<NPVSensiCube>, Size>>
cubeAndId_;
77 const std::vector<QuantLib::ext::shared_ptr<NPVSensiCube>>
cubes_;
void set(Real value, Size id, Size date, Size sample, Size depth=0) override
Set a value in the cube using index.
Size numDates() const override
std::set< QuantLib::Size > relevantScenarios() const override
const std::map< std::string, Size > & idsAndIndexes() const override
Get a map of id and their index position in this cube.
Real getT0(Size id, Size depth=0) const override
Get a T0 value from the cube using index.
std::vector< std::pair< QuantLib::ext::shared_ptr< NPVSensiCube >, Size > > cubeAndId_
Size numIds() const override
Return the length of each dimension.
const std::pair< QuantLib::ext::shared_ptr< NPVSensiCube >, Size > & cubeAndId(Size id) const
const std::vector< QuantLib::ext::shared_ptr< NPVSensiCube > > cubes_
const std::vector< QuantLib::Date > & dates() const override
Get the vector of dates for this cube.
Size depth() const override
void remove(Size id) override
QuantLib::Date asof() const override
Return the asof date (T0 date)
std::map< QuantLib::Size, QuantLib::Real > getTradeNPVs(Size tradeIdx) const override
std::map< std::string, Size > idIdx_
Size samples() const override
void setT0(Real value, Size id, Size depth=0) override
Set a value in the cube using index.
Real get(Size id, Size date, Size sample, Size depth=0) const override
Get a value from the cube using index.
const std::set< std::string > ids() const
Get a set of all ids in the cube.
NPVSensiCube class stores NPVs resulting from risk factor shifts on an as of date.
SafeStack< ValueType > value
An NPV cube for storing NPVs resulting from risk factor shifts.