27 const std::vector<QuantLib::ext::shared_ptr<QuantLib::Instrument>>& additionalInstruments,
28 const std::vector<Real>& additionalMultipliers)
29 : instrument_(inst), multiplier_(multiplier), additionalInstruments_(additionalInstruments),
30 additionalMultipliers_(additionalMultipliers) {
81 if (instr->isCalculated() || instr->isExpired())
83 boost::timer::cpu_timer timer_;
84 Real tmp = instr->NPV();
91 const std::vector<QuantLib::ext::shared_ptr<QuantLib::Instrument>>& additionalInstruments,
92 const std::vector<Real>& additionalMultipliers)
93 :
InstrumentWrapper(inst, multiplier, additionalInstruments, additionalMultipliers) {}
100 static std::map<std::string, boost::any> empty;
const std::vector< Real > & additionalMultipliers() const
virtual Real multiplier2() const
std::size_t getNumberOfPricings() const
Get number of pricings.
virtual QuantLib::Real NPV() const =0
Return the NPV of this instrument.
virtual bool isOption()
is it an Option?
virtual void updateQlInstruments()
call update on enclosed instrument(s)
std::size_t numberOfPricings_
const std::vector< QuantLib::ext::shared_ptr< QuantLib::Instrument > > & additionalInstruments() const
std::vector< QuantLib::ext::shared_ptr< QuantLib::Instrument > > additionalInstruments_
boost::timer::nanosecond_type cumulativePricingTime_
QuantLib::Real additionalInstrumentsNPV() const
boost::timer::nanosecond_type getCumulativePricingTime() const
Get cumulative timing spent on pricing.
Real getTimedNPV(const QuantLib::ext::shared_ptr< QuantLib::Instrument > &instr) const
std::vector< Real > additionalMultipliers_
void resetPricingStats() const
Reset pricing statistics.
QuantLib::ext::shared_ptr< QuantLib::Instrument > instrument_
QuantLib::ext::shared_ptr< QuantLib::Instrument > qlInstrument(const bool calculate=false) const
Inspectors.
VanillaInstrument(const QuantLib::ext::shared_ptr< QuantLib::Instrument > &inst, const Real multiplier=1.0, const std::vector< QuantLib::ext::shared_ptr< QuantLib::Instrument > > &additionalInstruments=std::vector< QuantLib::ext::shared_ptr< QuantLib::Instrument > >(), const std::vector< Real > &additionalMultipliers=std::vector< Real >())
QuantLib::Real NPV() const override
Return the NPV of this instrument.
const std::map< std::string, boost::any > & additionalResults() const override
Return the additional results of this instrument.
Base class for wrapper of QL instrument, used to store "state" of trade under each scenario.
Serializable Credit Default Swap.