QuantLib: a free/open-source library for quantitative finance
Fully annotated sources - version 1.32
Loading...
Searching...
No Matches
endcriteria.hpp
1/* -*- mode: c++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2
3/*
4 Copyright (C) 2006, 2007 Ferdinando Ametrano
5 Copyright (C) 2007 Marco Bianchetti
6 Copyright (C) 2001, 2002, 2003 Nicolas Di Césaré
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 <http://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
26#ifndef quantlib_optimization_criteria_hpp
27#define quantlib_optimization_criteria_hpp
28
29#include <ql/utilities/null.hpp>
30#include <iosfwd>
31
32namespace QuantLib {
33
35
41 public:
42 enum Type {None,
49
56
57 // Inspectors
58 Size maxIterations() const;
60 Real rootEpsilon() const;
61 Real functionEpsilon() const;
63
66 bool operator()(Size iteration,
67 Size& statState,
68 bool positiveOptimization,
69 Real fold,
70 Real normgold,
71 Real fnew,
72 Real normgnew,
73 EndCriteria::Type& ecType) const;
74
76 bool checkMaxIterations(Size iteration, EndCriteria::Type& ecType) const;
78 bool checkStationaryPoint(Real xOld,
79 Real xNew,
80 Size& statStateIterations,
81 EndCriteria::Type& ecType) const;
84 Real fxNew,
85 Size& statStateIterations,
86 EndCriteria::Type& ecType) const;
89 bool positiveOptimization,
90 EndCriteria::Type& ecType) const;
92 //bool checkZerGradientNormValue(const Real gNormOld,
93 // const Real gNormNew,
94 // EndCriteria::Type& ecType) const;
96 bool checkZeroGradientNorm(Real gNorm, EndCriteria::Type& ecType) const;
97
98 protected:
105
106 };
107
108 std::ostream& operator<<(std::ostream& out, EndCriteria::Type ecType);
109
110}
111
112#endif
Criteria to end optimization process:
Definition: endcriteria.hpp:40
bool operator()(Size iteration, Size &statState, bool positiveOptimization, Real fold, Real normgold, Real fnew, Real normgnew, EndCriteria::Type &ecType) const
bool checkStationaryFunctionAccuracy(Real f, bool positiveOptimization, EndCriteria::Type &ecType) const
Definition: endcriteria.cpp:95
Real gradientNormEpsilon() const
bool checkZeroGradientNorm(Real gNorm, EndCriteria::Type &ecType) const
Real functionEpsilon() const
bool checkStationaryPoint(Real xOld, Real xNew, Size &statStateIterations, EndCriteria::Type &ecType) const
Definition: endcriteria.cpp:64
Real rootEpsilon() const
Size maxIterations() const
Size maxStationaryStateIterations_
Maximun number of iterations in stationary state.
bool checkStationaryFunctionValue(Real fxOld, Real fxNew, Size &statStateIterations, EndCriteria::Type &ecType) const
Definition: endcriteria.cpp:79
Real rootEpsilon_
root, function and gradient epsilons
Size maxStationaryStateIterations() const
Size maxIterations_
Maximum number of iterations.
bool checkMaxIterations(Size iteration, EndCriteria::Type &ecType) const
Definition: endcriteria.cpp:56
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
std::ostream & operator<<(std::ostream &out, GFunctionFactory::YieldCurveModel type)