26#include <boost/make_shared.hpp>
44 std::string
keyImpl(
const Currency& ccy,
const string&
name)
override {
return ccy.code() +
":" +
name; }
56 QuantLib::ext::shared_ptr<QuantLib::PricingEngine>
engineImpl(
const Currency& ccy,
const string&
name)
override {
57 Handle<QuantLib::BlackVolTermStructure> vol =
61 QL_REQUIRE(beta >= 0.0,
"CommoditySwaptionAnalyticalEngineBuilder: beta must be non-negative");
62 return QuantLib::ext::make_shared<QuantExt::CommoditySwaptionEngine>(yts, vol, beta);
74 QuantLib::ext::shared_ptr<QuantLib::PricingEngine>
engineImpl(
const Currency& ccy,
const string&
name)
override {
75 Handle<QuantLib::BlackVolTermStructure> vol =
79 QL_REQUIRE(beta >= 0.0,
"CommoditySwaptionAnalyticalEngineBuilder: beta must be non-negative");
82 return QuantLib::ext::make_shared<QuantExt::CommoditySwaptionMonteCarloEngine>(yts, vol, samples, beta, seed);
Abstract template engine builder class.
Abstract template EngineBuilder class that can cache engines and coupon pricers.
Analytical Approximation Engine builder for Commodity Swaptions.
QuantLib::ext::shared_ptr< QuantLib::PricingEngine > engineImpl(const Currency &ccy, const string &name) override
CommoditySwaptionAnalyticalEngineBuilder()
Engine builder for Commodity Swaptions.
CommoditySwaptionEngineBuilder(const std::string &engine)
std::string keyImpl(const Currency &ccy, const string &name) override
Monte Carlo Engine builder for Commodity Swaptions.
CommoditySwaptionMonteCarloEngineBuilder()
QuantLib::ext::shared_ptr< QuantLib::PricingEngine > engineImpl(const Currency &ccy, const string &name) override
QuantLib::ext::shared_ptr< Market > market_
const string & engine() const
Return the engine name.
std::string engineParameter(const std::string &p, const std::vector< std::string > &qualifiers={}, const bool mandatory=true, const std::string &defaultValue="") const
const string & configuration(const MarketContext &key)
Return a configuration (or the default one if key not found)
Real parseReal(const string &s)
Convert text to Real.
Integer parseInteger(const string &s)
Convert text to QuantLib::Integer.
Serializable Credit Default Swap.