From: stevenj Date: Mon, 1 Sep 2008 20:04:58 +0000 (-0400) Subject: only print averages when multiple iterations X-Git-Url: http://www.chiark.greenend.org.uk/ucgi/~ianmdlvl/git?a=commitdiff_plain;h=89cfb10e689c007d376b3e2724d3b83d7bc64bae;p=nlopt.git only print averages when multiple iterations darcs-hash:20080901200458-c8de0-6caef5668ed83a0897ef492107ee36322d18d1ca.gz --- diff --git a/test/testopt.cpp b/test/testopt.cpp index 561c084..98ce278 100644 --- a/test/testopt.cpp +++ b/test/testopt.cpp @@ -195,7 +195,8 @@ static int test_function(int ifunc) return 0; } } - printf("average #evaluations = %g\naverage |f-minf| = %g, max |f-minf| = %g\n", total_count * 1.0 / iterations, total_err / iterations, max_err); + if (iterations > 1) + printf("average #evaluations = %g\naverage |f-minf| = %g, max |f-minf| = %g\n", total_count * 1.0 / iterations, total_err / iterations, max_err); free(x); return 1;