Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
*** empty log message ***
[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                                     double 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                                 double weight_value,
26                                 double bound, int number_of_constraints);
27 void lmm_variable_free(lmm_system_t sys, lmm_variable_t var);
28 double 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, double value);
33
34 lmm_constraint_t lmm_get_cnst_from_var(lmm_system_t sys,
35                                        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,
38                                      lmm_constraint_t cnst,
39                                      lmm_variable_t * var);
40
41 void *lmm_constraint_id(lmm_constraint_t cnst);
42 void *lmm_variable_id(lmm_variable_t var);
43
44 void lmm_update(lmm_system_t sys, lmm_constraint_t cnst,
45                 lmm_variable_t var, double value);
46 void lmm_update_variable_bound(lmm_system_t sys, lmm_variable_t var,
47                                double bound);
48 void lmm_update_variable_weight(lmm_system_t sys, lmm_variable_t var,
49                                 double weight);
50 double lmm_get_variable_weight(lmm_variable_t var);
51
52 void lmm_update_constraint_bound(lmm_system_t sys, lmm_constraint_t cnst,
53                                  double bound);
54
55 int lmm_constraint_used(lmm_system_t sys, lmm_constraint_t cnst);
56
57 void lmm_solve(lmm_system_t sys);
58 #endif                          /* _SURF_MAXMIN_H */