36 Real result = (*payoff_)(temp);
49 : process_(
std::move(process)) {
56 "not an European Option");
58 ext::shared_ptr<StrikedTypePayoff>
payoff =
59 ext::dynamic_pointer_cast<StrikedTypePayoff>(arguments_.payoff);
63 process_->blackVolatility()->blackVariance(
64 arguments_.exercise->lastDate(),
payoff->strike());
68 arguments_.exercise->lastDate());
70 process_->riskFreeRate()->discount(arguments_.exercise->lastDate());
71 Rate drift = std::log(dividendDiscount/riskFreeDiscount)-0.5*
variance;
73 Integrand
f(arguments_.payoff,
81 arguments_.exercise->lastDate()) /
83 integrator(
f, drift-infinity, drift+infinity);
const Instrument::results * results_
void calculate() const override
IntegralEngine(ext::shared_ptr< GeneralizedBlackScholesProcess >)
ext::shared_ptr< GeneralizedBlackScholesProcess > process_
Integral of a one-dimensional function.
#define QL_REQUIRE(condition, message)
throw an error if the given pre-condition is not verified
Option exercise classes and payoff function.
LinearInterpolation variance
const ext::shared_ptr< Payoff > payoff_
Real DiscountFactor
discount factor between dates
ext::shared_ptr< QuantLib::Payoff > payoff
Integral of a one-dimensional function using segment algorithm.