Skip to content
Snippets Groups Projects
Commit c4b417f3 authored by Jesper Andersson's avatar Jesper Andersson
Browse files

removed debug printouts for amoeba

parent 505a1b22
No related branches found
No related tags found
No related merge requests found
......@@ -400,28 +400,28 @@ NonlinOut levmar(const NonlinParam& p, const NonlinCF& cfo)
NonlinOut amoeba(const NonlinParam& p,
const NonlinCF& cfo)
{
cout << "Initialsing simplex" << endl;
// cout << "Initialsing simplex" << endl;
Simplex smplx(p.Par(),cfo);
p.SetCF(smplx.BestFuncVal());
while (p.NextIter()) {
// Check for convergence based on fractional difference
// between best and worst points in simplex.
cout << "New iteration: Checking for convergence" << endl;
// cout << "New iteration: Checking for convergence" << endl;
if (zero_cf_diff_conv(smplx.WorstFuncVal(),smplx.BestFuncVal(),p.FractionalCFTolerance())) {
p.SetStatus(NL_CFCONV);
return(p.Status());
}
cout << "Attempting reflexion" << endl;
// cout << "Attempting reflexion" << endl;
double newf = smplx.Reflect(); // Attempt reflexion
// Extend into an expansion if reflexion very successful
if (newf <= smplx.BestFuncVal()) {
cout << "Reflexion succesful: attempting expansion" << endl;
// cout << "Reflexion succesful: attempting expansion" << endl;
smplx.Expand(); // Attempt expansion
}
else if (newf >= smplx.SecondWorstFuncVal()) {
cout << "New value worse than second worst: attempting contraction" << endl;
// cout << "New value worse than second worst: attempting contraction" << endl;
double worst_fval = smplx.WorstFuncVal();
newf = smplx.Contract(); // Do a contraction towards plane of "better" points
if (newf >= worst_fval) { // Didn't work. Contract towards best point
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment