Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Remove unneeded extern "C".
[simgrid.git] / src / kernel / lmm / lagrange.cpp
index 37143ad..17fe3d0 100644 (file)
@@ -8,6 +8,7 @@
  * "ssh://username@scm.gforge.inria.fr/svn/memo/people/pvelho/lagrange/ppf.ps".
  */
 #include "src/kernel/lmm/maxmin.hpp"
+#include "src/surf/surf_interface.hpp"
 #include "xbt/log.h"
 #include "xbt/sysdep.h"
 
@@ -142,22 +143,20 @@ void Lagrange::lagrange_solve()
     print();
   }
 
-  if (not modified)
+  if (not modified_)
     return;
 
   /* Initialize lambda. */
-  auto& cnst_list = active_constraint_set;
-  for (Constraint& cnst : cnst_list) {
+  for (Constraint& cnst : active_constraint_set) {
     cnst.lambda     = 1.0;
     cnst.new_lambda = 2.0;
     XBT_DEBUG("#### cnst(%p)->lambda :  %e", &cnst, cnst.lambda);
   }
 
   /*
-   * Initialize the var_list variable with only the active variables. Initialize mu.
+   * Initialize the active variables. Initialize mu.
    */
-  auto& var_list = variable_set;
-  for (Variable& var : var_list) {
+  for (Variable& var : variable_set) {
     if (not var.sharing_weight)
       var.value = 0.0;
     else {
@@ -191,7 +190,7 @@ void Lagrange::lagrange_solve()
     XBT_DEBUG("-------------- Gradient Descent ----------");
 
     /* Improve the value of mu_i */
-    for (Variable& var : var_list) {
+    for (Variable& var : variable_set) {
       if (var.sharing_weight && var.bound >= 0) {
         XBT_DEBUG("Working on var (%p)", &var);
         var.new_mu = new_mu(var);
@@ -206,7 +205,7 @@ void Lagrange::lagrange_solve()
     }
 
     /* Improve the value of lambda_i */
-    for (Constraint& cnst : cnst_list) {
+    for (Constraint& cnst : active_constraint_set) {
       XBT_DEBUG("Working on cnst (%p)", &cnst);
       cnst.new_lambda = dichotomy(cnst.lambda, partial_diff_lambda, cnst, dichotomy_min_error);
       XBT_DEBUG("Updating lambda : cnst->lambda (%p) : %1.20f -> %1.20f", &cnst, cnst.lambda, cnst.new_lambda);
@@ -221,7 +220,7 @@ void Lagrange::lagrange_solve()
     /* Now computes the values of each variable (\rho) based on the values of \lambda and \mu. */
     XBT_DEBUG("-------------- Check convergence ----------");
     overall_modification = 0;
-    for (Variable& var : var_list) {
+    for (Variable& var : variable_set) {
       if (var.sharing_weight <= 0)
         var.value = 0.0;
       else {