Commit 66305fdd by Francois Gygi

Add set_nstep_max function to LineMinimizer

parent e800eeb3
......@@ -189,7 +189,7 @@ double LineMinimizer::next_alpha(double alpha, double f, double fp)
{
// we are already in bracketing mode
nstep_++;
if ( nstep_ > nstep_max_ )
if ( nstep_max_ > 0 && nstep_ > nstep_max_ )
{
if ( debug_print )
cout << "LineMinimizer: fail, nstep_max" << endl;
......
......@@ -53,6 +53,7 @@ class LineMinimizer
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_nstep_max(int n) { nstep_max_ = n; }
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