Function to bracket a minimum. More...
Go to the source code of this file.
Functions | |
| void VNL_ALGO_EXPORT | 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). More... | |
| void VNL_ALGO_EXPORT 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 34 of file vnl_bracket_minimum.cxx.
1.8.15