Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Compile pas, c'te merde
[simgrid.git] / src / include / surf / maxmin.h
1 /*      $Id$     */
2
3 /* Copyright (c) 2004 Arnaud Legrand. All rights reserved.                  */
4
5 /* This program is free software; you can redistribute it and/or modify it
6  * under the terms of the license (GNU LGPL) which comes with this package. */
7
8 #ifndef _SURF_MAXMIN_H
9 #define _SURF_MAXMIN_H
10
11 #include "xbt/misc.h"
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 void lmm_variable_disable(lmm_system_t sys, lmm_variable_t var);
19
20 lmm_constraint_t lmm_constraint_new(lmm_system_t sys, void *id,
21                                     xbt_maxmin_float_t bound_value);
22 void lmm_constraint_free(lmm_system_t sys, lmm_constraint_t cnst);
23
24 lmm_variable_t lmm_variable_new(lmm_system_t sys, void *id,
25                                 xbt_maxmin_float_t weight_value,
26                                 xbt_maxmin_float_t bound,
27                                 int number_of_constraints);
28 void lmm_variable_free(lmm_system_t sys, lmm_variable_t var);
29 xbt_maxmin_float_t lmm_variable_getvalue(lmm_variable_t var);
30
31
32 void lmm_expand(lmm_system_t sys, lmm_constraint_t cnst,
33                 lmm_variable_t var, xbt_maxmin_float_t value);
34
35 lmm_constraint_t lmm_get_cnst_from_var(lmm_system_t sys, lmm_variable_t var, int num);
36 int lmm_get_number_of_cnst_from_var(lmm_system_t sys, lmm_variable_t var);
37 lmm_variable_t lmm_get_var_from_cnst(lmm_system_t sys, lmm_constraint_t cnst, 
38                                      lmm_variable_t *var);
39
40 void *lmm_constraint_id(lmm_constraint_t cnst);
41 void *lmm_variable_id(lmm_variable_t var);
42
43 void lmm_update(lmm_system_t sys, lmm_constraint_t cnst,
44                 lmm_variable_t var, xbt_maxmin_float_t value);
45 void lmm_update_variable_bound(lmm_system_t sys, lmm_variable_t var,
46                                xbt_maxmin_float_t bound);
47 void lmm_update_variable_weight(lmm_system_t sys, lmm_variable_t var,
48                                 xbt_maxmin_float_t weight);
49 void lmm_update_constraint_bound(lmm_system_t sys, lmm_constraint_t cnst,
50                                  xbt_maxmin_float_t bound);
51
52 int lmm_constraint_used(lmm_system_t sys, lmm_constraint_t cnst);
53
54 void lmm_solve(lmm_system_t sys);
55 #endif                          /* _SURF_MAXMIN_H */