Go to the documentation of this file.00001
00002
00003
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031
00032
00033
00034 #ifndef __GSL_MIN_FMINIMIZER_H
00035 #define __GSL_MIN_FMINIMIZER_H
00036
00037 #include <gsl/gsl_errno.h>
00038 #include <gsl/gsl_min.h>
00039
00041
00042
00043 class min_f
00044 {
00045 public:
00046
00048
00050
00051
00052 virtual double operator()(const double& x);
00053
00055
00058
00059
00060 static double f(double x, void *p);
00061
00062 };
00063
00065
00066
00067 class min_fminimizer
00068 {
00069 public:
00070
00072
00075
00076
00077 min_fminimizer(const gsl_min_fminimizer_type* type=gsl_min_fminimizer_brent);
00078
00080
00082
00083
00084 ~min_fminimizer();
00085
00087
00095
00096
00097 int set(min_f& function, double minimum, double x_lower, double x_upper);
00099
00108
00109 int set_with_values(min_f& function,
00110 double minimum, double f_minimum,
00111 double x_lower,double f_lower,
00112 double x_upper, double f_upper);
00113
00115
00121
00122 int iterate();
00123
00125
00126
00127 double minimum();
00128
00130
00131
00132 double x_upper();
00133
00135
00136
00137 double x_lower();
00138
00140
00142
00143 void SetMaxIterations(int n);
00144
00146
00147
00148 int GetNIterations();
00149
00151
00153
00154
00155 bool is_converged();
00156
00157 private:
00158
00160
00161
00162 void assert_set();
00163
00165
00166
00167 bool isSet;
00168
00170
00171
00172 bool isConverged;
00173
00175
00176
00177 int nIterations;
00178
00180
00181
00182 int maxIterations;
00183
00185
00186
00187 gsl_min_fminimizer* s;
00188
00190
00191 gsl_function f;
00192 };
00193
00194 #endif //__min_fminimizer_h