Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
a5a6bb7a1bf8653527deff0a0b963b310f5c1b32
[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 #include "xbt/misc.h"
10 typedef struct lmm_variable *lmm_variable_t;
11 typedef struct lmm_constraint *lmm_constraint_t;
12 typedef struct lmm_system *lmm_system_t;
13
14 lmm_system_t lmm_system_new(void);
15 void lmm_system_free(lmm_system_t sys);
16 void lmm_variable_disable(lmm_system_t sys, lmm_variable_t var);
17
18 lmm_constraint_t lmm_constraint_new(lmm_system_t sys, void *id,
19                                     xbt_maxmin_float_t bound_value);
20 void lmm_constraint_free(lmm_system_t sys, lmm_constraint_t cnst);
21
22 lmm_variable_t lmm_variable_new(lmm_system_t sys, void *id,
23                                 xbt_maxmin_float_t weight_value,
24                                 xbt_maxmin_float_t bound,
25                                 int number_of_constraints);
26 void lmm_variable_free(lmm_system_t sys, lmm_variable_t var);
27 xbt_maxmin_float_t lmm_variable_getvalue(lmm_variable_t var);
28
29
30 void lmm_expand(lmm_system_t sys, lmm_constraint_t cnst,
31                 lmm_variable_t var, xbt_maxmin_float_t value);
32
33 lmm_constraint_t lmm_get_cnst_from_var(lmm_system_t sys, lmm_variable_t var, int num);
34 int lmm_get_number_of_cnst_from_var(lmm_system_t sys, lmm_variable_t var);
35 lmm_variable_t lmm_get_var_from_cnst(lmm_system_t sys, lmm_constraint_t cnst, 
36                                      lmm_variable_t *var);
37
38 void *lmm_constraint_id(lmm_constraint_t cnst);
39 void *lmm_variable_id(lmm_variable_t var);
40
41 void lmm_update(lmm_system_t sys, lmm_constraint_t cnst,
42                 lmm_variable_t var, xbt_maxmin_float_t value);
43 void lmm_update_variable_bound(lmm_system_t sys, lmm_variable_t var,
44                                xbt_maxmin_float_t bound);
45 void lmm_update_variable_weight(lmm_system_t sys, lmm_variable_t var,
46                                 xbt_maxmin_float_t weight);
47 void lmm_update_constraint_bound(lmm_system_t sys, lmm_constraint_t cnst,
48                                  xbt_maxmin_float_t bound);
49
50 int lmm_constraint_used(lmm_system_t sys, lmm_constraint_t cnst);
51
52 void lmm_solve(lmm_system_t sys);
53 #endif                          /* _SURF_MAXMIN_H */