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

Private GIT Repository
Document a bug with parallel executions.
[loba.git] / cost_func.h
1 #ifndef COST_FUNC_H
2 #define COST_FUNC_H
3
4 #include <iostream>
5 #include <string>
6 #include <vector>
7
8 // Define a polynomial function
9 // The factors are given at construction time, in a C-style string,
10 // separated by commas (eg. "1, 2, 3" for x^2 + 2x +3).
11 class cost_func {
12 public:
13     cost_func(const char* param);
14     ~cost_func();
15
16     double operator()(double amount) const;
17     std::string to_string();
18
19 private:
20     std::vector<double> factors;
21 };
22
23 #endif // !COST_FUNC_H
24
25 // Local Variables:
26 // mode: c++
27 // End: