]> AND Private Git Repository - loba.git/blobdiff - cost_func.h
Logo AND Algorithmique Numérique Distribuée

Private GIT Repository
Replace NULL with nullptr.
[loba.git] / cost_func.h
index 57d1188ddbbdde9c7ee02687f44cadcda1c81eba..c6984d22da552ffadbd23dcc6b318411cd67f8c4 100644 (file)
@@ -3,18 +3,21 @@
 
 #include <iostream>
 #include <string>
 
 #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:
 class cost_func {
 public:
-    cost_func(const char *param);
+    cost_func(const charparam);
     ~cost_func();
     ~cost_func();
-    cost_func& operator=(const cost_func& ref);
 
     double operator()(double amount) const;
     std::string to_string();
 
     double operator()(double amount) const;
     std::string to_string();
+
 private:
 private:
-    int degree;
-    double *factor;
+    std::vector<double> factors;
 };
 
 #endif // !COST_FUNC_H
 };
 
 #endif // !COST_FUNC_H