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;
lmm_variable_t var = elem->variable;
s_lmm_element_t *cnsts = var->cnsts;
int i;
+ if (var->visited == sys->visited_counter)
+ continue;
+ var->visited = sys->visited_counter;
for (i = 0; i < var->cnsts_number; i++) {
if (cnsts[i].constraint != cnst
&& !xbt_swag_belongs(cnsts[i].constraint,
*/
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);
}
double value;
void *id;
int id_int;
+ unsigned visited; /* used by lmm_update_modified_set */
/* \begin{For Lagrange only} */
double mu;
double new_mu;
typedef struct lmm_system {
int modified;
int selective_update_active; /* flag to update partially the system only selecting changed portions */
-
+ unsigned visited_counter; /* used by lmm_update_modified_set */
s_xbt_swag_t variable_set; /* a list of lmm_variable_t */
s_xbt_swag_t constraint_set; /* a list of lmm_constraint_t */