chiark / gitweb /
only print averages when multiple iterations
authorstevenj <stevenj@alum.mit.edu>
Mon, 1 Sep 2008 20:04:58 +0000 (16:04 -0400)
committerstevenj <stevenj@alum.mit.edu>
Mon, 1 Sep 2008 20:04:58 +0000 (16:04 -0400)
darcs-hash:20080901200458-c8de0-6caef5668ed83a0897ef492107ee36322d18d1ca.gz

test/testopt.cpp

index 561c084154f3bc3c252401887b869894aabddd49..98ce278860807fda0dedd2ff6813b72f422b2b0e 100644 (file)
@@ -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;