QuantLib: a free/open-source library for quantitative finance
Fully annotated sources - version 1.32
Loading...
Searching...
No Matches
levenbergmarquardt.hpp
1/* -*- mode: c++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2
3/*
4 Copyright (C) 2006 Klaus Spanderen
5 Copyright (C) 2015 Peter Caspers
6
7 This file is part of QuantLib, a free-software/open-source library
8 for financial quantitative analysts and developers - http://quantlib.org/
9
10 QuantLib is free software: you can redistribute it and/or modify it
11 under the terms of the QuantLib license. You should have received a
12 copy of the license along with this program; if not, please email
13 <quantlib-dev@lists.sf.net>. The license is also available online at
14 <http://quantlib.org/license.shtml>.
15
16 This program is distributed in the hope that it will be useful, but WITHOUT
17 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
18 FOR A PARTICULAR PURPOSE. See the license for more details.
19*/
20
25#ifndef quantlib_optimization_levenberg_marquardt_hpp
26#define quantlib_optimization_levenberg_marquardt_hpp
27
28#include <ql/math/optimization/problem.hpp>
29
30namespace QuantLib {
31
33
50 public:
51 LevenbergMarquardt(Real epsfcn = 1.0e-8,
52 Real xtol = 1.0e-8,
53 Real gtol = 1.0e-8,
54 bool useCostFunctionsJacobian = false);
56 const EndCriteria& endCriteria //= EndCriteria()
57 ) override;
58 // = EndCriteria(400, 1.0e-8, 1.0e-8)
59 virtual Integer getInfo() const;
60 void fcn(int m,
61 int n,
62 Real* x,
63 Real* fvec,
64 int* iflag);
65 void jacFcn(int m,
66 int n,
67 Real* x,
68 Real* fjac,
69 int* iflag);
70
71 private:
75 mutable Integer info_ = 0;
78 };
79
80}
81
82
83#endif
1-D array used in linear algebra.
Definition: array.hpp:52
Criteria to end optimization process:
Definition: endcriteria.hpp:40
Levenberg-Marquardt optimization method.
void fcn(int m, int n, Real *x, Real *fvec, int *iflag)
virtual Integer getInfo() const
void jacFcn(int m, int n, Real *x, Real *fjac, int *iflag)
EndCriteria::Type minimize(Problem &P, const EndCriteria &endCriteria) override
minimize the optimization problem P
Matrix used in linear algebra.
Definition: matrix.hpp:41
Abstract class for constrained optimization method.
Definition: method.hpp:36
Constrained optimization problem.
Definition: problem.hpp:42
QL_REAL Real
real number
Definition: types.hpp:50
QL_INTEGER Integer
integer number
Definition: types.hpp:35
Definition: any.hpp:35