19#include <ql/exercise.hpp>
20#include <ql/pricingengines/blackcalculator.hpp>
33 QuantLib::AnalyticEuropeanEngine::calculate();
39 auto resToInvert = vector<string>({
"spot",
"forward",
"strike"});
40 for (
const string& res : resToInvert) {
41 auto it =
results_.additionalResults.find(res);
42 if (it !=
results_.additionalResults.end())
43 it->second = 1. / boost::any_cast<Real>(it->second);
48 Real rfDiscount = Null<Real>();
49 Real divDiscount = Null<Real>();
51 if (
auto tmp =
results_.additionalResults.find(
"riskFreeDiscount"); tmp !=
results_.additionalResults.end())
52 rfDiscount = boost::any_cast<Real>(tmp->second);
53 if (
auto tmp =
results_.additionalResults.find(
"dividendDiscount"); tmp !=
results_.additionalResults.end())
54 divDiscount = boost::any_cast<Real>(tmp->second);
56 results_.additionalResults[
"riskFreeDiscount"] = divDiscount;
57 results_.additionalResults[
"dividendDiscount"] = rfDiscount;
Wrapper of QuantLib analytic European engine to allow for flipping back some of the additional result...
const Instrument::results * results_
void calculate() const override