28#include <ql/time/date.hpp>
47class CounterpartyCalculator;
48class ValuationCalculator;
74 const QuantLib::Date& today,
76 const QuantLib::ext::shared_ptr<ore::data::DateGrid>& dg,
78 const QuantLib::ext::shared_ptr<analytics::SimMarket>& simMarket,
80 const set<std::pair<std::string, QuantLib::ext::shared_ptr<QuantExt::ModelBuilder>>>& modelBuilders =
81 set<std::pair<std::string, QuantLib::ext::shared_ptr<QuantExt::ModelBuilder>>>());
86 const QuantLib::ext::shared_ptr<data::Portfolio>& portfolio,
88 QuantLib::ext::shared_ptr<analytics::NPVCube> outputCube,
90 std::vector<QuantLib::ext::shared_ptr<ValuationCalculator>> calculators,
92 bool mporStickyDate =
true,
94 QuantLib::ext::shared_ptr<analytics::NPVCube> outputCubeNettingSet =
nullptr,
96 QuantLib::ext::shared_ptr<analytics::NPVCube> outputCptyCube =
nullptr,
98 std::vector<QuantLib::ext::shared_ptr<CounterpartyCalculator>> cptyCalculators = {},
100 bool dryRun =
false);
104 std::pair<double, double>
populateCube(
const QuantLib::Date& d,
size_t cubeDateIndex,
size_t sample,
105 bool isValueDate,
bool isStickyDate,
bool scenarioUpdated,
106 const std::map<std::string, QuantLib::ext::shared_ptr<ore::data::Trade>>& trades,
107 std::vector<bool>& tradeHasError,
108 const std::vector<QuantLib::ext::shared_ptr<ValuationCalculator>>& calculators,
109 QuantLib::ext::shared_ptr<analytics::NPVCube>& outputCube,
110 QuantLib::ext::shared_ptr<analytics::NPVCube>& outputCubeNettingSet,
111 const std::map<std::string, size_t>& counterparties,
112 const std::vector<QuantLib::ext::shared_ptr<CounterpartyCalculator>>& cptyCalculators,
113 QuantLib::ext::shared_ptr<analytics::NPVCube>& outputCptyCube);
114 void runCalculators(
bool isCloseOutDate,
const std::map<std::string, QuantLib::ext::shared_ptr<ore::data::Trade>>& trades,
115 std::vector<bool>& tradeHasError,
116 const std::vector<QuantLib::ext::shared_ptr<ValuationCalculator>>& calculators,
117 QuantLib::ext::shared_ptr<analytics::NPVCube>& outputCube,
118 QuantLib::ext::shared_ptr<analytics::NPVCube>& outputCubeSensis,
const QuantLib::Date& d,
119 const QuantLib::Size cubeDateIndex,
const QuantLib::Size sample,
const std::string& label =
"");
120 void runCalculators(
bool isCloseOutDate,
const std::map<std::string, QuantLib::Size>& counterparties,
121 const std::vector<QuantLib::ext::shared_ptr<CounterpartyCalculator>>& calculators,
122 QuantLib::ext::shared_ptr<analytics::NPVCube>& cptyCube,
const QuantLib::Date& d,
123 const QuantLib::Size cubeDateIndex,
const QuantLib::Size sample);
124 void tradeExercisable(
bool enable,
const std::map<std::string, QuantLib::ext::shared_ptr<ore::data::Trade>>& trades);
126 QuantLib::ext::shared_ptr<ore::data::DateGrid>
dg_;
127 QuantLib::ext::shared_ptr<ore::analytics::SimMarket>
simMarket_;
128 set<std::pair<std::string, QuantLib::ext::shared_ptr<QuantExt::ModelBuilder>>>
modelBuilders_;
void runCalculators(bool isCloseOutDate, const std::map< std::string, QuantLib::Size > &counterparties, const std::vector< QuantLib::ext::shared_ptr< CounterpartyCalculator > > &calculators, QuantLib::ext::shared_ptr< analytics::NPVCube > &cptyCube, const QuantLib::Date &d, const QuantLib::Size cubeDateIndex, const QuantLib::Size sample)
QuantLib::ext::shared_ptr< ore::data::DateGrid > dg_
QuantLib::ext::shared_ptr< ore::analytics::SimMarket > simMarket_
std::pair< double, double > populateCube(const QuantLib::Date &d, size_t cubeDateIndex, size_t sample, bool isValueDate, bool isStickyDate, bool scenarioUpdated, const std::map< std::string, QuantLib::ext::shared_ptr< ore::data::Trade > > &trades, std::vector< bool > &tradeHasError, const std::vector< QuantLib::ext::shared_ptr< ValuationCalculator > > &calculators, QuantLib::ext::shared_ptr< analytics::NPVCube > &outputCube, QuantLib::ext::shared_ptr< analytics::NPVCube > &outputCubeNettingSet, const std::map< std::string, size_t > &counterparties, const std::vector< QuantLib::ext::shared_ptr< CounterpartyCalculator > > &cptyCalculators, QuantLib::ext::shared_ptr< analytics::NPVCube > &outputCptyCube)
set< std::pair< std::string, QuantLib::ext::shared_ptr< QuantExt::ModelBuilder > > > modelBuilders_
void buildCube(const QuantLib::ext::shared_ptr< data::Portfolio > &portfolio, QuantLib::ext::shared_ptr< analytics::NPVCube > outputCube, std::vector< QuantLib::ext::shared_ptr< ValuationCalculator > > calculators, bool mporStickyDate=true, QuantLib::ext::shared_ptr< analytics::NPVCube > outputCubeNettingSet=nullptr, QuantLib::ext::shared_ptr< analytics::NPVCube > outputCptyCube=nullptr, std::vector< QuantLib::ext::shared_ptr< CounterpartyCalculator > > cptyCalculators={}, bool dryRun=false)
Build NPV cube.
void runCalculators(bool isCloseOutDate, const std::map< std::string, QuantLib::ext::shared_ptr< ore::data::Trade > > &trades, std::vector< bool > &tradeHasError, const std::vector< QuantLib::ext::shared_ptr< ValuationCalculator > > &calculators, QuantLib::ext::shared_ptr< analytics::NPVCube > &outputCube, QuantLib::ext::shared_ptr< analytics::NPVCube > &outputCubeSensis, const QuantLib::Date &d, const QuantLib::Size cubeDateIndex, const QuantLib::Size sample, const std::string &label="")
void tradeExercisable(bool enable, const std::map< std::string, QuantLib::ext::shared_ptr< ore::data::Trade > > &trades)