Function to bracket a minimum. More...
#include <vnl/vnl_cost_function.h>
Go to the source code of this file.
Functions | |
void | vnl_bracket_minimum (vnl_cost_function &f, double &a, double &b, double &c, double &fa, double &fb, double &fc) |
Given initial values a and b, find bracket a<b<c s.t. f(a)>f(b)<f(c). |
Function to bracket a minimum.
Modifications
Definition in file vnl_bracket_minimum.h.
void vnl_bracket_minimum | ( | vnl_cost_function & | fn, |
double & | a, | ||
double & | b, | ||
double & | c, | ||
double & | fa, | ||
double & | fb, | ||
double & | fc | ||
) |
Given initial values a and b, find bracket a<b<c s.t. f(a)>f(b)<f(c).
Final function values at a,b,c stored in fa,fb,fc.
The algorithm takes increasingly large steps in a downhill direction until it starts going up again. To speed things up, it also fits a parabola to the last three points, which it uses to predict the possible minimum directly ( hopefully automatically choosing a sensible step size).
Note that there's currently nothing to stop it if it is supplied with a monotonic function - it will just continue forever.
Final function values at a,b,c stored in fa,fb,fc
Definition at line 38 of file vnl_bracket_minimum.cxx.