Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Compilation broken.
[simgrid.git] / src / include / surf / maxmin.h
index fe7f3c5..b81cefc 100644 (file)
@@ -1,6 +1,5 @@
-/*     $Id$     */
-
-/* Copyright (c) 2004 Arnaud Legrand. All rights reserved.                  */
+/* Copyright (c) 2004, 2005, 2006, 2007, 2008, 2009, 2010. The SimGrid Team.
+ * All rights reserved.                                                     */
 
 /* This program is free software; you can redistribute it and/or modify it
  * under the terms of the license (GNU LGPL) which comes with this package. */
@@ -8,11 +7,12 @@
 #ifndef _SURF_MAXMIN_H
 #define _SURF_MAXMIN_H
 
+#include <math.h>
 #include "portable.h"
 #include "xbt/misc.h"
 #include "surf/datatypes.h"
 
-#define MAXMIN_PRECISION 0.00001
+#define MAXMIN_PRECISION 1e-9
 static XBT_INLINE void double_update(double *variable, double value)
 {
   *variable -= value;
@@ -25,6 +25,11 @@ static XBT_INLINE int double_positive(double value)
   return (value > MAXMIN_PRECISION);
 }
 
+static XBT_INLINE int double_equals(double value1, double value2)
+{
+  return (fabs(value1 - value2) < MAXMIN_PRECISION);
+}
+
 XBT_PUBLIC(lmm_system_t) lmm_system_new(void);
 XBT_PUBLIC(void) lmm_system_free(lmm_system_t sys);
      void lmm_variable_disable(lmm_system_t sys, lmm_variable_t var);
@@ -63,6 +68,8 @@ XBT_PUBLIC(void) lmm_expand(lmm_system_t sys, lmm_constraint_t cnst,
      lmm_constraint_t lmm_get_next_active_constraint(lmm_system_t sys,
                                                      lmm_constraint_t cnst);
 
+     XBT_PUBLIC(int) lmm_is_variable_limited_by_latency(lmm_variable_t var);
+
      void *lmm_constraint_id(lmm_constraint_t cnst);
      void *lmm_variable_id(lmm_variable_t var);
 
@@ -86,8 +93,6 @@ XBT_PUBLIC(void) lmm_update_constraint_bound(lmm_system_t sys,
 
 XBT_PUBLIC(void) lmm_solve(lmm_system_t sys);
 
-XBT_PUBLIC(void *) lmm_extract_modified_variable(lmm_system_t sys);
-
 XBT_PUBLIC(void) lagrange_solve(lmm_system_t sys);
 XBT_PUBLIC(void) bottleneck_solve(lmm_system_t sys);