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