+XBT_INLINE lmm_constraint_t lmm_get_next_active_constraint(lmm_system_t
+ sys,
+ lmm_constraint_t
+ cnst)
+{
+ return xbt_swag_getNext(cnst, (sys->active_constraint_set).offset);
+}
+
+#ifdef HAVE_LATENCY_BOUND_TRACKING
+XBT_INLINE int lmm_is_variable_limited_by_latency(lmm_variable_t var)
+{
+ return (double_equals(var->bound, var->value));
+}
+#endif
+
+
+/** \brief Update the constraint set propagating recursively to
+ * other constraints so the system should not be entirely computed.
+ *
+ * \param sys the lmm_system_t
+ * \param cnst the lmm_constraint_t affected by the change
+ *
+ * A recursive algorithm to optimize the system recalculation selecting only
+ * constraints that have changed. Each constraint change is propagated
+ * to the list of constraints for each variable.
+ */
+static void lmm_update_modified_set_rec(lmm_system_t sys,
+ lmm_constraint_t cnst)
+{
+ lmm_element_t elem;
+
+ xbt_swag_foreach(elem, &cnst->element_set) {
+ lmm_variable_t var = elem->variable;
+ s_lmm_element_t *cnsts = var->cnsts;
+ int 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)) {
+ xbt_swag_insert(cnsts[i].constraint, &sys->modified_constraint_set);
+ lmm_update_modified_set_rec(sys, cnsts[i].constraint);
+ }
+ }
+ var->visited = sys->visited_counter;
+ }
+}
+
+static void lmm_update_modified_set(lmm_system_t sys,
+ lmm_constraint_t cnst)