/src/quantlib/ql/math/interpolation.hpp
Line | Count | Source |
1 | | /* -*- mode: c++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ |
2 | | |
3 | | /* |
4 | | Copyright (C) 2002, 2003 Ferdinando Ametrano |
5 | | Copyright (C) 2000, 2001, 2002, 2003 RiskMap srl |
6 | | Copyright (C) 2003, 2004, 2005, 2006 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 interpolation.hpp |
23 | | \brief base class for 1-D interpolations |
24 | | */ |
25 | | |
26 | | #ifndef quantlib_interpolation_hpp |
27 | | #define quantlib_interpolation_hpp |
28 | | |
29 | | #include <ql/math/interpolations/extrapolation.hpp> |
30 | | #include <ql/math/comparison.hpp> |
31 | | #include <ql/errors.hpp> |
32 | | #include <algorithm> |
33 | | #include <type_traits> |
34 | | #include <vector> |
35 | | |
36 | | namespace QuantLib { |
37 | | |
38 | | //! base class for 1-D interpolations. |
39 | | /*! Classes derived from this class will provide interpolated |
40 | | values from two sequences of equal length, representing |
41 | | discretized values of a variable and a function of the former, |
42 | | respectively. |
43 | | |
44 | | \warning Interpolations don't copy their underlying data; |
45 | | instead, they store iterators through which they |
46 | | access them. This allow them to see changes in the |
47 | | underlying data without having to propagate them |
48 | | manually, but adds the requirement that the lifetime |
49 | | of the underlying data exceeds or equals the lifetime |
50 | | of the interpolation. It is up to the user to ensure |
51 | | this: usually, a class will store as data members |
52 | | both the data and the interpolation (see, e.g., the |
53 | | InterpolatedCurve class) and call the update() method |
54 | | on the latter when the data change. |
55 | | */ |
56 | | class Interpolation : public Extrapolator { |
57 | | public: |
58 | | //! abstract base class for interpolation implementations |
59 | | class Impl { |
60 | | public: |
61 | 7.33k | virtual ~Impl() = default; |
62 | | virtual void update() = 0; |
63 | | virtual Real xMin() const = 0; |
64 | | virtual Real xMax() const = 0; |
65 | | virtual std::vector<Real> xValues() const = 0; |
66 | | virtual std::vector<Real> yValues() const = 0; |
67 | | virtual bool isInRange(Real) const = 0; |
68 | | virtual Real value(Real) const = 0; |
69 | | virtual Real primitive(Real) const = 0; |
70 | | virtual Real derivative(Real) const = 0; |
71 | | virtual Real secondDerivative(Real) const = 0; |
72 | | }; |
73 | | //! basic template implementation |
74 | | template <class I1, class I2, class Base=Impl> |
75 | | class templateImpl : public Base { |
76 | | public: |
77 | | templateImpl(const I1& xBegin, const I1& xEnd, const I2& yBegin) |
78 | 37 | : templateImpl(xBegin, xEnd, yBegin, 2) {}QuantLib::Interpolation::templateImpl<std::__1::__wrap_iter<double*>, std::__1::__wrap_iter<double*>, QuantLib::detail::UpdatedYInterpolation>::templateImpl(std::__1::__wrap_iter<double*> const&, std::__1::__wrap_iter<double*> const&, std::__1::__wrap_iter<double*> const&) Line | Count | Source | 78 | 37 | : templateImpl(xBegin, xEnd, yBegin, 2) {} |
Unexecuted instantiation: QuantLib::Interpolation::templateImpl<double const*, double const*, QuantLib::detail::UpdatedYInterpolation>::templateImpl(double const* const&, double const* const&, double const* const&) Unexecuted instantiation: QuantLib::Interpolation::templateImpl<double*, double*, QuantLib::detail::UpdatedYInterpolation>::templateImpl(double* const&, double* const&, double* const&) |
79 | | template <class... Args> |
80 | | templateImpl(const I1& xBegin, const I1& xEnd, const I2& yBegin, |
81 | | const int requiredPoints, Args&&... args) |
82 | 7.33k | : Base(std::forward<Args>(args)...), xBegin_(xBegin), xEnd_(xEnd), yBegin_(yBegin) { |
83 | 7.33k | QL_REQUIRE(static_cast<std::ptrdiff_t>(xEnd_-xBegin_) >= requiredPoints, |
84 | 7.33k | "not enough points to interpolate: at least " << |
85 | 7.33k | requiredPoints << |
86 | 7.33k | " required, " << static_cast<std::ptrdiff_t>(xEnd_-xBegin_)<< " provided"); |
87 | 7.33k | } QuantLib::Interpolation::templateImpl<std::__1::__wrap_iter<double*>, std::__1::__wrap_iter<double*>, QuantLib::Interpolation::Impl>::templateImpl<>(std::__1::__wrap_iter<double*> const&, std::__1::__wrap_iter<double*> const&, std::__1::__wrap_iter<double*> const&, int) Line | Count | Source | 82 | 469 | : Base(std::forward<Args>(args)...), xBegin_(xBegin), xEnd_(xEnd), yBegin_(yBegin) { | 83 | | QL_REQUIRE(static_cast<std::ptrdiff_t>(xEnd_-xBegin_) >= requiredPoints, | 84 | 469 | "not enough points to interpolate: at least " << | 85 | 469 | requiredPoints << | 86 | 469 | " required, " << static_cast<std::ptrdiff_t>(xEnd_-xBegin_)<< " provided"); | 87 | 469 | } |
QuantLib::Interpolation::templateImpl<std::__1::__wrap_iter<double*>, std::__1::__wrap_iter<double*>, QuantLib::detail::CubicInterpolationBaseImpl>::templateImpl<long, double&, double&>(std::__1::__wrap_iter<double*> const&, std::__1::__wrap_iter<double*> const&, std::__1::__wrap_iter<double*> const&, int, long&&, double&, double&) Line | Count | Source | 82 | 529 | : Base(std::forward<Args>(args)...), xBegin_(xBegin), xEnd_(xEnd), yBegin_(yBegin) { | 83 | | QL_REQUIRE(static_cast<std::ptrdiff_t>(xEnd_-xBegin_) >= requiredPoints, | 84 | 529 | "not enough points to interpolate: at least " << | 85 | 529 | requiredPoints << | 86 | 529 | " required, " << static_cast<std::ptrdiff_t>(xEnd_-xBegin_)<< " provided"); | 87 | 529 | } |
QuantLib::Interpolation::templateImpl<std::__1::__wrap_iter<double*>, std::__1::__wrap_iter<double*>, QuantLib::detail::UpdatedYInterpolation>::templateImpl<>(std::__1::__wrap_iter<double*> const&, std::__1::__wrap_iter<double*> const&, std::__1::__wrap_iter<double*> const&, int) Line | Count | Source | 82 | 37 | : Base(std::forward<Args>(args)...), xBegin_(xBegin), xEnd_(xEnd), yBegin_(yBegin) { | 83 | | QL_REQUIRE(static_cast<std::ptrdiff_t>(xEnd_-xBegin_) >= requiredPoints, | 84 | 37 | "not enough points to interpolate: at least " << | 85 | 37 | requiredPoints << | 86 | 37 | " required, " << static_cast<std::ptrdiff_t>(xEnd_-xBegin_)<< " provided"); | 87 | 37 | } |
Unexecuted instantiation: QuantLib::Interpolation::templateImpl<std::__1::__wrap_iter<double*>, double const*, QuantLib::detail::CubicInterpolationBaseImpl>::templateImpl<long, double&, double&>(std::__1::__wrap_iter<double*> const&, std::__1::__wrap_iter<double*> const&, double const* const&, int, long&&, double&, double&) Unexecuted instantiation: QuantLib::Interpolation::templateImpl<std::__1::__wrap_iter<double const*>, double*, QuantLib::Interpolation::Impl>::templateImpl<>(std::__1::__wrap_iter<double const*> const&, std::__1::__wrap_iter<double const*> const&, double* const&, int) Unexecuted instantiation: QuantLib::Interpolation::templateImpl<double const*, double const*, QuantLib::detail::UpdatedYInterpolation>::templateImpl<>(double const* const&, double const* const&, double const* const&, int) Unexecuted instantiation: QuantLib::Interpolation::templateImpl<double*, double*, QuantLib::detail::UpdatedYInterpolation>::templateImpl<>(double* const&, double* const&, double* const&, int) Unexecuted instantiation: QuantLib::Interpolation::templateImpl<std::__1::__wrap_iter<double*>, double const*, QuantLib::Interpolation::Impl>::templateImpl<>(std::__1::__wrap_iter<double*> const&, std::__1::__wrap_iter<double*> const&, double const* const&, int) Unexecuted instantiation: QuantLib::Interpolation::templateImpl<std::__1::__wrap_iter<double*>, std::__1::__wrap_iter<double const*>, QuantLib::Interpolation::Impl>::templateImpl<>(std::__1::__wrap_iter<double*> const&, std::__1::__wrap_iter<double*> const&, std::__1::__wrap_iter<double const*> const&, int) Unexecuted instantiation: QuantLib::Interpolation::templateImpl<std::__1::__wrap_iter<double*>, std::__1::__wrap_iter<double*>, QuantLib::detail::AbcdCoeffHolder>::templateImpl<double&, double&, double&, double&, bool&, bool&, bool&, bool&>(std::__1::__wrap_iter<double*> const&, std::__1::__wrap_iter<double*> const&, std::__1::__wrap_iter<double*> const&, int, double&, double&, double&, double&, bool&, bool&, bool&, bool&) Unexecuted instantiation: QuantLib::Interpolation::templateImpl<std::__1::__wrap_iter<double const*>, std::__1::__wrap_iter<double*>, QuantLib::Interpolation::Impl>::templateImpl<>(std::__1::__wrap_iter<double const*> const&, std::__1::__wrap_iter<double const*> const&, std::__1::__wrap_iter<double*> const&, int) Unexecuted instantiation: QuantLib::Interpolation::templateImpl<double*, double*, QuantLib::Interpolation::Impl>::templateImpl<>(double* const&, double* const&, double* const&, int) Unexecuted instantiation: QuantLib::Interpolation::templateImpl<std::__1::__wrap_iter<double const*>, std::__1::__wrap_iter<double const*>, QuantLib::Interpolation::Impl>::templateImpl<>(std::__1::__wrap_iter<double const*> const&, std::__1::__wrap_iter<double const*> const&, std::__1::__wrap_iter<double const*> const&, int) QuantLib::Interpolation::templateImpl<std::__1::__wrap_iter<double const*>, double*, QuantLib::detail::CubicInterpolationBaseImpl>::templateImpl<long, double&, double&>(std::__1::__wrap_iter<double const*> const&, std::__1::__wrap_iter<double const*> const&, double* const&, int, long&&, double&, double&) Line | Count | Source | 82 | 6.30k | : Base(std::forward<Args>(args)...), xBegin_(xBegin), xEnd_(xEnd), yBegin_(yBegin) { | 83 | | QL_REQUIRE(static_cast<std::ptrdiff_t>(xEnd_-xBegin_) >= requiredPoints, | 84 | 6.30k | "not enough points to interpolate: at least " << | 85 | 6.30k | requiredPoints << | 86 | 6.30k | " required, " << static_cast<std::ptrdiff_t>(xEnd_-xBegin_)<< " provided"); | 87 | 6.30k | } |
Unexecuted instantiation: QuantLib::Interpolation::templateImpl<std::__1::__wrap_iter<double const*>, double const*, QuantLib::detail::CubicInterpolationBaseImpl>::templateImpl<long, double&, double&>(std::__1::__wrap_iter<double const*> const&, std::__1::__wrap_iter<double const*> const&, double const* const&, int, long&&, double&, double&) Unexecuted instantiation: QuantLib::Interpolation::templateImpl<std::__1::__wrap_iter<double const*>, std::__1::__wrap_iter<double*>, QuantLib::detail::CubicInterpolationBaseImpl>::templateImpl<long, double&, double&>(std::__1::__wrap_iter<double const*> const&, std::__1::__wrap_iter<double const*> const&, std::__1::__wrap_iter<double*> const&, int, long&&, double&, double&) Unexecuted instantiation: QuantLib::Interpolation::templateImpl<double const*, double*, QuantLib::detail::CubicInterpolationBaseImpl>::templateImpl<long, double&, double&>(double const* const&, double const* const&, double* const&, int, long&&, double&, double&) Unexecuted instantiation: QuantLib::Interpolation::templateImpl<double const*, double*, QuantLib::Interpolation::Impl>::templateImpl<>(double const* const&, double const* const&, double* const&, int) Unexecuted instantiation: QuantLib::Interpolation::templateImpl<double*, double*, QuantLib::detail::CubicInterpolationBaseImpl>::templateImpl<long, double&, double&>(double* const&, double* const&, double* const&, int, long&&, double&, double&) Unexecuted instantiation: QuantLib::Interpolation::templateImpl<std::__1::__wrap_iter<double*>, QuantLib::step_iterator<double*>, QuantLib::Interpolation::Impl>::templateImpl<>(std::__1::__wrap_iter<double*> const&, std::__1::__wrap_iter<double*> const&, QuantLib::step_iterator<double*> const&, int) Unexecuted instantiation: QuantLib::Interpolation::templateImpl<std::__1::__wrap_iter<double const*>, std::__1::__wrap_iter<double const*>, QuantLib::detail::CubicInterpolationBaseImpl>::templateImpl<long, double&, double&>(std::__1::__wrap_iter<double const*> const&, std::__1::__wrap_iter<double const*> const&, std::__1::__wrap_iter<double const*> const&, int, long&&, double&, double&) Unexecuted instantiation: QuantLib::Interpolation::templateImpl<double const*, double const*, QuantLib::detail::CubicInterpolationBaseImpl>::templateImpl<long, double&, double&>(double const* const&, double const* const&, double const* const&, int, long&&, double&, double&) Unexecuted instantiation: QuantLib::Interpolation::templateImpl<double const*, double const*, QuantLib::Interpolation::Impl>::templateImpl<>(double const* const&, double const* const&, double const* const&, int) Unexecuted instantiation: QuantLib::Interpolation::templateImpl<double*, double const*, QuantLib::Interpolation::Impl>::templateImpl<>(double* const&, double* const&, double const* const&, int) |
88 | 18.9k | Real xMin() const override { return *xBegin_; }Unexecuted instantiation: QuantLib::Interpolation::templateImpl<std::__1::__wrap_iter<double*>, std::__1::__wrap_iter<double*>, QuantLib::Interpolation::Impl>::xMin() const Unexecuted instantiation: QuantLib::Interpolation::templateImpl<std::__1::__wrap_iter<double*>, std::__1::__wrap_iter<double*>, QuantLib::detail::CubicInterpolationBaseImpl>::xMin() const Unexecuted instantiation: QuantLib::Interpolation::templateImpl<std::__1::__wrap_iter<double*>, std::__1::__wrap_iter<double*>, QuantLib::detail::UpdatedYInterpolation>::xMin() const Unexecuted instantiation: QuantLib::Interpolation::templateImpl<std::__1::__wrap_iter<double*>, double const*, QuantLib::detail::CubicInterpolationBaseImpl>::xMin() const Unexecuted instantiation: QuantLib::Interpolation::templateImpl<std::__1::__wrap_iter<double const*>, double*, QuantLib::Interpolation::Impl>::xMin() const Unexecuted instantiation: QuantLib::Interpolation::templateImpl<double const*, double const*, QuantLib::detail::UpdatedYInterpolation>::xMin() const Unexecuted instantiation: QuantLib::Interpolation::templateImpl<double*, double*, QuantLib::detail::UpdatedYInterpolation>::xMin() const Unexecuted instantiation: QuantLib::Interpolation::templateImpl<std::__1::__wrap_iter<double*>, double const*, QuantLib::Interpolation::Impl>::xMin() const Unexecuted instantiation: QuantLib::Interpolation::templateImpl<std::__1::__wrap_iter<double*>, std::__1::__wrap_iter<double const*>, QuantLib::Interpolation::Impl>::xMin() const Unexecuted instantiation: QuantLib::Interpolation::templateImpl<std::__1::__wrap_iter<double*>, std::__1::__wrap_iter<double*>, QuantLib::detail::AbcdCoeffHolder>::xMin() const Unexecuted instantiation: QuantLib::Interpolation::templateImpl<std::__1::__wrap_iter<double const*>, std::__1::__wrap_iter<double*>, QuantLib::Interpolation::Impl>::xMin() const Unexecuted instantiation: QuantLib::Interpolation::templateImpl<double*, double*, QuantLib::Interpolation::Impl>::xMin() const Unexecuted instantiation: QuantLib::Interpolation::templateImpl<std::__1::__wrap_iter<double const*>, std::__1::__wrap_iter<double const*>, QuantLib::Interpolation::Impl>::xMin() const QuantLib::Interpolation::templateImpl<std::__1::__wrap_iter<double const*>, double*, QuantLib::detail::CubicInterpolationBaseImpl>::xMin() const Line | Count | Source | 88 | 18.9k | Real xMin() const override { return *xBegin_; } |
Unexecuted instantiation: QuantLib::Interpolation::templateImpl<std::__1::__wrap_iter<double const*>, double const*, QuantLib::detail::CubicInterpolationBaseImpl>::xMin() const Unexecuted instantiation: QuantLib::Interpolation::templateImpl<std::__1::__wrap_iter<double const*>, std::__1::__wrap_iter<double*>, QuantLib::detail::CubicInterpolationBaseImpl>::xMin() const Unexecuted instantiation: QuantLib::Interpolation::templateImpl<double const*, double*, QuantLib::detail::CubicInterpolationBaseImpl>::xMin() const Unexecuted instantiation: QuantLib::Interpolation::templateImpl<double const*, double*, QuantLib::Interpolation::Impl>::xMin() const Unexecuted instantiation: QuantLib::Interpolation::templateImpl<double*, double*, QuantLib::detail::CubicInterpolationBaseImpl>::xMin() const Unexecuted instantiation: QuantLib::Interpolation::templateImpl<std::__1::__wrap_iter<double*>, QuantLib::step_iterator<double*>, QuantLib::Interpolation::Impl>::xMin() const Unexecuted instantiation: QuantLib::Interpolation::templateImpl<std::__1::__wrap_iter<double const*>, std::__1::__wrap_iter<double const*>, QuantLib::detail::CubicInterpolationBaseImpl>::xMin() const Unexecuted instantiation: QuantLib::Interpolation::templateImpl<double const*, double const*, QuantLib::detail::CubicInterpolationBaseImpl>::xMin() const Unexecuted instantiation: QuantLib::Interpolation::templateImpl<double const*, double const*, QuantLib::Interpolation::Impl>::xMin() const Unexecuted instantiation: QuantLib::Interpolation::templateImpl<double*, double const*, QuantLib::Interpolation::Impl>::xMin() const |
89 | 18.9k | Real xMax() const override { return *(xEnd_ - 1); }Unexecuted instantiation: QuantLib::Interpolation::templateImpl<std::__1::__wrap_iter<double*>, std::__1::__wrap_iter<double*>, QuantLib::Interpolation::Impl>::xMax() const Unexecuted instantiation: QuantLib::Interpolation::templateImpl<std::__1::__wrap_iter<double*>, std::__1::__wrap_iter<double*>, QuantLib::detail::CubicInterpolationBaseImpl>::xMax() const Unexecuted instantiation: QuantLib::Interpolation::templateImpl<std::__1::__wrap_iter<double*>, std::__1::__wrap_iter<double*>, QuantLib::detail::UpdatedYInterpolation>::xMax() const Unexecuted instantiation: QuantLib::Interpolation::templateImpl<std::__1::__wrap_iter<double*>, double const*, QuantLib::detail::CubicInterpolationBaseImpl>::xMax() const Unexecuted instantiation: QuantLib::Interpolation::templateImpl<std::__1::__wrap_iter<double const*>, double*, QuantLib::Interpolation::Impl>::xMax() const Unexecuted instantiation: QuantLib::Interpolation::templateImpl<double const*, double const*, QuantLib::detail::UpdatedYInterpolation>::xMax() const Unexecuted instantiation: QuantLib::Interpolation::templateImpl<double*, double*, QuantLib::detail::UpdatedYInterpolation>::xMax() const Unexecuted instantiation: QuantLib::Interpolation::templateImpl<std::__1::__wrap_iter<double*>, double const*, QuantLib::Interpolation::Impl>::xMax() const Unexecuted instantiation: QuantLib::Interpolation::templateImpl<std::__1::__wrap_iter<double*>, std::__1::__wrap_iter<double const*>, QuantLib::Interpolation::Impl>::xMax() const Unexecuted instantiation: QuantLib::Interpolation::templateImpl<std::__1::__wrap_iter<double*>, std::__1::__wrap_iter<double*>, QuantLib::detail::AbcdCoeffHolder>::xMax() const Unexecuted instantiation: QuantLib::Interpolation::templateImpl<std::__1::__wrap_iter<double const*>, std::__1::__wrap_iter<double*>, QuantLib::Interpolation::Impl>::xMax() const Unexecuted instantiation: QuantLib::Interpolation::templateImpl<double*, double*, QuantLib::Interpolation::Impl>::xMax() const Unexecuted instantiation: QuantLib::Interpolation::templateImpl<std::__1::__wrap_iter<double const*>, std::__1::__wrap_iter<double const*>, QuantLib::Interpolation::Impl>::xMax() const QuantLib::Interpolation::templateImpl<std::__1::__wrap_iter<double const*>, double*, QuantLib::detail::CubicInterpolationBaseImpl>::xMax() const Line | Count | Source | 89 | 18.9k | Real xMax() const override { return *(xEnd_ - 1); } |
Unexecuted instantiation: QuantLib::Interpolation::templateImpl<std::__1::__wrap_iter<double const*>, double const*, QuantLib::detail::CubicInterpolationBaseImpl>::xMax() const Unexecuted instantiation: QuantLib::Interpolation::templateImpl<std::__1::__wrap_iter<double const*>, std::__1::__wrap_iter<double*>, QuantLib::detail::CubicInterpolationBaseImpl>::xMax() const Unexecuted instantiation: QuantLib::Interpolation::templateImpl<double const*, double*, QuantLib::detail::CubicInterpolationBaseImpl>::xMax() const Unexecuted instantiation: QuantLib::Interpolation::templateImpl<double const*, double*, QuantLib::Interpolation::Impl>::xMax() const Unexecuted instantiation: QuantLib::Interpolation::templateImpl<double*, double*, QuantLib::detail::CubicInterpolationBaseImpl>::xMax() const Unexecuted instantiation: QuantLib::Interpolation::templateImpl<std::__1::__wrap_iter<double*>, QuantLib::step_iterator<double*>, QuantLib::Interpolation::Impl>::xMax() const Unexecuted instantiation: QuantLib::Interpolation::templateImpl<std::__1::__wrap_iter<double const*>, std::__1::__wrap_iter<double const*>, QuantLib::detail::CubicInterpolationBaseImpl>::xMax() const Unexecuted instantiation: QuantLib::Interpolation::templateImpl<double const*, double const*, QuantLib::detail::CubicInterpolationBaseImpl>::xMax() const Unexecuted instantiation: QuantLib::Interpolation::templateImpl<double const*, double const*, QuantLib::Interpolation::Impl>::xMax() const Unexecuted instantiation: QuantLib::Interpolation::templateImpl<double*, double const*, QuantLib::Interpolation::Impl>::xMax() const |
90 | 0 | std::vector<Real> xValues() const override { return std::vector<Real>(xBegin_, xEnd_); }Unexecuted instantiation: QuantLib::Interpolation::templateImpl<std::__1::__wrap_iter<double*>, std::__1::__wrap_iter<double*>, QuantLib::Interpolation::Impl>::xValues() const Unexecuted instantiation: QuantLib::Interpolation::templateImpl<std::__1::__wrap_iter<double*>, std::__1::__wrap_iter<double*>, QuantLib::detail::CubicInterpolationBaseImpl>::xValues() const Unexecuted instantiation: QuantLib::Interpolation::templateImpl<std::__1::__wrap_iter<double*>, std::__1::__wrap_iter<double*>, QuantLib::detail::UpdatedYInterpolation>::xValues() const Unexecuted instantiation: QuantLib::Interpolation::templateImpl<std::__1::__wrap_iter<double*>, double const*, QuantLib::detail::CubicInterpolationBaseImpl>::xValues() const Unexecuted instantiation: QuantLib::Interpolation::templateImpl<std::__1::__wrap_iter<double const*>, double*, QuantLib::Interpolation::Impl>::xValues() const Unexecuted instantiation: QuantLib::Interpolation::templateImpl<double const*, double const*, QuantLib::detail::UpdatedYInterpolation>::xValues() const Unexecuted instantiation: QuantLib::Interpolation::templateImpl<double*, double*, QuantLib::detail::UpdatedYInterpolation>::xValues() const Unexecuted instantiation: QuantLib::Interpolation::templateImpl<std::__1::__wrap_iter<double*>, double const*, QuantLib::Interpolation::Impl>::xValues() const Unexecuted instantiation: QuantLib::Interpolation::templateImpl<std::__1::__wrap_iter<double*>, std::__1::__wrap_iter<double const*>, QuantLib::Interpolation::Impl>::xValues() const Unexecuted instantiation: QuantLib::Interpolation::templateImpl<std::__1::__wrap_iter<double*>, std::__1::__wrap_iter<double*>, QuantLib::detail::AbcdCoeffHolder>::xValues() const Unexecuted instantiation: QuantLib::Interpolation::templateImpl<std::__1::__wrap_iter<double const*>, std::__1::__wrap_iter<double*>, QuantLib::Interpolation::Impl>::xValues() const Unexecuted instantiation: QuantLib::Interpolation::templateImpl<double*, double*, QuantLib::Interpolation::Impl>::xValues() const Unexecuted instantiation: QuantLib::Interpolation::templateImpl<std::__1::__wrap_iter<double const*>, std::__1::__wrap_iter<double const*>, QuantLib::Interpolation::Impl>::xValues() const Unexecuted instantiation: QuantLib::Interpolation::templateImpl<std::__1::__wrap_iter<double const*>, double*, QuantLib::detail::CubicInterpolationBaseImpl>::xValues() const Unexecuted instantiation: QuantLib::Interpolation::templateImpl<std::__1::__wrap_iter<double const*>, double const*, QuantLib::detail::CubicInterpolationBaseImpl>::xValues() const Unexecuted instantiation: QuantLib::Interpolation::templateImpl<std::__1::__wrap_iter<double const*>, std::__1::__wrap_iter<double*>, QuantLib::detail::CubicInterpolationBaseImpl>::xValues() const Unexecuted instantiation: QuantLib::Interpolation::templateImpl<double const*, double*, QuantLib::detail::CubicInterpolationBaseImpl>::xValues() const Unexecuted instantiation: QuantLib::Interpolation::templateImpl<double const*, double*, QuantLib::Interpolation::Impl>::xValues() const Unexecuted instantiation: QuantLib::Interpolation::templateImpl<double*, double*, QuantLib::detail::CubicInterpolationBaseImpl>::xValues() const Unexecuted instantiation: QuantLib::Interpolation::templateImpl<std::__1::__wrap_iter<double*>, QuantLib::step_iterator<double*>, QuantLib::Interpolation::Impl>::xValues() const Unexecuted instantiation: QuantLib::Interpolation::templateImpl<std::__1::__wrap_iter<double const*>, std::__1::__wrap_iter<double const*>, QuantLib::detail::CubicInterpolationBaseImpl>::xValues() const Unexecuted instantiation: QuantLib::Interpolation::templateImpl<double const*, double const*, QuantLib::detail::CubicInterpolationBaseImpl>::xValues() const Unexecuted instantiation: QuantLib::Interpolation::templateImpl<double const*, double const*, QuantLib::Interpolation::Impl>::xValues() const Unexecuted instantiation: QuantLib::Interpolation::templateImpl<double*, double const*, QuantLib::Interpolation::Impl>::xValues() const |
91 | 0 | std::vector<Real> yValues() const override { |
92 | 0 | return std::vector<Real>(yBegin_,yBegin_+(xEnd_-xBegin_)); |
93 | 0 | } Unexecuted instantiation: QuantLib::Interpolation::templateImpl<std::__1::__wrap_iter<double*>, std::__1::__wrap_iter<double*>, QuantLib::Interpolation::Impl>::yValues() const Unexecuted instantiation: QuantLib::Interpolation::templateImpl<std::__1::__wrap_iter<double*>, std::__1::__wrap_iter<double*>, QuantLib::detail::CubicInterpolationBaseImpl>::yValues() const Unexecuted instantiation: QuantLib::Interpolation::templateImpl<std::__1::__wrap_iter<double*>, std::__1::__wrap_iter<double*>, QuantLib::detail::UpdatedYInterpolation>::yValues() const Unexecuted instantiation: QuantLib::Interpolation::templateImpl<std::__1::__wrap_iter<double*>, double const*, QuantLib::detail::CubicInterpolationBaseImpl>::yValues() const Unexecuted instantiation: QuantLib::Interpolation::templateImpl<std::__1::__wrap_iter<double const*>, double*, QuantLib::Interpolation::Impl>::yValues() const Unexecuted instantiation: QuantLib::Interpolation::templateImpl<double const*, double const*, QuantLib::detail::UpdatedYInterpolation>::yValues() const Unexecuted instantiation: QuantLib::Interpolation::templateImpl<double*, double*, QuantLib::detail::UpdatedYInterpolation>::yValues() const Unexecuted instantiation: QuantLib::Interpolation::templateImpl<std::__1::__wrap_iter<double*>, double const*, QuantLib::Interpolation::Impl>::yValues() const Unexecuted instantiation: QuantLib::Interpolation::templateImpl<std::__1::__wrap_iter<double*>, std::__1::__wrap_iter<double const*>, QuantLib::Interpolation::Impl>::yValues() const Unexecuted instantiation: QuantLib::Interpolation::templateImpl<std::__1::__wrap_iter<double*>, std::__1::__wrap_iter<double*>, QuantLib::detail::AbcdCoeffHolder>::yValues() const Unexecuted instantiation: QuantLib::Interpolation::templateImpl<std::__1::__wrap_iter<double const*>, std::__1::__wrap_iter<double*>, QuantLib::Interpolation::Impl>::yValues() const Unexecuted instantiation: QuantLib::Interpolation::templateImpl<double*, double*, QuantLib::Interpolation::Impl>::yValues() const Unexecuted instantiation: QuantLib::Interpolation::templateImpl<std::__1::__wrap_iter<double const*>, std::__1::__wrap_iter<double const*>, QuantLib::Interpolation::Impl>::yValues() const Unexecuted instantiation: QuantLib::Interpolation::templateImpl<std::__1::__wrap_iter<double const*>, double*, QuantLib::detail::CubicInterpolationBaseImpl>::yValues() const Unexecuted instantiation: QuantLib::Interpolation::templateImpl<std::__1::__wrap_iter<double const*>, double const*, QuantLib::detail::CubicInterpolationBaseImpl>::yValues() const Unexecuted instantiation: QuantLib::Interpolation::templateImpl<std::__1::__wrap_iter<double const*>, std::__1::__wrap_iter<double*>, QuantLib::detail::CubicInterpolationBaseImpl>::yValues() const Unexecuted instantiation: QuantLib::Interpolation::templateImpl<double const*, double*, QuantLib::detail::CubicInterpolationBaseImpl>::yValues() const Unexecuted instantiation: QuantLib::Interpolation::templateImpl<double const*, double*, QuantLib::Interpolation::Impl>::yValues() const Unexecuted instantiation: QuantLib::Interpolation::templateImpl<double*, double*, QuantLib::detail::CubicInterpolationBaseImpl>::yValues() const Unexecuted instantiation: QuantLib::Interpolation::templateImpl<std::__1::__wrap_iter<double*>, QuantLib::step_iterator<double*>, QuantLib::Interpolation::Impl>::yValues() const Unexecuted instantiation: QuantLib::Interpolation::templateImpl<std::__1::__wrap_iter<double const*>, std::__1::__wrap_iter<double const*>, QuantLib::detail::CubicInterpolationBaseImpl>::yValues() const Unexecuted instantiation: QuantLib::Interpolation::templateImpl<double const*, double const*, QuantLib::detail::CubicInterpolationBaseImpl>::yValues() const Unexecuted instantiation: QuantLib::Interpolation::templateImpl<double const*, double const*, QuantLib::Interpolation::Impl>::yValues() const Unexecuted instantiation: QuantLib::Interpolation::templateImpl<double*, double const*, QuantLib::Interpolation::Impl>::yValues() const |
94 | 18.9k | bool isInRange(Real x) const override { |
95 | | #if defined(QL_EXTRA_SAFETY_CHECKS) |
96 | | for (I1 i=xBegin_, j=xBegin_+1; j!=xEnd_; ++i, ++j) |
97 | | QL_REQUIRE(*j > *i, "unsorted x values"); |
98 | | #endif |
99 | 18.9k | Real x1 = xMin(), x2 = xMax(); |
100 | 18.9k | return (x >= x1 && x <= x2) || close(x,x1) || close(x,x2); |
101 | 18.9k | } Unexecuted instantiation: QuantLib::Interpolation::templateImpl<std::__1::__wrap_iter<double*>, std::__1::__wrap_iter<double*>, QuantLib::Interpolation::Impl>::isInRange(double) const Unexecuted instantiation: QuantLib::Interpolation::templateImpl<std::__1::__wrap_iter<double*>, std::__1::__wrap_iter<double*>, QuantLib::detail::CubicInterpolationBaseImpl>::isInRange(double) const Unexecuted instantiation: QuantLib::Interpolation::templateImpl<std::__1::__wrap_iter<double*>, std::__1::__wrap_iter<double*>, QuantLib::detail::UpdatedYInterpolation>::isInRange(double) const Unexecuted instantiation: QuantLib::Interpolation::templateImpl<std::__1::__wrap_iter<double*>, double const*, QuantLib::detail::CubicInterpolationBaseImpl>::isInRange(double) const Unexecuted instantiation: QuantLib::Interpolation::templateImpl<std::__1::__wrap_iter<double const*>, double*, QuantLib::Interpolation::Impl>::isInRange(double) const Unexecuted instantiation: QuantLib::Interpolation::templateImpl<double const*, double const*, QuantLib::detail::UpdatedYInterpolation>::isInRange(double) const Unexecuted instantiation: QuantLib::Interpolation::templateImpl<double*, double*, QuantLib::detail::UpdatedYInterpolation>::isInRange(double) const Unexecuted instantiation: QuantLib::Interpolation::templateImpl<std::__1::__wrap_iter<double*>, double const*, QuantLib::Interpolation::Impl>::isInRange(double) const Unexecuted instantiation: QuantLib::Interpolation::templateImpl<std::__1::__wrap_iter<double*>, std::__1::__wrap_iter<double const*>, QuantLib::Interpolation::Impl>::isInRange(double) const Unexecuted instantiation: QuantLib::Interpolation::templateImpl<std::__1::__wrap_iter<double*>, std::__1::__wrap_iter<double*>, QuantLib::detail::AbcdCoeffHolder>::isInRange(double) const Unexecuted instantiation: QuantLib::Interpolation::templateImpl<std::__1::__wrap_iter<double const*>, std::__1::__wrap_iter<double*>, QuantLib::Interpolation::Impl>::isInRange(double) const Unexecuted instantiation: QuantLib::Interpolation::templateImpl<double*, double*, QuantLib::Interpolation::Impl>::isInRange(double) const Unexecuted instantiation: QuantLib::Interpolation::templateImpl<std::__1::__wrap_iter<double const*>, std::__1::__wrap_iter<double const*>, QuantLib::Interpolation::Impl>::isInRange(double) const QuantLib::Interpolation::templateImpl<std::__1::__wrap_iter<double const*>, double*, QuantLib::detail::CubicInterpolationBaseImpl>::isInRange(double) const Line | Count | Source | 94 | 18.9k | bool isInRange(Real x) const override { | 95 | | #if defined(QL_EXTRA_SAFETY_CHECKS) | 96 | | for (I1 i=xBegin_, j=xBegin_+1; j!=xEnd_; ++i, ++j) | 97 | | QL_REQUIRE(*j > *i, "unsorted x values"); | 98 | | #endif | 99 | 18.9k | Real x1 = xMin(), x2 = xMax(); | 100 | 18.9k | return (x >= x1 && x <= x2) || close(x,x1) || close(x,x2); | 101 | 18.9k | } |
Unexecuted instantiation: QuantLib::Interpolation::templateImpl<std::__1::__wrap_iter<double const*>, double const*, QuantLib::detail::CubicInterpolationBaseImpl>::isInRange(double) const Unexecuted instantiation: QuantLib::Interpolation::templateImpl<std::__1::__wrap_iter<double const*>, std::__1::__wrap_iter<double*>, QuantLib::detail::CubicInterpolationBaseImpl>::isInRange(double) const Unexecuted instantiation: QuantLib::Interpolation::templateImpl<double const*, double*, QuantLib::detail::CubicInterpolationBaseImpl>::isInRange(double) const Unexecuted instantiation: QuantLib::Interpolation::templateImpl<double const*, double*, QuantLib::Interpolation::Impl>::isInRange(double) const Unexecuted instantiation: QuantLib::Interpolation::templateImpl<double*, double*, QuantLib::detail::CubicInterpolationBaseImpl>::isInRange(double) const Unexecuted instantiation: QuantLib::Interpolation::templateImpl<std::__1::__wrap_iter<double*>, QuantLib::step_iterator<double*>, QuantLib::Interpolation::Impl>::isInRange(double) const Unexecuted instantiation: QuantLib::Interpolation::templateImpl<std::__1::__wrap_iter<double const*>, std::__1::__wrap_iter<double const*>, QuantLib::detail::CubicInterpolationBaseImpl>::isInRange(double) const Unexecuted instantiation: QuantLib::Interpolation::templateImpl<double const*, double const*, QuantLib::detail::CubicInterpolationBaseImpl>::isInRange(double) const Unexecuted instantiation: QuantLib::Interpolation::templateImpl<double const*, double const*, QuantLib::Interpolation::Impl>::isInRange(double) const Unexecuted instantiation: QuantLib::Interpolation::templateImpl<double*, double const*, QuantLib::Interpolation::Impl>::isInRange(double) const |
102 | | |
103 | | protected: |
104 | 41.3k | Size locate(Real x) const { |
105 | | #if defined(QL_EXTRA_SAFETY_CHECKS) |
106 | | for (I1 i=xBegin_, j=xBegin_+1; j!=xEnd_; ++i, ++j) |
107 | | QL_REQUIRE(*j > *i, "unsorted x values"); |
108 | | #endif |
109 | 41.3k | if (x < *xBegin_) |
110 | 7.93k | return 0; |
111 | 33.3k | else if (x > *(xEnd_-1)) |
112 | 4.77k | return xEnd_-xBegin_-2; |
113 | 28.6k | else |
114 | 28.6k | return std::upper_bound(xBegin_,xEnd_-1,x)-xBegin_-1; |
115 | 41.3k | } QuantLib::Interpolation::templateImpl<std::__1::__wrap_iter<double*>, std::__1::__wrap_iter<double*>, QuantLib::Interpolation::Impl>::locate(double) const Line | Count | Source | 104 | 10.0k | Size locate(Real x) const { | 105 | | #if defined(QL_EXTRA_SAFETY_CHECKS) | 106 | | for (I1 i=xBegin_, j=xBegin_+1; j!=xEnd_; ++i, ++j) | 107 | | QL_REQUIRE(*j > *i, "unsorted x values"); | 108 | | #endif | 109 | 10.0k | if (x < *xBegin_) | 110 | 3.21k | return 0; | 111 | 6.81k | else if (x > *(xEnd_-1)) | 112 | 2.30k | return xEnd_-xBegin_-2; | 113 | 4.50k | else | 114 | 4.50k | return std::upper_bound(xBegin_,xEnd_-1,x)-xBegin_-1; | 115 | 10.0k | } |
QuantLib::Interpolation::templateImpl<std::__1::__wrap_iter<double*>, std::__1::__wrap_iter<double*>, QuantLib::detail::CubicInterpolationBaseImpl>::locate(double) const Line | Count | Source | 104 | 12.3k | Size locate(Real x) const { | 105 | | #if defined(QL_EXTRA_SAFETY_CHECKS) | 106 | | for (I1 i=xBegin_, j=xBegin_+1; j!=xEnd_; ++i, ++j) | 107 | | QL_REQUIRE(*j > *i, "unsorted x values"); | 108 | | #endif | 109 | 12.3k | if (x < *xBegin_) | 110 | 4.72k | return 0; | 111 | 7.67k | else if (x > *(xEnd_-1)) | 112 | 2.46k | return xEnd_-xBegin_-2; | 113 | 5.20k | else | 114 | 5.20k | return std::upper_bound(xBegin_,xEnd_-1,x)-xBegin_-1; | 115 | 12.3k | } |
Unexecuted instantiation: QuantLib::Interpolation::templateImpl<std::__1::__wrap_iter<double*>, double const*, QuantLib::detail::CubicInterpolationBaseImpl>::locate(double) const Unexecuted instantiation: QuantLib::Interpolation::templateImpl<std::__1::__wrap_iter<double const*>, double*, QuantLib::Interpolation::Impl>::locate(double) const Unexecuted instantiation: QuantLib::Interpolation::templateImpl<std::__1::__wrap_iter<double*>, double const*, QuantLib::Interpolation::Impl>::locate(double) const Unexecuted instantiation: QuantLib::Interpolation::templateImpl<std::__1::__wrap_iter<double*>, std::__1::__wrap_iter<double const*>, QuantLib::Interpolation::Impl>::locate(double) const Unexecuted instantiation: QuantLib::Interpolation::templateImpl<std::__1::__wrap_iter<double const*>, std::__1::__wrap_iter<double*>, QuantLib::Interpolation::Impl>::locate(double) const Unexecuted instantiation: QuantLib::Interpolation::templateImpl<double*, double*, QuantLib::Interpolation::Impl>::locate(double) const Unexecuted instantiation: QuantLib::Interpolation::templateImpl<std::__1::__wrap_iter<double const*>, std::__1::__wrap_iter<double const*>, QuantLib::Interpolation::Impl>::locate(double) const QuantLib::Interpolation::templateImpl<std::__1::__wrap_iter<double const*>, double*, QuantLib::detail::CubicInterpolationBaseImpl>::locate(double) const Line | Count | Source | 104 | 18.9k | Size locate(Real x) const { | 105 | | #if defined(QL_EXTRA_SAFETY_CHECKS) | 106 | | for (I1 i=xBegin_, j=xBegin_+1; j!=xEnd_; ++i, ++j) | 107 | | QL_REQUIRE(*j > *i, "unsorted x values"); | 108 | | #endif | 109 | 18.9k | if (x < *xBegin_) | 110 | 0 | return 0; | 111 | 18.9k | else if (x > *(xEnd_-1)) | 112 | 0 | return xEnd_-xBegin_-2; | 113 | 18.9k | else | 114 | 18.9k | return std::upper_bound(xBegin_,xEnd_-1,x)-xBegin_-1; | 115 | 18.9k | } |
Unexecuted instantiation: QuantLib::Interpolation::templateImpl<std::__1::__wrap_iter<double const*>, double const*, QuantLib::detail::CubicInterpolationBaseImpl>::locate(double) const Unexecuted instantiation: QuantLib::Interpolation::templateImpl<std::__1::__wrap_iter<double const*>, std::__1::__wrap_iter<double*>, QuantLib::detail::CubicInterpolationBaseImpl>::locate(double) const Unexecuted instantiation: QuantLib::Interpolation::templateImpl<double const*, double*, QuantLib::detail::CubicInterpolationBaseImpl>::locate(double) const Unexecuted instantiation: QuantLib::Interpolation::templateImpl<double const*, double*, QuantLib::Interpolation::Impl>::locate(double) const Unexecuted instantiation: QuantLib::Interpolation::templateImpl<double*, double*, QuantLib::detail::CubicInterpolationBaseImpl>::locate(double) const Unexecuted instantiation: QuantLib::Interpolation::templateImpl<std::__1::__wrap_iter<double*>, QuantLib::step_iterator<double*>, QuantLib::Interpolation::Impl>::locate(double) const Unexecuted instantiation: QuantLib::Interpolation::templateImpl<std::__1::__wrap_iter<double const*>, std::__1::__wrap_iter<double const*>, QuantLib::detail::CubicInterpolationBaseImpl>::locate(double) const Unexecuted instantiation: QuantLib::Interpolation::templateImpl<double const*, double const*, QuantLib::detail::CubicInterpolationBaseImpl>::locate(double) const Unexecuted instantiation: QuantLib::Interpolation::templateImpl<double const*, double const*, QuantLib::Interpolation::Impl>::locate(double) const Unexecuted instantiation: QuantLib::Interpolation::templateImpl<double*, double const*, QuantLib::Interpolation::Impl>::locate(double) const |
116 | | I1 xBegin_, xEnd_; |
117 | | I2 yBegin_; |
118 | | }; |
119 | | |
120 | 7.46k | Interpolation() = default; |
121 | 0 | bool empty() const { return !impl_; } |
122 | 17.3k | Real operator()(Real x, bool allowExtrapolation = false) const { |
123 | 17.3k | checkRange(x,allowExtrapolation); |
124 | 17.3k | return impl_->value(x); |
125 | 17.3k | } |
126 | 7.41k | Real primitive(Real x, bool allowExtrapolation = false) const { |
127 | 7.41k | checkRange(x,allowExtrapolation); |
128 | 7.41k | return impl_->primitive(x); |
129 | 7.41k | } |
130 | 11.7k | Real derivative(Real x, bool allowExtrapolation = false) const { |
131 | 11.7k | checkRange(x,allowExtrapolation); |
132 | 11.7k | return impl_->derivative(x); |
133 | 11.7k | } |
134 | 8.38k | Real secondDerivative(Real x, bool allowExtrapolation = false) const { |
135 | 8.38k | checkRange(x,allowExtrapolation); |
136 | 8.38k | return impl_->secondDerivative(x); |
137 | 8.38k | } |
138 | 0 | Real xMin() const { |
139 | 0 | return impl_->xMin(); |
140 | 0 | } |
141 | 0 | Real xMax() const { |
142 | 0 | return impl_->xMax(); |
143 | 0 | } |
144 | 0 | std::vector<Real> xValues() const { |
145 | 0 | return impl_->xValues(); |
146 | 0 | } |
147 | 0 | std::vector<Real> yValues() const { |
148 | 0 | return impl_->yValues(); |
149 | 0 | } |
150 | 0 | bool isInRange(Real x) const { |
151 | 0 | return impl_->isInRange(x); |
152 | 0 | } |
153 | 124 | void update() { |
154 | 124 | impl_->update(); |
155 | 124 | } |
156 | | protected: |
157 | | ext::shared_ptr<Impl> impl_; |
158 | | |
159 | 44.9k | void checkRange(Real x, bool extrapolate) const { |
160 | 44.9k | QL_REQUIRE(extrapolate || allowsExtrapolation() || |
161 | 44.9k | impl_->isInRange(x), |
162 | 44.9k | "interpolation range is [" |
163 | 44.9k | << impl_->xMin() << ", " << impl_->xMax() |
164 | 44.9k | << "]: extrapolation at " << x << " not allowed"); |
165 | 44.9k | } |
166 | | friend class MixedLinearCubicInterpolation; |
167 | | }; |
168 | | |
169 | | namespace detail { |
170 | | |
171 | | template <class Interpolator, class I1, class I2> |
172 | | Interpolation interpolateWithoutUpdate(const Interpolator& interpolator, |
173 | | const I1& xBegin, |
174 | | const I1& xEnd, |
175 | 124 | const I2& yBegin) { |
176 | | if constexpr (std::is_invocable_v<decltype(&Interpolator::template interpolate<I1, I2>), |
177 | | const Interpolator&, |
178 | 124 | const I1&, const I1&, const I2&, bool>) { |
179 | 124 | return interpolator.interpolate(xBegin, xEnd, yBegin, false); |
180 | | } else { |
181 | | return interpolator.interpolate(xBegin, xEnd, yBegin); |
182 | | } |
183 | 124 | } QuantLib::Interpolation QuantLib::detail::interpolateWithoutUpdate<QuantLib::Linear, std::__1::__wrap_iter<double*>, std::__1::__wrap_iter<double*> >(QuantLib::Linear const&, std::__1::__wrap_iter<double*> const&, std::__1::__wrap_iter<double*> const&, std::__1::__wrap_iter<double*> const&) Line | Count | Source | 175 | 14 | const I2& yBegin) { | 176 | | if constexpr (std::is_invocable_v<decltype(&Interpolator::template interpolate<I1, I2>), | 177 | | const Interpolator&, | 178 | 14 | const I1&, const I1&, const I2&, bool>) { | 179 | 14 | return interpolator.interpolate(xBegin, xEnd, yBegin, false); | 180 | | } else { | 181 | | return interpolator.interpolate(xBegin, xEnd, yBegin); | 182 | | } | 183 | 14 | } |
QuantLib::Interpolation QuantLib::detail::interpolateWithoutUpdate<QuantLib::Cubic, std::__1::__wrap_iter<double*>, std::__1::__wrap_iter<double*> >(QuantLib::Cubic const&, std::__1::__wrap_iter<double*> const&, std::__1::__wrap_iter<double*> const&, std::__1::__wrap_iter<double*> const&) Line | Count | Source | 175 | 110 | const I2& yBegin) { | 176 | | if constexpr (std::is_invocable_v<decltype(&Interpolator::template interpolate<I1, I2>), | 177 | | const Interpolator&, | 178 | 110 | const I1&, const I1&, const I2&, bool>) { | 179 | 110 | return interpolator.interpolate(xBegin, xEnd, yBegin, false); | 180 | | } else { | 181 | | return interpolator.interpolate(xBegin, xEnd, yBegin); | 182 | | } | 183 | 110 | } |
|
184 | | |
185 | | } |
186 | | } |
187 | | |
188 | | #endif |