25#include <ql/errors.hpp>
31 const QuantLib::ext::shared_ptr<ore::analytics::ScenarioFactory>& scenarioFactory)
32 : baseScenario_(baseScenario), scenarioFactory_(scenarioFactory) {
33 QL_REQUIRE(
baseScenario_ !=
nullptr,
"DeltaScenarioFactory: base scenario pointer must not be NULL");
34 QL_REQUIRE(
scenarioFactory_ !=
nullptr,
"DeltaScenarioFactory: scenario factory must not be NULL");
37const QuantLib::ext::shared_ptr<ore::analytics::Scenario>
39 QuantLib::Real numeraire)
const {
41 "unexpected asof date (" <<
asof <<
"), does not match base - " <<
baseScenario_->asof());
42 QuantLib::ext::shared_ptr<ore::analytics::Scenario> incremental =
44 QL_REQUIRE((label == incremental->label()) || (label ==
""),
"DeltaScenarioFactory has not updated scenario label");
45 return QuantLib::ext::make_shared<DeltaScenario>(
baseScenario_, incremental);
const QuantLib::ext::shared_ptr< ore::analytics::Scenario > buildScenario(QuantLib::Date asof, bool isAbsolute, const std::string &label="", QuantLib::Real numeraire=0.0) const override
returns a new scenario, using the base scenario as a starting point
DeltaScenarioFactory(const QuantLib::ext::shared_ptr< ore::analytics::Scenario > &baseScenario, const QuantLib::ext::shared_ptr< ore::analytics::ScenarioFactory > &scenarioFactory=QuantLib::ext::make_shared< ore::analytics::SimpleScenarioFactory >(false))
Constructor.
QuantLib::ext::shared_ptr< ore::analytics::ScenarioFactory > scenarioFactory_
QuantLib::ext::shared_ptr< ore::analytics::Scenario > baseScenario_
factory class for cloning a cached scenario