1D minimization additions and doc comment
Jeff Spirko
spirko@Topquark.physics.lehigh.edu
Tue Apr 2 12:13:00 GMT 2002
I threw together functions for accessing the values of the function
being minimized, which are stored in the minimizer structure. I
also included a doc string for the functions (check this). It
seemed cleaner to do it this way than to access the structure
myself. A patch is attached, referenced to gsl-1.1.1. Please TEST
the code, I haven't yet. :-(
Also, the use of the terms x_lower, x_upper, and minimum in the docs
caused me to look at the source code to make sure that minimum
wasn't really f_minimum. Maybe it should be called x_min instead?
Earlier in the Overview section these variables are referred to as
a, b, and x, though I'd prefer the longer names for the code. Maybe
there should be a sentence relating the two sets of names.
--
Jeff Spirko spirko@lehigh.edu spirko@yahoo.com WD3V
The study of non-linear physics is like the study of non-elephant biology.
All theoretical chemistry is really physics;
and all theoretical chemists know it. -- Richard P. Feynman
-------------- next part --------------
--- ./min/fsolver.c~ Wed Oct 3 06:38:09 2001
+++ ./min/fsolver.c Tue Apr 2 14:56:27 2002
@@ -173,3 +173,21 @@
return s->x_upper;
}
+double
+gsl_min_fminimizer_f_minimum (const gsl_min_fminimizer * s)
+{
+ return s->f_minimum;
+}
+
+double
+gsl_min_fminimizer_f_lower (const gsl_min_fminimizer * s)
+{
+ return s->f_lower;
+}
+
+double
+gsl_min_fminimizer_f_upper (const gsl_min_fminimizer * s)
+{
+ return s->f_upper;
+}
+
--- ./min/gsl_min.h~ Sun Jul 15 12:33:06 2001
+++ ./min/gsl_min.h Tue Apr 2 14:48:03 2002
@@ -77,6 +77,9 @@
double gsl_min_fminimizer_minimum (const gsl_min_fminimizer * s);
double gsl_min_fminimizer_x_lower (const gsl_min_fminimizer * s);
double gsl_min_fminimizer_x_upper (const gsl_min_fminimizer * s);
+double gsl_min_fminimizer_f_minimum (const gsl_min_fminimizer * s);
+double gsl_min_fminimizer_f_lower (const gsl_min_fminimizer * s);
+double gsl_min_fminimizer_f_upper (const gsl_min_fminimizer * s);
int
gsl_min_test_interval (double x_lower, double x_upper, double epsabs, double epsrel);
--- ./doc/min.texi~ Tue Feb 12 17:34:18 2002
+++ ./doc/min.texi Tue Apr 2 14:52:29 2002
@@ -233,6 +233,13 @@
for the minimizer @var{s}.
@end deftypefun
+@deftypefun double gsl_min_fminimizer_f_minimum (const gsl_min_fminimizer *@var{s})
+@deftypefunx double gsl_min_fminimizer_f_upper (const gsl_min_fminimizer *@var{s})
+@deftypefunx double gsl_min_fminimizer_f_lower (const gsl_min_fminimizer *@var{s})
+These functions return the value of the function at the current estimate
+of the minimum and at the upper and lower bounds of interval for the
+minimizer @var{s}.
+
@node Minimization Stopping Parameters
@section Stopping Parameters
@cindex minimization, stopping parameters
More information about the Gsl-discuss
mailing list