]> AND Public Git Repository - simgrid.git/blobdiff - src/kernel/lmm/maxmin.hpp
Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
[sonar] Extract assignments from expressions.
[simgrid.git] / src / kernel / lmm / maxmin.hpp
index 4dc68c10b945b0292a0e54b4e244d7aadaa94c5b..123169d29139151df7c9342c34c6a4b9a5b94e24 100644 (file)
@@ -1,4 +1,4 @@
-/* Copyright (c) 2004-2018. The SimGrid Team. All rights reserved.          */
+/* Copyright (c) 2004-2019. The SimGrid Team. All rights reserved.          */
 
 /* This program is free software; you can redistribute it and/or modify it
  * under the terms of the license (GNU LGPL) which comes with this package. */
@@ -357,7 +357,7 @@ public:
    * @brief Get the number of constraint associated to a variable
    * @return The number of constraint associated to the variable
    */
-  int get_number_of_constraint() const { return cnsts.size(); }
+  size_t get_number_of_constraint() const { return cnsts.size(); }
 
   /**
    * @brief Get the data associated to a variable
@@ -445,7 +445,7 @@ public:
    * @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
    */
-  Variable* variable_new(resource::Action* id, double weight_value, double bound, int number_of_constraints);
+  Variable* variable_new(resource::Action* id, double weight_value, double bound, size_t number_of_constraints);
 
   /**
    * @brief Free a variable
@@ -599,7 +599,6 @@ private:
       modified_constraint_set;
   xbt_mallocator_t variable_mallocator_ =
       xbt_mallocator_new(65536, System::variable_mallocator_new_f, System::variable_mallocator_free_f, nullptr);
-  ;
 };
 
 class XBT_PUBLIC FairBottleneck : public System {
@@ -634,8 +633,7 @@ private:
    * Local prototypes to implement the Lagrangian optimization with optimal step, also called dichotomy.
    */
   // computes the value of the dichotomy using a initial values, init, with a specific variable or constraint
-  static double dichotomy(double init, double diff(double, const Constraint&), const Constraint& cnst,
-                          double min_error);
+  static double dichotomy(double init, const Constraint& cnst, double min_error);
   // computes the value of the differential of constraint cnst applied to lambda
   static double partial_diff_lambda(double lambda, const Constraint& cnst);