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