]> AND Private Git Repository - loba.git/blobdiff - cost_func.cpp
Logo AND Algorithmique Numérique Distribuée

Private GIT Repository
Add default auto_depl::topology...
[loba.git] / cost_func.cpp
index c3a463b508c36ec0d9d428e35bddc385e3f73b50..d102fd90772c1abd310ca54333acfbe1ee49fdab 100644 (file)
@@ -1,9 +1,10 @@
+#include "cost_func.h"
+
 #include <algorithm>
 #include <cstdlib>
 #include <cstring>
 #include <iterator>
 #include <sstream>
-#include "cost_func.h"
 
 cost_func::cost_func(const char* param)
 {
@@ -40,10 +41,10 @@ cost_func& cost_func::operator=(const cost_func& ref)
 
 double cost_func::operator()(double amount) const
 {
-    double ret = factor[degree];
+    double result = factor[degree];
     for (int i = degree - 1; i >= 0 ; i--)
-        ret = amount * ret + factor[i];
-    return ret;
+        result = amount * result + factor[i];
+    return result;
 }
 
 std::string cost_func::to_string()