Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Bug fix and add a fonction indicating whether a constraint is active or not.
[simgrid.git] / src / include / surf / maxmin.h
1 /* Authors: Arnaud Legrand                                                  */
2
3 /* This program is free software; you can redistribute it and/or modify it
4    under the terms of the license (GNU LGPL) which comes with this package. */
5
6 #ifndef _SURF_MAXMIN_H
7 #define _SURF_MAXMIN_H
8
9 typedef long double xbt_maxmin_float_t;
10 #define XBT_MAXMIN_FLOAT_T "%Lg"        /* for printing purposes */
11
12 typedef struct lmm_variable *lmm_variable_t;
13 typedef struct lmm_constraint *lmm_constraint_t;
14 typedef struct lmm_system *lmm_system_t;
15
16 lmm_system_t lmm_system_new(void);
17 void lmm_system_free(lmm_system_t sys);
18
19 lmm_constraint_t lmm_constraint_new(lmm_system_t sys, void *id,
20                                     xbt_maxmin_float_t bound_value);
21 void lmm_constraint_free(lmm_system_t sys, lmm_constraint_t cnst);
22
23 lmm_variable_t lmm_variable_new(lmm_system_t sys, void *id,
24                                 xbt_maxmin_float_t weight_value,
25                                 xbt_maxmin_float_t bound,
26                                 int number_of_constraints);
27 void lmm_variable_free(lmm_system_t sys, lmm_variable_t var);
28 xbt_maxmin_float_t lmm_variable_getvalue(lmm_variable_t var);
29
30
31 void lmm_expand(lmm_system_t sys, lmm_constraint_t cnst,
32                 lmm_variable_t var, xbt_maxmin_float_t value);
33
34 void lmm_update(lmm_system_t sys, lmm_constraint_t cnst,
35                 lmm_variable_t var, xbt_maxmin_float_t value);
36 void lmm_update_variable_bound(lmm_variable_t var,
37                                xbt_maxmin_float_t bound);
38 void lmm_update_variable_weight(lmm_variable_t var,
39                                 xbt_maxmin_float_t weight);
40 void lmm_update_constraint_bound(lmm_constraint_t cnst,
41                                  xbt_maxmin_float_t bound);
42
43 int lmm_constraint_used(lmm_system_t sys, lmm_constraint_t cnst);
44
45 void lmm_solve(lmm_system_t sys);
46 #endif                          /* _SURF_MAXMIN_H */