Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
eb55de99db538b11a9943e74759838353faeda96
[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 lmm_constraint_t lmm_get_first_active_constraint(lmm_system_t sys);
42 lmm_constraint_t lmm_get_next_active_constraint(lmm_system_t sys, lmm_constraint_t cnst);
43
44 void *lmm_constraint_id(lmm_constraint_t cnst);
45 void *lmm_variable_id(lmm_variable_t var);
46
47 void lmm_update(lmm_system_t sys, lmm_constraint_t cnst,
48                 lmm_variable_t var, double value);
49 void lmm_update_variable_bound(lmm_system_t sys, lmm_variable_t var,
50                                double bound);
51 void lmm_update_variable_weight(lmm_system_t sys, lmm_variable_t var,
52                                 double weight);
53 double lmm_get_variable_weight(lmm_variable_t var);
54
55 void lmm_update_constraint_bound(lmm_system_t sys, lmm_constraint_t cnst,
56                                  double bound);
57
58 int lmm_constraint_used(lmm_system_t sys, lmm_constraint_t cnst);
59
60 void lmm_solve(lmm_system_t sys);
61 #endif                          /* _SURF_MAXMIN_H */