Coverage Report

Created: 2026-09-28 06:23

next uncovered line (L), next uncovered region (R), next uncovered branch (B)
/src/quantlib/ql/processes/merton76process.hpp
Line
Count
Source
1
/* -*- mode: c++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2
3
/*
4
 Copyright (C) 2003 Ferdinando Ametrano
5
 Copyright (C) 2001, 2002, 2003 Sadruddin Rejeb
6
 Copyright (C) 2004, 2005 StatPro Italia srl
7
8
 This file is part of QuantLib, a free-software/open-source library
9
 for financial quantitative analysts and developers - http://quantlib.org/
10
11
 QuantLib is free software: you can redistribute it and/or modify it
12
 under the terms of the QuantLib license.  You should have received a
13
 copy of the license along with this program; if not, please email
14
 <quantlib-dev@lists.sf.net>. The license is also available online at
15
 <https://www.quantlib.org/license.shtml>.
16
17
 This program is distributed in the hope that it will be useful, but WITHOUT
18
 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
19
 FOR A PARTICULAR PURPOSE.  See the license for more details.
20
*/
21
22
/*! \file merton76process.hpp
23
    \brief Merton-76 process
24
*/
25
26
#ifndef quantlib_merton_76_process_hpp
27
#define quantlib_merton_76_process_hpp
28
29
#include <ql/processes/blackscholesprocess.hpp>
30
#include <ql/processes/eulerdiscretization.hpp>
31
32
namespace QuantLib {
33
34
    //! Merton-76 jump-diffusion process
35
    /*! \ingroup processes */
36
    class Merton76Process : public StochasticProcess1D {
37
      public:
38
        Merton76Process(const Handle<Quote>& stateVariable,
39
                        const Handle<YieldTermStructure>& dividendTS,
40
                        const Handle<YieldTermStructure>& riskFreeTS,
41
                        const Handle<BlackVolTermStructure>& blackVolTS,
42
                        Handle<Quote> jumpInt,
43
                        Handle<Quote> logJMean,
44
                        Handle<Quote> logJVol,
45
                        const ext::shared_ptr<discretization>& d =
46
                            ext::shared_ptr<discretization>(new EulerDiscretization));
47
        //! \name StochasticProcess1D interface
48
        //@{
49
        Real x0() const override;
50
0
        Real drift(Time, Real) const override { QL_FAIL("Merton76Process does not implement drift"); }
51
0
        Real diffusion(Time, Real) const override { QL_FAIL("Merton76Process does not implement diffusion"); }
52
0
        Real apply(Real, Real) const override { QL_FAIL("Merton76Process does not implement apply"); }
53
        //@}
54
        Time time(const Date&) const override;
55
        //! \name Inspectors
56
        //@{
57
        const Handle<Quote>& stateVariable() const;
58
        const Handle<YieldTermStructure>& dividendYield() const;
59
        const Handle<YieldTermStructure>& riskFreeRate() const;
60
        const Handle<BlackVolTermStructure>& blackVolatility() const;
61
        const Handle<Quote>& jumpIntensity() const;
62
        const Handle<Quote>& logMeanJump() const;
63
        const Handle<Quote>& logJumpVolatility() const;
64
        //@}
65
      private:
66
        ext::shared_ptr<GeneralizedBlackScholesProcess> blackProcess_;
67
        Handle<Quote> jumpIntensity_, logMeanJump_, logJumpVolatility_;
68
    };
69
70
}
71
72
73
#endif