Coverage Report

Created: 2025-09-04 07:11

/src/quantlib/ql/termstructures/volatility/equityfx/andreasenhugelocalvoladapter.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) 2017, 2018 Klaus Spanderen
5
6
 This file is part of QuantLib, a free-software/open-source library
7
 for financial quantitative analysts and developers - http://quantlib.org/
8
9
 QuantLib is free software: you can redistribute it and/or modify it
10
 under the terms of the QuantLib license.  You should have received a
11
 copy of the license along with this program; if not, please email
12
 <quantlib-dev@lists.sf.net>. The license is also available online at
13
 <https://www.quantlib.org/license.shtml>.
14
15
 This program is distributed in the hope that it will be useful, but WITHOUT
16
 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
17
 FOR A PARTICULAR PURPOSE.  See the license for more details.
18
*/
19
20
#include <ql/termstructures/volatility/equityfx/andreasenhugelocalvoladapter.hpp>
21
#include <ql/termstructures/volatility/equityfx/andreasenhugevolatilityinterpl.hpp>
22
#include <ql/termstructures/yieldtermstructure.hpp>
23
#include <utility>
24
25
namespace QuantLib {
26
27
28
    AndreasenHugeLocalVolAdapter::AndreasenHugeLocalVolAdapter(
29
        ext::shared_ptr<AndreasenHugeVolatilityInterpl> localVol)
30
0
    : localVol_(std::move(localVol)) {}
Unexecuted instantiation: QuantLib::AndreasenHugeLocalVolAdapter::AndreasenHugeLocalVolAdapter(boost::shared_ptr<QuantLib::AndreasenHugeVolatilityInterpl>)
Unexecuted instantiation: QuantLib::AndreasenHugeLocalVolAdapter::AndreasenHugeLocalVolAdapter(boost::shared_ptr<QuantLib::AndreasenHugeVolatilityInterpl>)
31
32
0
    Date AndreasenHugeLocalVolAdapter::maxDate() const {
33
0
        return localVol_->maxDate();
34
0
    }
35
36
0
    Real AndreasenHugeLocalVolAdapter::minStrike() const {
37
0
        return 0.0;
38
0
    }
39
40
0
    Real AndreasenHugeLocalVolAdapter::maxStrike() const {
41
0
        return QL_MAX_REAL;
42
0
    }
43
44
    Volatility
45
0
    AndreasenHugeLocalVolAdapter::localVolImpl(Time t, Real strike) const {
46
0
        return localVol_->localVol(t,
47
0
            std::min(localVol_->maxStrike(),
48
0
                std::max(localVol_->minStrike(), strike)));
49
0
    }
50
51
0
    Calendar AndreasenHugeLocalVolAdapter::calendar() const {
52
0
        return localVol_->riskFreeRate()->calendar();
53
0
    }
54
0
    DayCounter AndreasenHugeLocalVolAdapter::dayCounter() const {
55
0
        return localVol_->riskFreeRate()->dayCounter();
56
0
    }
57
0
    const Date& AndreasenHugeLocalVolAdapter::referenceDate() const {
58
0
        return localVol_->riskFreeRate()->referenceDate();
59
0
    }
60
0
    Natural AndreasenHugeLocalVolAdapter::settlementDays() const {
61
0
        return localVol_->riskFreeRate()->settlementDays();
62
0
    }
63
}