Fix error message for Brent's method when it doesn't get a solution

This commit is contained in:
Ian Bell
2014-12-31 12:30:25 -05:00
parent a7fcf0e814
commit 6dd8399436

View File

@@ -374,7 +374,7 @@ double Brent(FuncWrapper1D* f, double a, double b, double macheps, double t, int
if (!ValidNumber(c)){
throw ValueError(format("Brent's method c is NAN").c_str());}
if (iter>maxiter){
throw SolutionError(std::string("Brent's method reached maximum number of steps of %d ", maxiter));}
throw SolutionError(format("Brent's method reached maximum number of steps of %d ", maxiter));}
if (std::abs(fb)< 2*macheps*std::abs(b)){
return b;
}