+//computes the value of the dichotomy using a initial values, init, with a specific variable or constraint
+double dichotomy(double init, double diff(double, void *), void *var_cnst,
+ double min_error);
+//computes the value of the differential of variable param_var applied to mu
+double partial_diff_mu(double mu, void *param_var);
+//computes the value of the differential of constraint param_cnst applied to lambda
+double partial_diff_lambda(double lambda, void *param_cnst);
+//auxiliar function to compute the partial_diff
+double diff_aux(lmm_variable_t var, double x);
+
+
+static int __check_feasible(xbt_swag_t cnst_list, xbt_swag_t var_list, int warn)
+{
+ xbt_swag_t elem_list = NULL;
+ lmm_element_t elem = NULL;
+ lmm_constraint_t cnst = NULL;
+ lmm_variable_t var = NULL;
+
+ double tmp;
+
+ xbt_swag_foreach(cnst, cnst_list) {
+ tmp = 0;
+ elem_list = &(cnst->element_set);
+ xbt_swag_foreach(elem, elem_list) {
+ var = elem->variable;
+ if (var->weight <= 0)
+ continue;
+ tmp += var->value;
+ }
+
+ if (double_positive(tmp - cnst->bound)) {
+ if (warn)
+ WARN3
+ ("The link (%p) is over-used. Expected less than %f and got %f",
+ cnst, cnst->bound, tmp);
+ return 0;
+ }
+ DEBUG3("Checking feasability for constraint (%p): sat = %f, lambda = %f ",
+ cnst, tmp - cnst->bound, cnst->lambda);
+ }
+
+ xbt_swag_foreach(var, var_list) {
+ if (var->bound < 0 || var->weight <= 0)
+ continue;
+ DEBUG3("Checking feasability for variable (%p): sat = %f mu = %f", var,
+ var->value - var->bound, var->mu);
+
+ if (double_positive(var->value - var->bound)) {
+ if (warn)
+ WARN3
+ ("The variable (%p) is too large. Expected less than %f and got %f",
+ var, var->bound, var->value);
+ return 0;
+ }
+ }
+ return 1;
+}