From: alegrand Date: Thu, 4 Nov 2004 06:54:43 +0000 (+0000) Subject: Types and function prototypes for the max_min linear solver. X-Git-Tag: v3.3~4867 X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/commitdiff_plain/ab3a9d12abbb2c3b42fa46f5869f234e78bc1180 Types and function prototypes for the max_min linear solver. git-svn-id: svn+ssh://scm.gforge.inria.fr/svn/simgrid/simgrid/trunk@483 48e7efb5-ca39-0410-a469-dd3cf9ba447f --- diff --git a/src/include/surf/maxmin.h b/src/include/surf/maxmin.h new file mode 100644 index 0000000000..eed02f5a56 --- /dev/null +++ b/src/include/surf/maxmin.h @@ -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 index 0000000000..4232ed30ac --- /dev/null +++ b/src/surf/maxmin.c @@ -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 index 0000000000..03cf4ff5de --- /dev/null +++ b/src/surf/maxmin_private.h @@ -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 */ +};