X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/blobdiff_plain/2be0e4648c5b7055580df1c265b7c43ee6763a46..eee21ec5f99218189fc98898a09150294cd0fbf4:/src/include/surf/maxmin.h diff --git a/src/include/surf/maxmin.h b/src/include/surf/maxmin.h index 5ebf9da119..adc544c9f0 100644 --- a/src/include/surf/maxmin.h +++ b/src/include/surf/maxmin.h @@ -1,4 +1,4 @@ -/* Copyright (c) 2004, 2005, 2006, 2007, 2008, 2009, 2010. The SimGrid Team. +/* Copyright (c) 2004-2013. The SimGrid Team. * All rights reserved. */ /* This program is free software; you can redistribute it and/or modify it @@ -7,10 +7,10 @@ #ifndef _SURF_MAXMIN_H #define _SURF_MAXMIN_H -#include #include "portable.h" #include "xbt/misc.h" #include "surf/datatypes.h" +#include extern double sg_maxmin_precision; #define MAXMIN_PRECISION sg_maxmin_precision @@ -31,6 +31,10 @@ static XBT_INLINE int double_equals(double value1, double value2) return (fabs(value1 - value2) < MAXMIN_PRECISION); } +#ifdef __cplusplus +extern "C" { +#endif + XBT_PUBLIC(lmm_system_t) lmm_system_new(int selective_update); XBT_PUBLIC(void) lmm_system_free(lmm_system_t sys); void lmm_variable_disable(lmm_system_t sys, lmm_variable_t var); @@ -42,14 +46,18 @@ int lmm_constraint_is_shared(lmm_constraint_t cnst); void lmm_constraint_free(lmm_system_t sys, lmm_constraint_t cnst); +double lmm_constraint_get_usage(lmm_constraint_t cnst); + XBT_PUBLIC(lmm_variable_t) lmm_variable_new(lmm_system_t sys, void *id, double weight_value, double bound, int number_of_constraints); -void lmm_variable_free(lmm_system_t sys, lmm_variable_t var); +XBT_PUBLIC(void) lmm_variable_free(lmm_system_t sys, lmm_variable_t var); XBT_PUBLIC(double) lmm_variable_getvalue(lmm_variable_t var); XBT_PUBLIC(double) lmm_variable_getbound(lmm_variable_t var); +XBT_PUBLIC(void) lmm_shrink(lmm_system_t sys, lmm_constraint_t cnst, + lmm_variable_t var); XBT_PUBLIC(void) lmm_expand(lmm_system_t sys, lmm_constraint_t cnst, lmm_variable_t var, double value); void lmm_expand_add(lmm_system_t sys, lmm_constraint_t cnst, @@ -59,6 +67,8 @@ void lmm_elem_set_value(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); +double lmm_get_cnst_weight_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, @@ -124,5 +134,8 @@ XBT_PUBLIC(double func_vegas_f) (lmm_variable_t var, double x); XBT_PUBLIC(double func_vegas_fp) (lmm_variable_t var, double x); XBT_PUBLIC(double func_vegas_fpi) (lmm_variable_t var, double x); +#ifdef __cplusplus +} +#endif #endif /* _SURF_MAXMIN_H */