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()