- return (var->bound);
-}
-
-void lmm_shrink(lmm_system_t sys, lmm_constraint_t cnst, lmm_variable_t var)
-{
- lmm_element_t elem = nullptr;
- int found = 0;
-
- for (int i = 0; i < var->cnsts_number; i++) {
- elem = &(var->cnsts[i]);
- if (elem->constraint == cnst) {
- found = 1;
- break;
- }
- }
-
- if (not found) {
- XBT_DEBUG("cnst %p is not found in var %p", cnst, var);
- return;
- }
-
- sys->modified = 1;
-
- XBT_DEBUG("remove elem(value %f, cnst %p, var %p) in var %p", elem->consumption_weight, elem->constraint,
- elem->variable, var);
-
- /* We are going to change the constraint object and the variable object.
- * Propagate this change to other objects. Calling here before removing variable from not active elements
- * (inactive elements are not visited)
- */
- lmm_update_modified_set(sys, cnst);
- //Useful in case var was already removed from the constraint
- lmm_update_modified_set(sys, var->cnsts[0].constraint); // will look up enabled_element_set of this constraint, and
- //then each var in the enabled_element_set, and each var->cnsts[i].
-
- if(xbt_swag_remove(elem, &(elem->constraint->enabled_element_set)))
- lmm_decrease_concurrency(elem);
-
- xbt_swag_remove(elem, &(elem->constraint->active_element_set));
- elem->constraint = nullptr;
- elem->variable = nullptr;
- elem->consumption_weight = 0;
-
- var->cnsts_number -= 1;
-
- //No variable in this constraint -> make it inactive
- if (xbt_swag_size(&(cnst->enabled_element_set))+xbt_swag_size(&(cnst->disabled_element_set)) == 0)
- make_constraint_inactive(sys, cnst);
- else {
- //Check maxconcurrency to see if we can enable new variables
- lmm_on_disabled_var(sys,elem->constraint);
- }
-
- lmm_check_concurrency(sys);