50 std::ostringstream result;
62 QL_FAIL(
"floating payoff not handled");
68 return std::max<Real>(price - strike,0.0);
70 return std::max<Real>(strike - price,0.0);
72 QL_FAIL(
"unknown/illegal option type");
77 std::ostringstream result;
94 return std::max<Real>(price-
strike_,0.0);
96 return std::max<Real>(
strike_-price,0.0);
98 QL_FAIL(
"unknown/illegal option type");
113 return price*std::max<Real>(
Real(1.0)-
strike_,0.0);
115 return price*std::max<Real>(
strike_-
Real(1.0),0.0);
117 QL_FAIL(
"unknown/illegal option type");
132 return (price-
strike_ > 0.0 ? price : 0.0);
134 return (
strike_-price > 0.0 ? price : 0.0);
136 QL_FAIL(
"unknown/illegal option type");
149 std::ostringstream result;
161 QL_FAIL(
"unknown/illegal option type");
173 std::ostringstream result;
185 QL_FAIL(
"unknown/illegal option type");
209 std::ostringstream result;
degenerate base class for the Acyclic Visitor pattern
Real operator()(Real price) const override
void accept(AcyclicVisitor &) override
Real operator()(Real price) const override
std::string description() const override
void accept(AcyclicVisitor &) override
void accept(AcyclicVisitor &) override
Real operator()(Real price, Real strike) const
Real operator()(Real price) const override
std::string description() const override
void accept(AcyclicVisitor &) override
Real secondStrike() const
Real operator()(Real price) const override
std::string description() const override
void accept(AcyclicVisitor &) override
std::string name() const override
virtual void accept(AcyclicVisitor &)
virtual std::string name() const =0
Real operator()(Real price) const override
void accept(AcyclicVisitor &) override
Real operator()(Real price) const override
void accept(AcyclicVisitor &) override
std::string description() const override
Real operator()(Real price) const override
void accept(AcyclicVisitor &) override
Real operator()(Real price) const override
std::string description() const override
void accept(AcyclicVisitor &) override
Real secondStrike() const
std::string description() const override
Option::Type optionType() const
Visitor for a specific class
virtual void visit(T &)=0
#define QL_FAIL(message)
throw an error (possibly with file and line information)
Payoffs for various options.
ext::shared_ptr< BlackVolTermStructure > v