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

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