50 QL_REQUIRE(center > 0.0,
"negative or null underlying given");
51 QL_REQUIRE(
t > 0.0,
"negative or zero residual time");
64 Real prefactor = 1.0 + 0.02/volSqrtTime;
65 Real minMaxFactor = std::exp(4.0 * prefactor * volSqrtTime);
72 ext::shared_ptr<StrikedTypePayoff> striked_payoff =
73 ext::dynamic_pointer_cast<StrikedTypePayoff>(
payoff_);
76 Real requiredGridValue = striked_payoff->strike();
108 ext::shared_ptr<StrikedTypePayoff> striked_payoff =
109 ext::dynamic_pointer_cast<StrikedTypePayoff>(
payoff_);
110 Real K = striked_payoff !=
nullptr ? striked_payoff->strike() :
process_->x0();
139 Time residualTime)
const {
140 static const Size minGridPoints = 10;
141 static const Size minGridPointsPerYear = 2;
142 return std::max(gridPoints,
144 static_cast<Size>((minGridPoints +
146 minGridPointsPerYear))
differential operator for Black-Scholes-Merton equation
differential operator for Black-Scholes-Merton equation
Black-Scholes-Merton differential operator.
virtual void initializeOperator() const
void ensureStrikeInGrid() const
virtual void setGridLimits() const
TridiagonalOperator finiteDifferenceOperator_
virtual void initializeInitialCondition() const
QL_DEPRECATED_DISABLE_WARNING SampledCurve intrinsicValues_
std::vector< ext::shared_ptr< bc_type > > BCs_
ext::shared_ptr< Payoff > payoff_
virtual Time getResidualTime() const
virtual void setupArguments(const PricingEngine::arguments *) const
static const Real safetyZoneFactor_
ext::shared_ptr< GeneralizedBlackScholesProcess > process_
virtual void initializeBoundaryConditions() const
Size safeGridPoints(Size gridPoints, Time residualTime) const
Neumann boundary condition (i.e., constant derivative)
const Array & grid() const
QL_DEPRECATED_ENABLE_WARNING void setLogGrid(Real min, Real max)
virtual DayCounter dayCounter() const
the day counter used for date/time conversion
Interest-rate term structure.
InterestRate zeroRate(const Date &d, const DayCounter &resultDayCounter, Compounding comp, Frequency freq=Annual, bool extrapolate=false) const
#define QL_REQUIRE(condition, message)
throw an error if the given pre-condition is not verified
Option exercise classes and payoff function.
Finite-differences vanilla-option engine.
Real Time
continuous quantity with 1-year units
Real Volatility
volatility
std::size_t Size
size of a container
PdeOperator< PdeBSM > BSMTermOperator
Option on a single asset.
Payoffs for various options.
ext::shared_ptr< YieldTermStructure > q
ext::shared_ptr< YieldTermStructure > r
#define QL_DEPRECATED_DISABLE_WARNING
#define QL_DEPRECATED_ENABLE_WARNING