QuantLib: a free/open-source library for quantitative finance
Fully annotated sources - version 1.32
Loading...
Searching...
No Matches
simplex.hpp
1/* -*- mode: c++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2
3/*
4 Copyright (C) 2006 Ferdinando Ametrano
5 Copyright (C) 2001, 2002, 2003 Sadruddin Rejeb
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/* The implementation of the algorithm was inspired by
26 * "Numerical Recipes in C", 2nd edition, Press, Teukolsky, Vetterling, Flannery
27 * Chapter 10
28 */
29
30#ifndef quantlib_optimization_simplex_hpp
31#define quantlib_optimization_simplex_hpp
32
33#include <ql/math/optimization/problem.hpp>
34#include <vector>
35
36namespace QuantLib {
37
39
58 class Simplex : public OptimizationMethod {
59 public:
62 EndCriteria::Type minimize(Problem& P, const EndCriteria& endCriteria) override;
63 Real lambda() const { return lambda_; }
64
65 private:
67 Size iHighest,
68 Real& factor) const;
70 mutable std::vector<Array> vertices_;
71 mutable Array values_, sum_;
72 };
73
74}
75
76#endif
1-D array used in linear algebra.
Definition: array.hpp:52
Criteria to end optimization process:
Definition: endcriteria.hpp:40
Abstract class for constrained optimization method.
Definition: method.hpp:36
Constrained optimization problem.
Definition: problem.hpp:42
Multi-dimensional simplex class.
Definition: simplex.hpp:58
Real lambda() const
Definition: simplex.hpp:63
std::vector< Array > vertices_
Definition: simplex.hpp:70
Real extrapolate(Problem &P, Size iHighest, Real &factor) const
Definition: simplex.cpp:58
Simplex(Real lambda)
Definition: simplex.hpp:61
EndCriteria::Type minimize(Problem &P, const EndCriteria &endCriteria) override
minimize the optimization problem P
Definition: simplex.cpp:96
QL_REAL Real
real number
Definition: types.hpp:50
std::size_t Size
size of a container
Definition: types.hpp:58
Definition: any.hpp:35