ECF 1.5
Function.h
1#ifndef ECF_CARTESIAN_FUNCTION_H
2#define ECF_CARTESIAN_FUNCTION_H
3#include "Cartesian_genotype.h"
4#include <cmath>
5namespace cartesian{
6 template <typename Container, typename Result>
7 class Function
8 {
9 public:
10 Function() {}
11 Function(uint numArgs) {}
12 virtual ~Function() {}
13
39 virtual void evaluate(Container& container, Result& result) = 0;
40
41 std::string getName()
42 {
43 return name_;
44 }
45
46 uint getNumOfArgs()
47 {
48 return numOfArgs_;
49 }
50
51 protected:
52 std::string name_;
53 uint numOfArgs_;
54 };
55
56 //FunctionP_basic, assumes that container is a std::vector<double>, and obviously result is a double.
57 typedef boost::shared_ptr<Function<std::vector<double>,double> > FunctionP_basic;
58}
59#endif //ECF_CARTESIAN_FUNCTION_H
virtual void evaluate(Container &container, Result &result)=0