l->modified = 0;
l->selective_update_active = selective_update;
+ l->visited_counter = 1;
XBT_DEBUG("Setting selective_update_active flag to %d\n",
l->selective_update_active);
var->weight = weight;
var->bound = bound;
var->value = 0.0;
-
+ var->visited = sys->visited_counter - 1;
var->mu = 0.0;
var->new_mu = 0.0;
var->func_f = func_f_def;
xbt_swag_insert_at_head(elem, &(elem->constraint->element_set));
else
xbt_swag_insert_at_tail(elem, &(elem->constraint->element_set));
+
+ if (i == 0)
+ lmm_update_modified_set(sys, elem->constraint);
}
if (!weight)
var->value = 0.0;
- if (var->cnsts_number)
- lmm_update_modified_set(sys, var->cnsts[0].constraint);
-
XBT_OUT();
}
lmm_variable_t var = elem->variable;
s_lmm_element_t *cnsts = var->cnsts;
int i;
- for (i = 0; i < var->cnsts_number; i++) {
+ for (i = 0; var->visited != sys->visited_counter
+ && i < var->cnsts_number ; i++) {
if (cnsts[i].constraint != cnst
&& !xbt_swag_belongs(cnsts[i].constraint,
&sys->modified_constraint_set)) {
lmm_update_modified_set_rec(sys, cnsts[i].constraint);
}
}
+ var->visited = sys->visited_counter;
}
}
*/
static void lmm_remove_all_modified_set(lmm_system_t sys)
{
+ if (++sys->visited_counter == 1) {
+ /* the counter wrapped around, reset each variable->visited */
+ lmm_variable_t var;
+ xbt_swag_foreach(var, &sys->variable_set)
+ var->visited = 0;
+ }
xbt_swag_reset(&sys->modified_constraint_set);
}