Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Distinguish between time precision and sharing precision.
[simgrid.git] / testsuite / surf / lmm_usage.c
index 61b3ad7..060ed25 100644 (file)
@@ -1,6 +1,6 @@
 /* A few tests for the maxmin library                                       */
 
-/* Copyright (c) 2007, 2008, 2009, 2010. The SimGrid Team.
+/* Copyright (c) 2007-2014. The SimGrid Team.
  * All rights reserved.                                                     */
 
 /* This program is free software; you can redistribute it and/or modify it
@@ -31,7 +31,7 @@ XBT_LOG_NEW_DEFAULT_CATEGORY(surf_test,
 typedef enum {
   MAXMIN,
   LAGRANGE_RENO,
-  LAGRANGE_VEGAS,
+  LAGRANGE_VEGAS
 } method_t;
 
 static double dichotomy(double func(double), double min, double max,
@@ -173,7 +173,7 @@ void test1(method_t method)
     max_deviation =
         MAX(max_deviation, fabs(lmm_variable_getvalue(R_1_2_3) - (a - x)));
 
-    if (max_deviation > MAXMIN_PRECISION) {
+    if (max_deviation > 0.00001) { // Legacy value used in lagrange.c
       XBT_WARN("Max Deviation from optimal solution : %g", max_deviation);
       XBT_WARN("Found x = %1.20f", x);
       XBT_WARN("Deviation from optimal solution (R_1 = %g): %1.20f", x,
@@ -208,7 +208,7 @@ void test1(method_t method)
     max_deviation =
         MAX(max_deviation, fabs(lmm_variable_getvalue(R_1_2_3) - (a - x)));
 
-    if (max_deviation > MAXMIN_PRECISION) {
+    if (max_deviation > 0.00001) { // Legacy value used in lagrange.c
       XBT_WARN("Max Deviation from optimal solution : %g", max_deviation);
       XBT_WARN("Found x = %1.20f", x);
       XBT_WARN("Deviation from optimal solution (R_1 = %g): %1.20f", x,