From 759e00e7ad42a922ae00763324da351e5f196815 Mon Sep 17 00:00:00 2001 From: Martin Quinson Date: Wed, 24 May 2017 11:01:01 +0200 Subject: [PATCH] tell maxmin about the action using each variable --- src/include/surf/maxmin.h | 11 +++++++++-- src/surf/maxmin.cpp | 3 ++- src/surf/maxmin_private.hpp | 2 +- 3 files changed, 12 insertions(+), 4 deletions(-) diff --git a/src/include/surf/maxmin.h b/src/include/surf/maxmin.h index 6ba38d1ca2..9a1ffb310b 100644 --- a/src/include/surf/maxmin.h +++ b/src/include/surf/maxmin.h @@ -12,6 +12,12 @@ #include "surf/datatypes.h" #include +namespace simgrid { +namespace surf { +class Action; +} +} + /** @addtogroup SURF_lmm * @details * A linear maxmin solver to resolve inequations systems. @@ -233,8 +239,9 @@ XBT_PUBLIC(int) lmm_constraint_concurrency_maximum_get(lmm_constraint_t cnst); * @param bound The maximum value of the variable (-1.0 if no maximum value) * @param number_of_constraints The maximum number of constraint to associate to the variable */ -XBT_PUBLIC(lmm_variable_t) lmm_variable_new(lmm_system_t sys, void *id, double weight_value, double bound, - int number_of_constraints); +XBT_PUBLIC(lmm_variable_t) +lmm_variable_new(lmm_system_t sys, simgrid::surf::Action* id, double weight_value, double bound, + int number_of_constraints); /** * @brief Free a variable * @param sys The system associated to the variable diff --git a/src/surf/maxmin.cpp b/src/surf/maxmin.cpp index 81a1bdc763..5d5cff5ae6 100644 --- a/src/surf/maxmin.cpp +++ b/src/surf/maxmin.cpp @@ -269,7 +269,8 @@ static void lmm_variable_mallocator_free_f(void *var) xbt_free(var); } -lmm_variable_t lmm_variable_new(lmm_system_t sys, void *id, double weight, double bound, int number_of_constraints) +lmm_variable_t lmm_variable_new(lmm_system_t sys, simgrid::surf::Action* id, double weight, double bound, + int number_of_constraints) { lmm_variable_t var = nullptr; int i; diff --git a/src/surf/maxmin_private.hpp b/src/surf/maxmin_private.hpp index 8c8bfbb8f9..9b4ecae5b4 100644 --- a/src/surf/maxmin_private.hpp +++ b/src/surf/maxmin_private.hpp @@ -87,7 +87,7 @@ typedef struct lmm_variable { double bound; double value; short int concurrency_share; /* The maximum number of elements that variable will add to a constraint */ - void *id; + simgrid::surf::Action* id; int id_int; unsigned visited; /* used by lmm_update_modified_set */ /* \begin{For Lagrange only} */ -- 2.20.1