Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Ansi C declaration of the variables (at the beginning of the blocks)
[simgrid.git] / src / surf / maxmin.c
index 9b98902..3177a75 100644 (file)
@@ -374,6 +374,7 @@ void lmm_print(lmm_system_t sys)
   DEBUG1("%s", trace_buf);
   trace_buf[0] = '\000';
 
+  DEBUG0("Constraints");
   /* Printing Constraints */
   cnst_list = &(sys->active_constraint_set);
   xbt_swag_foreach(cnst, cnst_list) {
@@ -411,6 +412,7 @@ void lmm_print(lmm_system_t sys)
            sum, cnst->bound, sum - cnst->bound);
   }
 
+  DEBUG0("Variables");
   /* Printing Result */
   xbt_swag_foreach(var, var_list) {
     if (var->bound > 0) {
@@ -443,7 +445,14 @@ void lmm_solve(lmm_system_t sys)
   var_list = &(sys->variable_set);
   DEBUG1("Variable set : %d", xbt_swag_size(var_list));
   xbt_swag_foreach(var, var_list) {
+    int nb=0;
+    int i;
     var->value = 0.0;
+    for (i = 0; i < var->cnsts_number; i++) {
+      if(var->cnsts[i].value==0.0) nb++;
+    }
+    if((nb==var->cnsts_number) && (var->weight>0.0))
+      var->value = 1.0;
   }
 
   /*