Coverage Report

Created: 2025-08-11 06:28

/src/quantlib/ql/processes/merton76process.cpp
Line
Count
Source (jump to first uncovered line)
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
 <http://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
#include <ql/processes/merton76process.hpp>
23
#include <utility>
24
25
namespace QuantLib {
26
27
    Merton76Process::Merton76Process(const Handle<Quote>& stateVariable,
28
                                     const Handle<YieldTermStructure>& dividendTS,
29
                                     const Handle<YieldTermStructure>& riskFreeTS,
30
                                     const Handle<BlackVolTermStructure>& blackVolTS,
31
                                     Handle<Quote> jumpInt,
32
                                     Handle<Quote> logJMean,
33
                                     Handle<Quote> logJVol,
34
                                     const ext::shared_ptr<discretization>& disc)
35
0
    : StochasticProcess1D(disc), blackProcess_(
36
0
          new BlackScholesMertonProcess(stateVariable, dividendTS, riskFreeTS, blackVolTS, disc)),
37
0
      jumpIntensity_(std::move(jumpInt)), logMeanJump_(std::move(logJMean)),
38
0
      logJumpVolatility_(std::move(logJVol)) {
39
0
        registerWith(blackProcess_);
40
0
        registerWith(jumpIntensity_);
41
0
        registerWith(logMeanJump_);
42
0
        registerWith(logJumpVolatility_);
43
0
    }
44
45
0
    Real Merton76Process::x0() const {
46
0
        return blackProcess_->x0();
47
0
    }
48
49
0
    Time Merton76Process::time(const Date& d) const {
50
0
        return blackProcess_->time(d);
51
0
    }
52
53
0
    const Handle<Quote>& Merton76Process::stateVariable() const {
54
0
        return blackProcess_->stateVariable();
55
0
    }
56
57
0
    const Handle<YieldTermStructure>& Merton76Process::dividendYield() const {
58
0
        return blackProcess_->dividendYield();
59
0
    }
60
61
0
    const Handle<YieldTermStructure>& Merton76Process::riskFreeRate() const {
62
0
        return blackProcess_->riskFreeRate();
63
0
    }
64
65
    const Handle<BlackVolTermStructure>&
66
0
    Merton76Process::blackVolatility() const {
67
0
        return blackProcess_->blackVolatility();
68
0
    }
69
70
0
    const Handle<Quote>& Merton76Process::jumpIntensity() const {
71
0
        return jumpIntensity_;
72
0
    }
73
74
0
    const Handle<Quote>& Merton76Process::logMeanJump() const {
75
0
        return logMeanJump_;
76
0
    }
77
78
0
    const Handle<Quote>& Merton76Process::logJumpVolatility() const {
79
0
        return logJumpVolatility_;
80
0
    }
81
82
}