core/vnl/algo/vnl_bracket_minimum.h
Go to the documentation of this file.
00001 // This is core/vnl/algo/vnl_bracket_minimum.h
00002 #ifndef vnl_bracket_minimum_h_
00003 #define vnl_bracket_minimum_h_
00004 #ifdef VCL_NEEDS_PRAGMA_INTERFACE
00005 #pragma interface
00006 #endif
00007 //:
00008 // \file
00009 // \brief Function to bracket a minimum
00010 // \author Tim Cootes
00011 // \date   Feb 2007
00012 //
00013 // \verbatim
00014 //  Modifications
00015 // \endverbatim
00016 
00017 #include <vnl/vnl_cost_function.h>
00018 
00019 //: Given initial values a and b, find bracket a<b<c s.t. f(a)>f(b)<f(c)
00020 //  Final function values at a,b,c stored in fa,fb,fc.
00021 //
00022 //  The algorithm takes increasingly large steps in a downhill direction
00023 //  until it starts going up again.  To speed things up, it also fits
00024 //  a parabola to the last three points, which it uses to predict the
00025 //  possible minimum directly ( hopefully automatically choosing a
00026 //  sensible step size).
00027 //
00028 //  Note that there's currently nothing
00029 //  to stop it if it is supplied with a monotonic function - it will just continue
00030 //  forever.
00031 void vnl_bracket_minimum(vnl_cost_function& f,
00032                          double& a, double& b, double& c,
00033                          double& fa, double& fb, double& fc);
00034 
00035 #endif // vnl_bracket_minimum_h_