Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Bug fix and add a fonction indicating whether a constraint is active or not.
[simgrid.git] / src / include / surf / maxmin.h
index f287a96..e0b0723 100644 (file)
@@ -3,7 +3,11 @@
 /* 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. */
 
-typedef long double FLOAT;
+#ifndef _SURF_MAXMIN_H
+#define _SURF_MAXMIN_H
+
+typedef long double xbt_maxmin_float_t;
+#define XBT_MAXMIN_FLOAT_T "%Lg"       /* for printing purposes */
 
 typedef struct lmm_variable *lmm_variable_t;
 typedef struct lmm_constraint *lmm_constraint_t;
@@ -12,24 +16,31 @@ typedef struct lmm_system *lmm_system_t;
 lmm_system_t lmm_system_new(void);
 void lmm_system_free(lmm_system_t sys);
 
-lmm_constraint_t lmm_constraint_new(lmm_system_t sys, void *id, 
-                                   FLOAT bound_value);
+lmm_constraint_t lmm_constraint_new(lmm_system_t sys, void *id,
+                                   xbt_maxmin_float_t bound_value);
 void lmm_constraint_free(lmm_system_t sys, lmm_constraint_t cnst);
 
-lmm_variable_t lmm_variable_new(lmm_system_t sys, void *id, 
-                               FLOAT weight_value, FLOAT bound,
+lmm_variable_t lmm_variable_new(lmm_system_t sys, void *id,
+                               xbt_maxmin_float_t weight_value,
+                               xbt_maxmin_float_t bound,
                                int number_of_constraints);
 void lmm_variable_free(lmm_system_t sys, lmm_variable_t var);
-FLOAT lmm_variable_getvalue(lmm_variable_t var);
+xbt_maxmin_float_t lmm_variable_getvalue(lmm_variable_t var);
 
 
 void lmm_expand(lmm_system_t sys, lmm_constraint_t cnst,
-               lmm_variable_t var, FLOAT value);
+               lmm_variable_t var, xbt_maxmin_float_t value);
 
 void lmm_update(lmm_system_t sys, lmm_constraint_t cnst,
-               lmm_variable_t var, FLOAT value);
-void lmm_update_variable_bound(lmm_variable_t var, FLOAT bound);
-void lmm_update_variable_weight(lmm_variable_t var, FLOAT weight);
-void lmm_update_constraint_bound(lmm_constraint_t cnst, FLOAT bound);
+               lmm_variable_t var, xbt_maxmin_float_t value);
+void lmm_update_variable_bound(lmm_variable_t var,
+                              xbt_maxmin_float_t bound);
+void lmm_update_variable_weight(lmm_variable_t var,
+                               xbt_maxmin_float_t weight);
+void lmm_update_constraint_bound(lmm_constraint_t cnst,
+                                xbt_maxmin_float_t bound);
+
+int lmm_constraint_used(lmm_system_t sys, lmm_constraint_t cnst);
 
 void lmm_solve(lmm_system_t sys);
+#endif                         /* _SURF_MAXMIN_H */