#include <iostream>
#include <string>
+#include <vector>
// Define a polynomial function
// The factors are given at construction time, in a C-style string,
public:
cost_func(const char* param);
~cost_func();
- cost_func& operator=(const cost_func& ref);
double operator()(double amount) const;
std::string to_string();
+
private:
- int degree;
- double* factor;
+ std::vector<double> factors;
};
#endif // !COST_FUNC_H