Logo ROOT  
Reference Guide
GSLMinimizer.h
Go to the documentation of this file.
1// @(#)root/mathmore:$Id$
2// Author: L. Moneta Wed Oct 18 11:48:00 2006
3
4 /**********************************************************************
5 * *
6 * Copyright (c) 2006 LCG ROOT Math Team, CERN/PH-SFT *
7 * *
8 * This library is free software; you can redistribute it and/or *
9 * modify it under the terms of the GNU General Public License *
10 * as published by the Free Software Foundation; either version 2 *
11 * of the License, or (at your option) any later version. *
12 * *
13 * This library is distributed in the hope that it will be useful, *
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of *
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *
16 * General Public License for more details. *
17 * *
18 * You should have received a copy of the GNU General Public License *
19 * along with this library (see file COPYING); if not, write *
20 * to the Free Software Foundation, Inc., 59 Temple Place, Suite *
21 * 330, Boston, MA 02111-1307 USA, or contact the author. *
22 * *
23 **********************************************************************/
24
25
26// Header file for class GSLMinimizer
27
28#ifndef ROOT_Math_GSLMinimizer
29#define ROOT_Math_GSLMinimizer
30
31#include "Math/Minimizer.h"
32
33#include "Math/IFunctionfwd.h"
34
36
37#include "Math/BasicMinimizer.h"
38
39#include <vector>
40#include <string>
41
42
43
44namespace ROOT {
45
46namespace Math {
47
48
49 /**
50 enumeration specifying the types of GSL minimizers
51 @ingroup MultiMin
52 */
59 };
60
61
62 class GSLMultiMinimizer;
63
64 class MinimTransformFunction;
65
66
67//_____________________________________________________________________________________
68/**
69 GSLMinimizer class.
70 Implementation of the ROOT::Math::Minimizer interface using the GSL multi-dimensional
71 minimization algorithms.
72
73 See <A HREF="http://www.gnu.org/software/gsl/manual/html_node/Multidimensional-Minimization.html">GSL doc</A>
74 from more info on the GSL minimization algorithms.
75
76 The class implements the ROOT::Math::Minimizer interface and can be instantiated using the
77 ROOT plugin manager (plugin name is "GSLMultiMin"). The varius minimization algorithms
78 (conjugatefr, conjugatepr, bfgs, etc..) can be passed as enumerations and also as a string.
79 The default algorithm is conjugatefr (Fletcher-Reeves conjugate gradient algorithm).
80
81 @ingroup MultiMin
82*/
84
85public:
86
87 /**
88 Default constructor
89 */
91
92 /**
93 Constructor with a string giving name of algorithm
94 */
95 GSLMinimizer (const char * type );
96
97 /**
98 Destructor
99 */
100 virtual ~GSLMinimizer ();
101
102private:
103 // usually copying is non trivial, so we make this unaccessible
104
105 /**
106 Copy constructor
107 */
109
110 /**
111 Assignment operator
112 */
114 if (this == &rhs) return *this; // time saving self-test
115 return *this;
116 }
117
118public:
119
120 /// set the function to minimize
121 virtual void SetFunction(const ROOT::Math::IMultiGenFunction & func);
122
123 /// set the function to minimize
125
126 /// method to perform the minimization
127 virtual bool Minimize();
128
129
130 /// return expected distance reached from the minimum
131 virtual double Edm() const { return 0; } // not impl. }
132
133
134 /// return pointer to gradient values at the minimum
135 virtual const double * MinGradient() const;
136
137 /// number of function calls to reach the minimum
138 virtual unsigned int NCalls() const;
139
140
141 /// minimizer provides error and error matrix
142 virtual bool ProvidesError() const { return false; }
143
144 /// return errors at the minimum
145 virtual const double * Errors() const {
146 return 0;
147 }
148
149 /** return covariance matrices elements
150 if the variable is fixed the matrix is zero
151 The ordering of the variables is the same as in errors
152 */
153 virtual double CovMatrix(unsigned int , unsigned int ) const { return 0; }
154
155
156
157
158protected:
159
160private:
161
162
164
165 double fLSTolerance; // Line Search Tolerance
166
167};
168
169 } // end namespace Fit
170
171} // end namespace ROOT
172
173
174
175#endif /* ROOT_Math_GSLMinimizer */
int type
Definition: TGX11.cxx:120
Base Minimizer class, which defines the basic funcionality of various minimizer implementations (apar...
virtual void SetFunction(const ROOT::Math::IMultiGenFunction &func)
set the function to minimize
GSLMinimizer class.
Definition: GSLMinimizer.h:83
virtual unsigned int NCalls() const
number of function calls to reach the minimum
virtual const double * MinGradient() const
return pointer to gradient values at the minimum
virtual double Edm() const
return expected distance reached from the minimum
Definition: GSLMinimizer.h:131
ROOT::Math::GSLMultiMinimizer * fGSLMultiMin
Definition: GSLMinimizer.h:163
virtual double CovMatrix(unsigned int, unsigned int) const
return covariance matrices elements if the variable is fixed the matrix is zero The ordering of the v...
Definition: GSLMinimizer.h:153
GSLMinimizer & operator=(const GSLMinimizer &rhs)
Assignment operator.
Definition: GSLMinimizer.h:113
GSLMinimizer(ROOT::Math::EGSLMinimizerType type=ROOT::Math::kConjugateFR)
Default constructor.
virtual bool Minimize()
method to perform the minimization
virtual ~GSLMinimizer()
Destructor.
virtual void SetFunction(const ROOT::Math::IMultiGradFunction &func)
set the function to minimize
Definition: GSLMinimizer.h:124
virtual bool ProvidesError() const
minimizer provides error and error matrix
Definition: GSLMinimizer.h:142
GSLMinimizer(const GSLMinimizer &)
Copy constructor.
Definition: GSLMinimizer.h:108
virtual void SetFunction(const ROOT::Math::IMultiGenFunction &func)
set the function to minimize
virtual const double * Errors() const
return errors at the minimum
Definition: GSLMinimizer.h:145
GSLMultiMinimizer class , for minimizing multi-dimensional function using derivatives.
Documentation for the abstract class IBaseFunctionMultiDim.
Definition: IFunction.h:62
Interface (abstract class) for multi-dimensional functions providing a gradient calculation.
Definition: IFunction.h:327
EGSLMinimizerType
enumeration specifying the types of GSL minimizers
Definition: GSLMinimizer.h:53
@ kSteepestDescent
Definition: GSLMinimizer.h:58
Namespace for new Math classes and functions.
tbb::task_arena is an alias of tbb::interface7::task_arena, which doesn't allow to forward declare tb...
Definition: StringConv.hxx:21