Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Debuging surf Reno and Vegas with lagrange optimization approach
[simgrid.git] / src / include / surf / maxmin.h
index 93c3c1d..7ba136b 100644 (file)
 
 #include "xbt/misc.h"
 #include "portable.h" 
+
+#define MAXMIN_PRECISION 0.00001
 static XBT_INLINE void double_update(double *variable, double value) 
 {
   *variable -= value;
-  if(*variable< 0.00001) *variable = 0.0;
+  if(*variable< MAXMIN_PRECISION) *variable = 0.0;
+}
+
+static XBT_INLINE int double_positive(double value) 
+{
+  return (value>MAXMIN_PRECISION);
 }
 
 typedef struct lmm_variable *lmm_variable_t;
@@ -61,6 +68,13 @@ void lmm_update(lmm_system_t sys, lmm_constraint_t cnst,
                lmm_variable_t var, double value);
 void lmm_update_variable_bound(lmm_system_t sys, lmm_variable_t var,
                               double bound);
+
+
+void lmm_update_variable_latency(lmm_system_t sys, lmm_variable_t var,
+                                double delta);
+
+
+
 XBT_PUBLIC(void) lmm_update_variable_weight(lmm_system_t sys, lmm_variable_t var,
                                double weight);
 double lmm_get_variable_weight(lmm_variable_t var);
@@ -79,4 +93,35 @@ void sdp_solve(lmm_system_t sys);
 
 void lagrange_solve(lmm_system_t sys);
 
+void lagrange_dicotomi_solve(lmm_system_t sys);
+
+
+
+/**
+ * Default functions associated to the chosen protocol. When
+ * using the lagrangian approach.
+ */
+double (* func_f_def   ) (lmm_variable_t , double);
+double (* func_fp_def  ) (lmm_variable_t , double);
+double (* func_fpi_def ) (lmm_variable_t , double);
+double (* func_fpip_def) (lmm_variable_t , double);
+
+
+
+void lmm_set_default_protocol_functions(double (* func_f)    (lmm_variable_t var, double x),
+                                       double (* func_fp)   (lmm_variable_t var, double x),
+                                       double (* func_fpi)  (lmm_variable_t var, double x),
+                                       double (* func_fpip) (lmm_variable_t var, double x));
+
+double func_reno_f(lmm_variable_t var, double x);
+double func_reno_fp(lmm_variable_t var, double x);
+double func_reno_fpi(lmm_variable_t var, double x);
+double func_reno_fpip(lmm_variable_t var, double x);
+
+double func_vegas_f(lmm_variable_t var, double x);
+double func_vegas_fp(lmm_variable_t var, double x);
+double func_vegas_fpi(lmm_variable_t var, double x);
+double func_vegas_fpip(lmm_variable_t var, double x);
+
+
 #endif                         /* _SURF_MAXMIN_H */