From d0ef32fb9e669dec748222998d51592abfb5cd4f Mon Sep 17 00:00:00 2001 From: Antonin Portelli Date: Tue, 5 Apr 2016 11:50:45 +0100 Subject: [PATCH] NloptMinimizer: more precise output --- lib/NloptMinimizer.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/NloptMinimizer.cpp b/lib/NloptMinimizer.cpp index 83dad2a..01f15f0 100644 --- a/lib/NloptMinimizer.cpp +++ b/lib/NloptMinimizer.cpp @@ -94,7 +94,7 @@ const DVec & NloptMinimizer::operator()(const DoubleFunction &f) cout << "Algorithm: " << min.get_algorithm_name() << endl; cout << "Max eval.= " << min.get_maxeval(); cout << " -- Precision= " << min.get_xtol_rel() << endl; - cout << "starting f(x)= " << f(x) << endl; + printf("Starting f(x)= %.10e\n", f(x)); } try { @@ -108,10 +108,10 @@ const DVec & NloptMinimizer::operator()(const DoubleFunction &f) } 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) { - 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 << "Minimization ended with code " << status;