#include <orea/scenario/simplescenario.hpp>
Classes | |
struct | SharedData |
Public Member Functions | |
SimpleScenario (Date asof, const std::string &label=std::string(), Real numeraire=0, const boost::shared_ptr< SharedData > &sharedData=nullptr) | |
if sharedData is not provided, the instance will create its own shared data block | |
const Date & | asof () const override |
Return the scenario asof date. | |
void | setAsof (const Date &d) override |
Set the asof date. | |
const std::string & | label () const override |
Get the scenario label. | |
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) ]. | |
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) ]. | |
bool | isAbsolute () const override |
Is this an absolute or difference scenario? | |
const std::map< std::pair< RiskFactorKey::KeyType, std::string >, std::vector< std::vector< Real > > > & | coordinates () const override |
Get coordinates. | |
std::size_t | keysHash () const override |
return fingerprint identifying the set of rf keys of the scenarios, or 0 if not provided by the implementation | |
bool | has (const RiskFactorKey &key) const override |
Check whether this scenario provides the data for the given key. | |
const std::vector< RiskFactorKey > & | keys () const override |
Risk factor keys for which this scenario provides data. | |
void | add (const RiskFactorKey &key, Real value) override |
Add an element to the scenario. | |
Real | get (const RiskFactorKey &key) const override |
Get an element from the scenario. | |
QuantLib::ext::shared_ptr< Scenario > | clone () const override |
This does not close the shared data. | |
void | setAbsolute (const bool isAbsolute) override |
Set if this is an absolute scenario. | |
void | setCoordinates (const RiskFactorKey::KeyType type, const std::string &name, const std::vector< std::vector< Real >> &coordinates) |
const boost::shared_ptr< SharedData > & | sharedData () const |
get shared data block (for construction of sister scenarios) | |
const std::vector< Real > & | data () const |
get data, order is the same as in keys() | |
Public Member Functions inherited from Scenario | |
virtual | ~Scenario () |
Destructor. | |
virtual bool | isCloseEnough (const QuantLib::ext::shared_ptr< Scenario > &s) const |
checks for equality up to numerical differences | |
Simple Scenario class