22#include <ql/errors.hpp>
23#include <ql/utilities/null.hpp>
25#include <boost/make_shared.hpp>
31 const boost::shared_ptr<SharedData>& sharedData)
33 label_(label), numeraire_(numeraire) {}
42 dataIndex = i->second;
49 if (
data_.size() <= dataIndex)
50 data_.resize(dataIndex + 1, QuantLib::Null<Real>());
57 QL_REQUIRE(i !=
sharedData_->keyIndex.end(),
"SimpleScenario does not provide data for key " << key);
58 return data_[i->second];
62 return QuantLib::ext::make_shared<SimpleScenario>(*
this);
68 const std::vector<std::vector<Real>>& coordinates) {
Data types stored in the scenario class.
KeyType
Risk Factor types.
const std::map< std::pair< RiskFactorKey::KeyType, std::string >, std::vector< std::vector< Real > > > & coordinates() const override
Get coordinates.
void setCoordinates(const RiskFactorKey::KeyType type, const std::string &name, const std::vector< std::vector< Real > > &coordinates)
QuantLib::ext::shared_ptr< Scenario > clone() const override
This does not close the shared data.
Real get(const RiskFactorKey &key) const override
Get an element from the scenario.
void add(const RiskFactorKey &key, Real value) override
Add an element to the scenario.
QuantLib::ext::shared_ptr< SharedData > sharedData_
void setAbsolute(const bool isAbsolute) override
Set if this is an absolute scenario.
bool isAbsolute() const override
Is this an absolute or difference scenario?
bool has(const RiskFactorKey &key) const override
Check whether this scenario provides the data for the given key.
std::vector< Real > data_
SafeStack< ValueType > value