Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Those are constraints, and not elements.
[simgrid.git] / src / surf / maxmin.c
index 2efcd6f..b5a261e 100644 (file)
@@ -1,4 +1,4 @@
-/* Copyright (c) 2004, 2005, 2006, 2007, 2008, 2009, 2010. The SimGrid Team.
+/* Copyright (c) 2004-2011. The SimGrid Team.
  * All rights reserved.                                                     */
 
 /* This program is free software; you can redistribute it and/or modify it
@@ -19,7 +19,7 @@ double sg_maxmin_precision = 0.00001;
 
 static void *lmm_variable_mallocator_new_f(void);
 static void lmm_variable_mallocator_free_f(void *var);
-static void lmm_variable_mallocator_reset_f(void *var);
+#define lmm_variable_mallocator_reset_f ((void_f_pvoid_t)NULL)
 static void lmm_update_modified_set(lmm_system_t sys,
                                     lmm_constraint_t cnst);
 static void lmm_remove_all_modified_set(lmm_system_t sys);
@@ -173,11 +173,6 @@ static void lmm_variable_mallocator_free_f(void *var)
   xbt_free(var);
 }
 
-static void lmm_variable_mallocator_reset_f(void *var)
-{
-  /* lmm_variable_new() initializes everything */
-}
-
 lmm_variable_t lmm_variable_new(lmm_system_t sys, void *id,
                                 double weight,
                                 double bound, int number_of_constraints)
@@ -423,8 +418,7 @@ void lmm_print(lmm_system_t sys)
   trace_buf =
       xbt_realloc(trace_buf, strlen(trace_buf) + strlen(print_buf) + 1);
   strcat(trace_buf, print_buf);
-  fprintf(stderr, "%s", trace_buf);
-  //XBT_DEBUG("%20s", trace_buf); FIXME
+  XBT_DEBUG("%20s", trace_buf);
   trace_buf[0] = '\000';
 
   XBT_DEBUG("Constraints");
@@ -466,8 +460,7 @@ void lmm_print(lmm_system_t sys)
                       strlen(trace_buf) + strlen(print_buf) + 1);
       strcat(trace_buf, print_buf);
     }
-    //   XBT_DEBUG("%s", trace_buf);
-    fprintf(stderr, "%s\n", trace_buf);
+    XBT_DEBUG("%s", trace_buf);
     trace_buf[0] = '\000';
     xbt_assert(!double_positive(sum - cnst->bound),
                 "Incorrect value (%f is not smaller than %f): %g",
@@ -818,12 +811,11 @@ static void lmm_update_modified_set(lmm_system_t sys,
  */
 static void lmm_remove_all_modified_set(lmm_system_t sys)
 {
-  lmm_element_t elem = NULL;
-  lmm_element_t elem_next = NULL;
-  xbt_swag_t elem_list = NULL;
+  xbt_swag_t modified_constraint_set = &sys->modified_constraint_set;
+  lmm_constraint_t cnst;
+  lmm_constraint_t cnst_next;
 
-  elem_list = &(sys->modified_constraint_set);
-  xbt_swag_foreach_safe(elem, elem_next, elem_list) {
-    xbt_swag_remove(elem, elem_list);
+  xbt_swag_foreach_safe(cnst, cnst_next, modified_constraint_set) {
+    xbt_swag_remove(cnst, modified_constraint_set);
   }
 }