X-Git-Url: https://bilbo.iut-bm.univ-fcomte.fr/and/gitweb/loba.git/blobdiff_plain/6f5ec5fdc42f96a8fe95f4b846b163d4dc92e0c8..f3cbd5740fd2c6e770459ed6e10826b7a317c2d2:/cost_func.cpp diff --git a/cost_func.cpp b/cost_func.cpp index c3a463b..d102fd9 100644 --- a/cost_func.cpp +++ b/cost_func.cpp @@ -1,9 +1,10 @@ +#include "cost_func.h" + #include #include #include #include #include -#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()