X-Git-Url: https://bilbo.iut-bm.univ-fcomte.fr/and/gitweb/loba.git/blobdiff_plain/6f5ec5fdc42f96a8fe95f4b846b163d4dc92e0c8..2955afe732becd712d718abaf6806aef3c0998a6:/cost_func.h?ds=sidebyside

diff --git a/cost_func.h b/cost_func.h
index ed97dcf..c6984d2 100644
--- a/cost_func.h
+++ b/cost_func.h
@@ -3,18 +3,21 @@
 
 #include <iostream>
 #include <string>
+#include <vector>
 
+// Define a polynomial function
+// The factors are given at construction time, in a C-style string,
+// separated by commas (eg. "1, 2, 3" for x^2 + 2x +3).
 class cost_func {
 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