Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Slight move from maxmin.hpp to surf_interface.hpp.
authorArnaud Giersch <arnaud.giersch@univ-fcomte.fr>
Thu, 23 Nov 2017 20:57:23 +0000 (21:57 +0100)
committerArnaud Giersch <arnaud.giersch@univ-fcomte.fr>
Sun, 26 Nov 2017 20:33:12 +0000 (21:33 +0100)
src/include/surf/maxmin.hpp
src/surf/surf_interface.hpp

index 8e03a7d..525d38d 100644 (file)
  * constraint.
  */
 
  * constraint.
  */
 
-XBT_PUBLIC_DATA(double) sg_maxmin_precision;
-XBT_PUBLIC_DATA(double) sg_surf_precision;
-XBT_PUBLIC_DATA(int) sg_concurrency_limit;
-
-static inline void double_update(double* variable, double value, double precision)
-{
-  // printf("Updating %g -= %g +- %g\n",*variable,value,precision);
-  // xbt_assert(value==0  || value>precision);
-  // Check that precision is higher than the machine-dependent size of the mantissa. If not, brutal rounding  may
-  // happen, and the precision mechanism is not active...
-  // xbt_assert(*variable< (2<<DBL_MANT_DIG)*precision && FLT_RADIX==2);
-  *variable -= value;
-  if (*variable < precision)
-    *variable = 0.0;
-}
-
-static inline int double_positive(double value, double precision)
-{
-  return (value > precision);
-}
-
-static inline int double_equals(double value1, double value2, double precision)
-{
-  return (fabs(value1 - value2) < precision);
-}
-
 /** @{ @ingroup SURF_lmm */
 
 /**
 /** @{ @ingroup SURF_lmm */
 
 /**
index 38bdbe0..3809ade 100644 (file)
@@ -16,6 +16,7 @@
 #include <boost/heap/pairing_heap.hpp>
 #include <boost/intrusive/list.hpp>
 #include <boost/optional.hpp>
 #include <boost/heap/pairing_heap.hpp>
 #include <boost/intrusive/list.hpp>
 #include <boost/optional.hpp>
+#include <cmath>
 #include <set>
 #include <string>
 #include <unordered_map>
 #include <set>
 #include <string>
 #include <unordered_map>
  *********/
 
 /* user-visible parameters */
  *********/
 
 /* user-visible parameters */
+XBT_PUBLIC_DATA(double) sg_maxmin_precision;
+XBT_PUBLIC_DATA(double) sg_surf_precision;
+XBT_PUBLIC_DATA(int) sg_concurrency_limit;
+
 extern XBT_PRIVATE double sg_tcp_gamma;
 extern XBT_PRIVATE double sg_latency_factor;
 extern XBT_PRIVATE double sg_bandwidth_factor;
 extern XBT_PRIVATE double sg_tcp_gamma;
 extern XBT_PRIVATE double sg_latency_factor;
 extern XBT_PRIVATE double sg_bandwidth_factor;
@@ -36,6 +41,28 @@ extern XBT_PRIVATE std::vector<std::string> surf_path;
 extern XBT_PRIVATE std::unordered_map<std::string, tmgr_trace_t> traces_set_list;
 extern XBT_PRIVATE std::set<std::string> watched_hosts;
 
 extern XBT_PRIVATE std::unordered_map<std::string, tmgr_trace_t> traces_set_list;
 extern XBT_PRIVATE std::set<std::string> watched_hosts;
 
+static inline void double_update(double* variable, double value, double precision)
+{
+  // printf("Updating %g -= %g +- %g\n",*variable,value,precision);
+  // xbt_assert(value==0  || value>precision);
+  // Check that precision is higher than the machine-dependent size of the mantissa. If not, brutal rounding  may
+  // happen, and the precision mechanism is not active...
+  // xbt_assert(*variable< (2<<DBL_MANT_DIG)*precision && FLT_RADIX==2);
+  *variable -= value;
+  if (*variable < precision)
+    *variable = 0.0;
+}
+
+static inline int double_positive(double value, double precision)
+{
+  return (value > precision);
+}
+
+static inline int double_equals(double value1, double value2, double precision)
+{
+  return (fabs(value1 - value2) < precision);
+}
+
 extern "C" {
 XBT_PUBLIC(double) surf_get_clock();
 }
 extern "C" {
 XBT_PUBLIC(double) surf_get_clock();
 }