1
0
mirror of https://github.com/aportelli/LatAnalyze.git synced 2024-09-20 05:25:37 +01:00

NloptMinimizer: more precise output

This commit is contained in:
Antonin Portelli 2016-04-05 11:50:45 +01:00
parent 07bacf0e4b
commit d0ef32fb9e

View File

@ -94,7 +94,7 @@ const DVec & NloptMinimizer::operator()(const DoubleFunction &f)
cout << "Algorithm: " << min.get_algorithm_name() << endl; cout << "Algorithm: " << min.get_algorithm_name() << endl;
cout << "Max eval.= " << min.get_maxeval(); cout << "Max eval.= " << min.get_maxeval();
cout << " -- Precision= " << min.get_xtol_rel() << endl; cout << " -- Precision= " << min.get_xtol_rel() << endl;
cout << "starting f(x)= " << f(x) << endl; printf("Starting f(x)= %.10e\n", f(x));
} }
try try
{ {
@ -108,10 +108,10 @@ const DVec & NloptMinimizer::operator()(const DoubleFunction &f)
} }
if (getVerbosity() >= Verbosity::Normal) if (getVerbosity() >= Verbosity::Normal)
{ {
cout << "Found minimum " << res << " at:" << endl; printf("Found minimum %.10e at:\n", res);
for (Index i = 0; i < x.size(); ++i) for (Index i = 0; i < x.size(); ++i)
{ {
printf("%8s= %e\n", f.varName().getName(i).c_str(), vx[i]); printf("%8s= %.10e\n", f.varName().getName(i).c_str(), vx[i]);
} }
cout << "after " << data.evalCount << " evaluations" << endl; cout << "after " << data.evalCount << " evaluations" << endl;
cout << "Minimization ended with code " << status; cout << "Minimization ended with code " << status;