24#ifndef quantext_black_monotone_var_vol_termstructure_hpp
25#define quantext_black_monotone_var_vol_termstructure_hpp
27#include <ql/math/array.hpp>
28#include <ql/math/interpolations/backwardflatinterpolation.hpp>
29#include <ql/math/rounding.hpp>
30#include <ql/termstructures/volatility/equityfx/blackvoltermstructure.hpp>
73 virtual void accept(AcyclicVisitor&)
override;
80 QL_REQUIRE(
timePoints_.size() > 0,
"timePoints cannot be empty");
85 var = std::max(var, vars[i - 1]);
95 return interpolation(t);
99 Handle<BlackVolTermStructure>
vol_;
104 bool operator()(
const double& left,
const double& right)
const {
105 return left < right && !QuantLib::close_enough(left, right);
114 Visitor<BlackMonotoneVarVolTermStructure>* v1 =
dynamic_cast<Visitor<BlackMonotoneVarVolTermStructure>*
>(&v);
bool operator()(const double &left, const double &right) const
Black volatility surface that monotonises the variance in an existing surface.
Calendar calendar() const override
BlackMonotoneVarVolTermStructure(const Handle< BlackVolTermStructure > &vol, const std::vector< Time > &timePoints)
Constructor takes a BlackVolTermStructure and an array of time points which required monotonic varian...
const Handle< BlackVolTermStructure > & underlyingVol() const
return the underlying vol surface
std::map< Real, std::vector< Real >, closeDouble > monoVars_
Real getMonotoneVar(const Time &t, const Real &strike) const
Handle< BlackVolTermStructure > vol_
const Date & referenceDate() const override
Real minStrike() const override
virtual void accept(AcyclicVisitor &) override
virtual Volatility blackVolImpl(Time t, Real strike) const override
Natural settlementDays() const override
Date maxDate() const override
virtual Real blackVarianceImpl(Time t, Real strike) const override
Real maxStrike() const override
std::vector< Time > timePoints_
void setMonotoneVar(const Real &strike) const