Commit 6c4cdaa4 by Francois Gygi

Modified to conform to the More-Thuente paper. Simplified interpolation to

use secant rather than polynomial fits. Simplified activation of debug printout.


git-svn-id: http://qboxcode.org/svn/qb/trunk@1013 cba15fb0-1239-40c8-b417-11db7ca47a34
parent 4ee7130b
......@@ -25,28 +25,35 @@ class LineMinimizer
double f0,fp0,fm,fpm,f_low,fp_low,f_high,fp_high,
alpha_m,alpha_low,alpha_high;
bool first_use, done_, fail_, bracketing;
double alpha_start_, sigma1_, sigma2_;
bool first_use, done_, fail_, bracketing, use_psi;
bool debug_print;
double alpha_start_, alpha_max_, sigma1_, sigma2_;
int nstep_, nstep_max_;
double psi(double alpha, double f) { return f - f0 - alpha * fp0 * sigma1_; }
double psip(double fp) { return fp - fp0 * sigma1_; }
double interpolate(void);
public:
LineMinimizer(void) : sigma1_(0.1), sigma2_(0.5), alpha_start_(1.0),
first_use(true), done_(false), fail_(false), bracketing(false), nstep_(0),
nstep_max_(10) {}
LineMinimizer(void) : sigma1_(0.1), sigma2_(0.5), alpha_start_(0.1),
alpha_max_(1.0), first_use(true), done_(false), fail_(false),
bracketing(false), use_psi(true), nstep_(0), nstep_max_(5),
debug_print(false) {}
void reset(void) { first_use = true; done_ = false; fail_ = false;
bracketing = false; nstep_ = 0; }
double sigma1(void) const { return sigma1_; }
double sigma2(void) const { return sigma2_; }
double alpha_start(void) const { return alpha_start_; }
double alpha_max(void) const { return alpha_max_; }
bool done(void) const { return done_; }
bool fail(void) const { return fail_; }
void set_sigma1(double s) { sigma1_ = s; }
void set_sigma2(double s) { sigma2_ = s; }
void set_alpha_start(double a) { alpha_start_ = a; }
void set_alpha_max(double a) { alpha_max_ = a; }
void set_debug_print(void) { debug_print = true; }
double next_alpha(double alpha, double f, double fp);
};
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment