X-Git-Url: https://bilbo.iut-bm.univ-fcomte.fr/and/gitweb/loba.git/blobdiff_plain/6f5ec5fdc42f96a8fe95f4b846b163d4dc92e0c8..4b1551933104a6764eec30774b92737cda2d8097:/cost_func.cpp diff --git a/cost_func.cpp b/cost_func.cpp index c3a463b..7311199 100644 --- a/cost_func.cpp +++ b/cost_func.cpp @@ -3,6 +3,7 @@ #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()