37 std::vector<RiskFactorKey>
keys;
39 std::map<std::pair<RiskFactorKey::KeyType, std::string>, std::vector<std::vector<Real>>>
coordinates;
46 const boost::shared_ptr<SharedData>&
sharedData =
nullptr);
58 const std::map<std::pair<RiskFactorKey::KeyType, std::string>, std::vector<std::vector<Real>>>&
66 const std::vector<RiskFactorKey>&
keys()
const override {
return sharedData_->keys; }
71 QuantLib::ext::shared_ptr<Scenario>
clone()
const override;
81 const std::vector<Real>&
data()
const {
return data_; }
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.
std::size_t keysHash() const override
return fingerprint identifying the set of rf keys of the scenarios, or 0 if not provided by the imple...
const boost::shared_ptr< SharedData > & sharedData() const
get shared data block (for construction of sister scenarios)
const std::string & label() const override
Get the scenario label.
void add(const RiskFactorKey &key, Real value) override
Add an element to the scenario.
QuantLib::ext::shared_ptr< SharedData > sharedData_
const Date & asof() const override
Return the scenario asof date.
const std::vector< Real > & data() const
get data, order is the same as in keys()
void setAbsolute(const bool isAbsolute) override
Set if this is an absolute scenario.
bool isAbsolute() const override
Is this an absolute or difference scenario?
void setAsof(const Date &d) override
Set the asof date.
const std::vector< RiskFactorKey > & keys() const override
Risk factor keys for which this scenario provides data.
void setNumeraire(Real n) override
Set the Numeraire ratio n = N(t) / N(0) so that Price(0) = N(0) * E [Price(t) / N(t) ].
void label(const string &s) override
Set the scenario label.
Real getNumeraire() const override
Get Numeraire ratio n = N(t) / N(0) so that Price(0) = N(0) * E [Price(t) / N(t) ].
bool has(const RiskFactorKey &key) const override
Check whether this scenario provides the data for the given key.
std::vector< Real > data_
std::vector< RiskFactorKey > keys
std::map< std::pair< RiskFactorKey::KeyType, std::string >, std::vector< std::vector< Real > > > coordinates
std::map< RiskFactorKey, std::size_t > keyIndex