42 const QuantLib::ext::shared_ptr<NPVCube>& cube1,
const QuantLib::ext::shared_ptr<NPVCube>& cube2,
43 const std::set<std::string>&
ids = {},
const bool requireUniqueIds =
true,
44 const std::function<Real(Real a, Real x)>& accumulator = [](Real a, Real x) {
return a + x; },
45 const Real accumulatorInit = 0.0);
57 const std::vector<QuantLib::ext::shared_ptr<NPVCube>>& cubes,
const std::set<std::string>&
ids = {},
58 const bool requireUniqueIds =
true,
59 const std::function<Real(Real a, Real x)>& accumulator = [](Real a, Real x) {
return a + x; },
60 const Real accumulatorInit = 0.0);
63 Size
numIds()
const override;
66 Size
depth()
const override;
68 const std::map<std::string, Size>&
idsAndIndexes()
const override;
69 const std::vector<QuantLib::Date>&
dates()
const override;
70 QuantLib::Date
asof()
const override;
72 Real
getT0(Size
id, Size
depth = 0)
const override;
75 Real
get(Size
id, Size date, Size sample, Size
depth = 0)
const override;
76 void set(Real
value, Size
id, Size date, Size sample, Size
depth = 0)
override;
79 std::set<std::pair<QuantLib::ext::shared_ptr<NPVCube>, Size>>
cubeAndId(Size
id)
const;
81 const std::vector<QuantLib::ext::shared_ptr<NPVCube>>
cubes_;
86 std::vector<std::set<std::pair<QuantLib::ext::shared_ptr<NPVCube>, Size>>>
cubeAndId_;
const std::function< Real(Real a, Real x)> accumulator_
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
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::set< std::pair< QuantLib::ext::shared_ptr< NPVCube >, Size > > cubeAndId(Size id) const
Size numIds() const override
Return the length of each dimension.
const Real accumulatorInit_
const std::vector< QuantLib::ext::shared_ptr< NPVCube > > cubes_
const std::vector< QuantLib::Date > & dates() const override
Get the vector of dates for this cube.
Size depth() const override
QuantLib::Date asof() const override
Return the asof date (T0 date)
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.
std::vector< std::set< std::pair< QuantLib::ext::shared_ptr< NPVCube >, Size > > > cubeAndId_
Real get(Size id, Size date, Size sample, Size depth=0) const override
Get a value from the cube using index.
NPV Cube class stores both future and current NPV values.
const std::set< std::string > ids() const
Get a set of all ids in the cube.
SafeStack< ValueType > value