Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Add lmm_get_var_from_cnst
authoralegrand <alegrand@48e7efb5-ca39-0410-a469-dd3cf9ba447f>
Tue, 7 Dec 2004 22:25:57 +0000 (22:25 +0000)
committeralegrand <alegrand@48e7efb5-ca39-0410-a469-dd3cf9ba447f>
Tue, 7 Dec 2004 22:25:57 +0000 (22:25 +0000)
git-svn-id: svn+ssh://scm.gforge.inria.fr/svn/simgrid/simgrid/trunk@559 48e7efb5-ca39-0410-a469-dd3cf9ba447f

src/include/surf/maxmin.h
src/surf/maxmin.c

index 4602baf..a5a6bb7 100644 (file)
@@ -32,6 +32,8 @@ void lmm_expand(lmm_system_t sys, lmm_constraint_t cnst,
 
 lmm_constraint_t lmm_get_cnst_from_var(lmm_system_t sys, lmm_variable_t var, int num);
 int lmm_get_number_of_cnst_from_var(lmm_system_t sys, lmm_variable_t var);
 
 lmm_constraint_t lmm_get_cnst_from_var(lmm_system_t sys, lmm_variable_t var, int num);
 int lmm_get_number_of_cnst_from_var(lmm_system_t sys, lmm_variable_t var);
+lmm_variable_t lmm_get_var_from_cnst(lmm_system_t sys, lmm_constraint_t cnst, 
+                                    lmm_variable_t *var);
 
 void *lmm_constraint_id(lmm_constraint_t cnst);
 void *lmm_variable_id(lmm_variable_t var);
 
 void *lmm_constraint_id(lmm_constraint_t cnst);
 void *lmm_variable_id(lmm_variable_t var);
index 3e94153..5300929 100644 (file)
@@ -180,6 +180,14 @@ int lmm_get_number_of_cnst_from_var(lmm_system_t sys, lmm_variable_t var)
   return(var->cnsts_number);
 }
 
   return(var->cnsts_number);
 }
 
+lmm_variable_t lmm_get_var_from_cnst(lmm_system_t sys, lmm_constraint_t cnst, 
+                                    lmm_variable_t *var)
+{
+  if(!(*var)) xbt_swag_getFirst(&(cnst->element_set));
+  else *var=xbt_swag_getNext(*var,cnst->element_set.offset);
+  return *var;
+}
+
 void *lmm_constraint_id(lmm_constraint_t cnst)
 {
   return cnst->id;
 void *lmm_constraint_id(lmm_constraint_t cnst)
 {
   return cnst->id;