+class s_lmm_system_t {
+public:
+ /**
+ * @brief Create a new Linear MaxMim system
+ * @param selective_update whether we should do lazy updates
+ */
+ s_lmm_system_t(bool selective_update);
+ /** @brief Free an existing Linear MaxMin system */
+ ~s_lmm_system_t();
+
+ /**
+ * @brief Create a new Linear MaxMin constraint
+ * @param id Data associated to the constraint (e.g.: a network link)
+ * @param bound_value The bound value of the constraint
+ */
+ lmm_constraint_t constraint_new(void* id, double bound_value);
+
+ /**
+ * @brief Create a new Linear MaxMin variable
+ * @param id Data associated to the variable (e.g.: a network communication)
+ * @param weight_value The weight of the variable (0.0 if not used)
+ * @param bound The maximum value of the variable (-1.0 if no maximum value)
+ * @param number_of_constraints The maximum number of constraint to associate to the variable
+ */
+ lmm_variable_t variable_new(simgrid::surf::Action* id, double weight_value, double bound, int number_of_constraints);
+
+ /**
+ * @brief Free a variable
+ * @param var The variable to free
+ */
+ void variable_free(lmm_variable_t var);
+
+ /**
+ * @brief Associate a variable to a constraint with a coefficient
+ * @param cnst A constraint
+ * @param var A variable
+ * @param value The coefficient associated to the variable in the constraint
+ */
+ void expand(lmm_constraint_t cnst, lmm_variable_t var, double value);
+
+ /**
+ * @brief Add value to the coefficient between a constraint and a variable or create one
+ * @param cnst A constraint
+ * @param var A variable
+ * @param value The value to add to the coefficient associated to the variable in the constraint
+ */
+ void expand_add(lmm_constraint_t cnst, lmm_variable_t var, double value);
+
+ /**
+ * @brief Update the bound of a variable
+ * @param var A constraint
+ * @param bound The new bound
+ */
+ void update_variable_bound(lmm_variable_t var, double bound);
+
+ /**
+ * @brief Update the weight of a variable
+ * @param var A variable
+ * @param weight The new weight of the variable
+ */
+ void update_variable_weight(lmm_variable_t var, double weight);
+
+ /**
+ * @brief Update a constraint bound
+ * @param cnst A constraint
+ * @param bound The new bound of the consrtaint
+ */
+ void update_constraint_bound(lmm_constraint_t cnst, double bound);
+
+ /**
+ * @brief [brief description]
+ * @param cnst A constraint
+ * @return [description]
+ */
+ int constraint_used(lmm_constraint_t cnst) { return xbt_swag_belongs(cnst, &active_constraint_set); }
+
+ /** @brief Print the lmm system */
+ void print();
+
+ /** @brief Solve the lmm system */
+ void solve();
+
+private:
+ static void* variable_mallocator_new_f();
+ static void variable_mallocator_free_f(void* var);
+
+ void var_free(lmm_variable_t var);
+ void cnst_free(lmm_constraint_t cnst);
+ lmm_variable_t extract_variable() { return static_cast<lmm_variable_t>(xbt_swag_extract(&variable_set)); }
+ lmm_constraint_t extract_constraint() { return static_cast<lmm_constraint_t>(xbt_swag_extract(&constraint_set)); }
+ void insert_constraint(lmm_constraint_t cnst) { xbt_swag_insert(cnst, &constraint_set); }
+ void remove_variable(lmm_variable_t var)
+ {
+ xbt_swag_remove(var, &variable_set);
+ xbt_swag_remove(var, &saturated_variable_set);
+ }
+ void remove_constraint(lmm_constraint_t cnst) // FIXME: unused
+ {
+ xbt_swag_remove(cnst, &constraint_set);
+ xbt_swag_remove(cnst, &saturated_constraint_set);
+ }
+ void make_constraint_active(lmm_constraint_t cnst) { xbt_swag_insert(cnst, &active_constraint_set); }
+ void make_constraint_inactive(lmm_constraint_t cnst)
+ {
+ xbt_swag_remove(cnst, &active_constraint_set);
+ xbt_swag_remove(cnst, &modified_constraint_set);
+ }
+
+ void enable_var(lmm_variable_t var);
+ void disable_var(lmm_variable_t var);
+ void on_disabled_var(lmm_constraint_t cnstr);
+
+ /**
+ * @brief Update the value of element linking the constraint and the variable
+ * @param cnst A constraint
+ * @param var A variable
+ * @param value The new value
+ */
+ void update(lmm_constraint_t cnst, lmm_variable_t var, double value);
+
+ void update_modified_set(lmm_constraint_t cnst);
+ void update_modified_set_rec(lmm_constraint_t cnst);
+
+ /** @brief Remove all constraints of the modified_constraint_set. */
+ void remove_all_modified_set();
+ void check_concurrency();
+
+public: