Skip to content

Commit

Permalink
Merge pull request #1353.
Browse files Browse the repository at this point in the history
Deprecate a few unused parts of the old FD framework
  • Loading branch information
lballabio committed Apr 22, 2022
2 parents 346d539 + 874c829 commit 74231a5
Show file tree
Hide file tree
Showing 6 changed files with 44 additions and 39 deletions.
5 changes: 4 additions & 1 deletion ql/methods/finitedifferences/pdeshortrate.hpp
Expand Up @@ -31,7 +31,10 @@

namespace QuantLib {

class PdeShortRate : public PdeSecondOrderParabolic {
/*! \deprecated Use the new finite-differences framework instead.
Deprecated in version 1.27.
*/
class QL_DEPRECATED PdeShortRate : public PdeSecondOrderParabolic {
public:
typedef ext::shared_ptr<OneFactorModel::ShortRateDynamics>
argument_type;
Expand Down
8 changes: 3 additions & 5 deletions ql/methods/finitedifferences/shoutcondition.hpp
Expand Up @@ -33,12 +33,10 @@
namespace QuantLib {

//! Shout option condition
/*! A shout option is an option where the holder has the right to
lock in a minimum value for the payoff at one (shout) time
during the option's life. The minimum value is the option's
intrinsic value at the shout time.
/*! \deprecated Use the new finite-differences framework instead.
Deprecated in version 1.27.
*/
class ShoutCondition : public StandardStepCondition {
class QL_DEPRECATED ShoutCondition : public StandardStepCondition {
public:
ShoutCondition(const Array& intrinsicValues,
Time resTime,
Expand Down
9 changes: 8 additions & 1 deletion ql/pricingengines/vanilla/fdconditions.hpp
Expand Up @@ -31,8 +31,13 @@

namespace QuantLib {

QL_DEPRECATED_DISABLE_WARNING

/*! \deprecated Use the new finite-differences framework instead.
Deprecated in version 1.27.
*/
template <typename baseEngine>
class FDShoutCondition : public baseEngine {
class QL_DEPRECATED FDShoutCondition : public baseEngine {
public:
FDShoutCondition(
const ext::shared_ptr<GeneralizedBlackScholesProcess>& process,
Expand All @@ -53,6 +58,8 @@ namespace QuantLib {
}
};

QL_DEPRECATED_ENABLE_WARNING

}


Expand Down
45 changes: 17 additions & 28 deletions ql/pricingengines/vanilla/fddividendengine.hpp
Expand Up @@ -30,13 +30,11 @@

namespace QuantLib {

//! Abstract base class for dividend engines
/*! \todo The dividend class really needs to be made more
sophisticated to distinguish between fixed dividends and
fractional dividends
/*! \deprecated Use the new finite-differences framework instead.
Deprecated in version 1.27.
*/
template <template <class> class Scheme = CrankNicolson>
class FDDividendEngineBase : public FDMultiPeriodEngine<Scheme> {
class QL_DEPRECATED FDDividendEngineBase : public FDMultiPeriodEngine<Scheme> {
public:
FDDividendEngineBase(
const ext::shared_ptr<GeneralizedBlackScholesProcess>& process,
Expand Down Expand Up @@ -68,20 +66,13 @@ namespace QuantLib {
}
};

/*! \brief Finite-differences pricing engine for dividend options
using escowed dividends model
QL_DEPRECATED_DISABLE_WARNING

The Merton-73 engine is the classic engine described in most
derivatives texts. However, Haug, Haug, and Lewis in "Back to
Basics: a new approach to the discrete dividend problem"
argues that this scheme underprices call options. This is set
as the default engine, because it is consistent with the
analytic version.
\ingroup vanillaengines
/*! \deprecated Use the new finite-differences framework instead.
Deprecated in version 1.27.
*/
template <template <class> class Scheme = CrankNicolson>
class FDDividendEngineMerton73 : public FDDividendEngineBase<Scheme> {
class QL_DEPRECATED FDDividendEngineMerton73 : public FDDividendEngineBase<Scheme> {
public:
FDDividendEngineMerton73(
const ext::shared_ptr<GeneralizedBlackScholesProcess>& process,
Expand All @@ -95,17 +86,11 @@ namespace QuantLib {
void executeIntermediateStep(Size step) const;
};

//! Finite-differences engine for dividend options using shifted dividends
/*! This engine uses the same algorithm that was used in versions
0.3.11 and earlier. It produces results that are different
from the Merton-73 engine.
\todo Review literature to see whether this is described
\ingroup vanillaengines
/*! \deprecated Use the new finite-differences framework instead.
Deprecated in version 1.27.
*/
template <template <class> class Scheme = CrankNicolson>
class FDDividendEngineShiftScale : public FDDividendEngineBase<Scheme> {
class QL_DEPRECATED FDDividendEngineShiftScale : public FDDividendEngineBase<Scheme> {
public:
FDDividendEngineShiftScale(
const ext::shared_ptr<GeneralizedBlackScholesProcess>& process,
Expand All @@ -120,9 +105,11 @@ namespace QuantLib {
};


// Use Merton73 engine as default.
/*! \deprecated Use the new finite-differences framework instead.
Deprecated in version 1.27.
*/
template <template <class> class Scheme = CrankNicolson>
class FDDividendEngine : public FDDividendEngineMerton73<Scheme> {
class QL_DEPRECATED FDDividendEngine : public FDDividendEngineMerton73<Scheme> {
public:
FDDividendEngine(
const ext::shared_ptr<GeneralizedBlackScholesProcess>& process,
Expand Down Expand Up @@ -193,7 +180,7 @@ namespace QuantLib {

namespace detail {

class DividendAdder {
class QL_DEPRECATED DividendAdder {
private:
const Dividend *dividend;
public:
Expand Down Expand Up @@ -244,6 +231,8 @@ namespace QuantLib {
this->getDividendTime(step));
}

QL_DEPRECATED_ENABLE_WARNING

}


Expand Down
11 changes: 8 additions & 3 deletions ql/pricingengines/vanilla/fdstepconditionengine.hpp
Expand Up @@ -33,10 +33,11 @@

namespace QuantLib {

//! Finite-differences pricing engine for American-style vanilla options
/*! \ingroup vanillaengines */
/*! \deprecated Use the new finite-differences framework instead.
Deprecated in version 1.27.
*/
template <template <class> class Scheme = CrankNicolson>
class FDStepConditionEngine : public FDVanillaEngine {
class QL_DEPRECATED FDStepConditionEngine : public FDVanillaEngine {
public:
FDStepConditionEngine(
const ext::shared_ptr<GeneralizedBlackScholesProcess>& process,
Expand All @@ -57,6 +58,8 @@ namespace QuantLib {

// template definitions

QL_DEPRECATED_DISABLE_WARNING

template <template <class> class Scheme>
void FDStepConditionEngine<Scheme>::calculate(
PricingEngine::results* r) const {
Expand Down Expand Up @@ -132,6 +135,8 @@ namespace QuantLib {
results->additionalResults["priceCurve"] = prices_;
}

QL_DEPRECATED_ENABLE_WARNING

}


Expand Down
5 changes: 4 additions & 1 deletion ql/pricingengines/vanilla/fdvanillaengine.hpp
Expand Up @@ -84,8 +84,11 @@ namespace QuantLib {
static const Real safetyZoneFactor_;
};

/*! \deprecated Use the new finite-differences framework instead.
Deprecated in version 1.27.
*/
template <typename base, typename engine>
class FDEngineAdapter : public base, public engine {
class QL_DEPRECATED FDEngineAdapter : public base, public engine {
public:
FDEngineAdapter(
const ext::shared_ptr<GeneralizedBlackScholesProcess>& process,
Expand Down

0 comments on commit 74231a5

Please sign in to comment.