#include <cstring>
#include <iterator>
#include <sstream>
+
#include "cost_func.h"
cost_func::cost_func(const char* param)
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()