00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027 #ifndef ROOT_Math_GSLSimAnMinimizer
00028 #define ROOT_Math_GSLSimAnMinimizer
00029
00030
00031
00032 #ifndef ROOT_Math_Minimizer
00033 #include "Math/Minimizer.h"
00034 #endif
00035
00036
00037 #ifndef ROOT_Math_IFunctionfwd
00038 #include "Math/IFunctionfwd.h"
00039 #endif
00040
00041 #ifndef ROOT_Math_IParamFunctionfwd
00042 #include "Math/IParamFunctionfwd.h"
00043 #endif
00044
00045
00046
00047 #ifndef ROOT_Math_GSLSimAnnealing
00048 #include "Math/GSLSimAnnealing.h"
00049 #endif
00050
00051 #ifndef ROOT_Math_MinimizerVariable
00052 #include "Math/MinimizerVariable.h"
00053 #endif
00054
00055 #include <vector>
00056 #include <map>
00057
00058
00059
00060 namespace ROOT {
00061
00062 namespace Math {
00063
00064 class MinimTransformFunction;
00065
00066
00067
00068
00069
00070
00071
00072
00073
00074
00075
00076
00077
00078 class GSLSimAnMinimizer : public ROOT::Math::Minimizer {
00079
00080 public:
00081
00082
00083
00084
00085 GSLSimAnMinimizer (int type = 0);
00086
00087
00088
00089
00090 ~GSLSimAnMinimizer ();
00091
00092 private:
00093
00094
00095
00096
00097
00098 GSLSimAnMinimizer(const GSLSimAnMinimizer &) : ROOT::Math::Minimizer() {}
00099
00100
00101
00102
00103 GSLSimAnMinimizer & operator = (const GSLSimAnMinimizer & rhs) {
00104 if (this == &rhs) return *this;
00105 return *this;
00106 }
00107
00108 public:
00109
00110
00111 virtual void SetFunction(const ROOT::Math::IMultiGenFunction & func);
00112
00113
00114 virtual void SetFunction(const ROOT::Math::IMultiGradFunction & func);
00115
00116
00117 virtual bool SetVariable(unsigned int ivar, const std::string & name, double val, double step);
00118
00119
00120 virtual bool SetFixedVariable(unsigned int , const std::string & , double );
00121
00122
00123 virtual bool SetLowerLimitedVariable(unsigned int ivar , const std::string & name , double val , double step , double lower );
00124
00125 virtual bool SetUpperLimitedVariable(unsigned int ivar , const std::string & name , double val , double step , double upper );
00126
00127 virtual bool SetLimitedVariable(unsigned int ivar , const std::string & name , double val , double step , double , double );
00128
00129
00130 virtual bool SetVariableValue(unsigned int ivar, double val );
00131
00132 virtual bool SetVariableValues(const double * x);
00133
00134
00135
00136 virtual bool Minimize();
00137
00138
00139 virtual double MinValue() const { return fMinVal; }
00140
00141
00142 virtual double Edm() const { return 0; }
00143
00144
00145 virtual const double * X() const { return &fValues.front(); }
00146
00147
00148 virtual const double * MinGradient() const { return 0; }
00149
00150
00151 virtual unsigned int NCalls() const { return 0; }
00152
00153
00154
00155 virtual unsigned int NDim() const { return fDim; }
00156
00157
00158
00159 virtual unsigned int NFree() const { return fDim; }
00160
00161
00162 virtual bool ProvidesError() const { return false; }
00163
00164
00165 virtual const double * Errors() const { return 0; }
00166
00167
00168
00169
00170
00171 virtual double CovMatrix(unsigned int , unsigned int ) const { return 0; }
00172
00173
00174
00175
00176
00177
00178 protected:
00179
00180 private:
00181
00182 unsigned int fDim;
00183 bool fOwnFunc;
00184
00185 ROOT::Math::GSLSimAnnealing fSolver;
00186 const ROOT::Math::IMultiGenFunction * fObjFunc;
00187
00188 double fMinVal;
00189
00190 mutable std::vector<double> fValues;
00191
00192 std::vector<double> fSteps;
00193 std::vector<std::string> fNames;
00194 std::vector<ROOT::Math::EMinimVariableType> fVarTypes;
00195 std::map< unsigned int, std::pair<double, double> > fBounds;
00196
00197 };
00198
00199 }
00200
00201 }
00202
00203
00204 #endif