File: globalbootstrapvars.hpp

package info (click to toggle)
quantlib 1.41-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 41,480 kB
  • sloc: cpp: 400,885; makefile: 6,547; python: 214; sh: 150; lisp: 86
file content (32 lines) | stat: -rw-r--r-- 912 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
/* -*- mode: c++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */

#ifndef quantlib_global_bootstrap_vars_hpp
#define quantlib_global_bootstrap_vars_hpp

#include <ql/quotes/simplequote.hpp>
#include <ql/shared_ptr.hpp>
#include <ql/termstructures/globalbootstrap.hpp>

namespace QuantLib {

class SimpleQuoteVariables : public AdditionalBootstrapVariables {
  public:
    explicit SimpleQuoteVariables(
        std::vector<ext::shared_ptr<SimpleQuote>> quotes,
        std::vector<Real> initialGuesses = {},
        std::vector<Real> lowerBounds = {});

    Array initialize(bool validData) override;
    void update(const Array& x) override;

  private:
    Real transformDirect(Real x, Size i) const;
    Real transformInverse(Real x, Size i) const;

    std::vector<ext::shared_ptr<SimpleQuote>> quotes_;
    std::vector<Real> initialGuesses_, lowerBounds_;
};

} // namespace QuantLib

#endif