X-Git-Url: https://bilbo.iut-bm.univ-fcomte.fr/and/gitweb/loba.git/blobdiff_plain/f4125505064e3ff346b31ab9e48f894672e5a7a7..fc5dcac1115a7112e7ad9d67ce7fe233790e0887:/cost_func.cpp?ds=sidebyside 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()