Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Types and function prototypes for the max_min linear solver.
authoralegrand <alegrand@48e7efb5-ca39-0410-a469-dd3cf9ba447f>
Thu, 4 Nov 2004 06:54:43 +0000 (06:54 +0000)
committeralegrand <alegrand@48e7efb5-ca39-0410-a469-dd3cf9ba447f>
Thu, 4 Nov 2004 06:54:43 +0000 (06:54 +0000)
git-svn-id: svn+ssh://scm.gforge.inria.fr/svn/simgrid/simgrid/trunk@483 48e7efb5-ca39-0410-a469-dd3cf9ba447f

src/include/surf/maxmin.h [new file with mode: 0644]
src/surf/maxmin.c [new file with mode: 0644]
src/surf/maxmin_private.h [new file with mode: 0644]

diff --git a/src/include/surf/maxmin.h b/src/include/surf/maxmin.h
new file mode 100644 (file)
index 0000000..eed02f5
--- /dev/null
@@ -0,0 +1,23 @@
+/* Authors: Arnaud Legrand                                                  */
+
+/* This program is free software; you can redistribute it and/or modify it
+   under the terms of the license (GNU LGPL) which comes with this package. */
+
+typedef long double FLOAT ;
+
+typedef struct lmm_var_element *lmm_var_element_t;
+typedef struct lmm_cnst_element *lmm_cnst_element_t;
+typedef struct lmm_system *lmm_system_t;
+
+lmm_system_t lmm_system_new(void);
+void lmm_system_free(lmm_system_t system);
+
+lmm_cnst_element_t lmm_add_constraint(lmm_system_t system, void *id, FLOAT bound_value);
+lmm_var_element_t lmm_add_variable(lmm_system_t system, void *id, FLOAT weight_value, int number_of_constraints);
+void lmm_extend_cnsts(lmm_system_t system, lmm_cnst_element_t cnsts,
+                     lmm_var_element_t var, FLOAT value);
+
+void lmm_del_constraint(lmm_system_t system, lmm_cnst_element_t cnsts);
+void lmm_del_var(lmm_system_t system, lmm_var_element_t var);
+
+void lmm_solve(lmm_system_t system, void ***p_id_table, int *p_id_table_size);
diff --git a/src/surf/maxmin.c b/src/surf/maxmin.c
new file mode 100644 (file)
index 0000000..4232ed3
--- /dev/null
@@ -0,0 +1,7 @@
+/* Authors: Arnaud Legrand                                                  */
+
+/* This program is free software; you can redistribute it and/or modify it
+   under the terms of the license (GNU LGPL) which comes with this package. */
+
+#include "maxmin_private.h"
+
diff --git a/src/surf/maxmin_private.h b/src/surf/maxmin_private.h
new file mode 100644 (file)
index 0000000..03cf4ff
--- /dev/null
@@ -0,0 +1,32 @@
+/* Authors: Arnaud Legrand                                                  */
+
+/* This program is free software; you can redistribute it and/or modify it
+   under the terms of the license (GNU LGPL) which comes with this package. */
+
+#include "surf/maxmin.h"
+#include "../src/xbt/fifo_private.h" /* Yeah! I know. It is very dirty. */
+
+typedef struct lmm_mat_element {
+  s_xbt_fifo_item_t row;
+  FLOAT value;
+} s_mat_element_t;
+
+typedef struct lmm_cnst_element {
+  s_xbt_fifo_t row; /* in fact a list of lmm_mat_element_t */
+  void *id;
+  FLOAT bound;
+  FLOAT usage;
+} s_lmm_cnst_element_t;
+
+typedef struct lmm_var_element {
+  void *id;
+  s_mat_element_t *cnsts;
+  int cnsts_size;
+  FLOAT value;
+  FLOAT bound;
+} s_lmm_var_element_t;
+
+typedef struct lmm_system {
+  s_xbt_fifo_item_t var_set; /* in fact a list of lmm_var_element_t */
+  s_xbt_fifo_item_t cnst_set; /* in fact a list of lmm_cnst_element_t */
+};