1#include "FunctionSet.h"
3 FunctionSet::FunctionSet()
8 bool FunctionSet::initialize(StateP state)
13 FunctionP_basic function = (FunctionP_basic) (
new Add<std::vector<double>,
double>);
14 mAllFunctions_.insert(std::make_pair(function->getName(), function));
16 function = (FunctionP_basic) (
new Sub<std::vector<double>,
double>);
17 mAllFunctions_.insert(std::make_pair(function->getName(), function));
19 function = (FunctionP_basic) (
new Mul<std::vector<double>,
double>);
20 mAllFunctions_.insert(std::make_pair(function->getName(), function));
22 function = (FunctionP_basic) (
new Div<std::vector<double>,
double>);
23 mAllFunctions_.insert(std::make_pair(function->getName(), function));
25 function = (FunctionP_basic) (
new Nlog<std::vector<double>,
double>);
26 mAllFunctions_.insert(std::make_pair(function->getName(), function));
28 function = (FunctionP_basic) (
new Sqrt<std::vector<double>,
double>);
29 mAllFunctions_.insert(std::make_pair(function->getName(), function));
31 function = (FunctionP_basic) (
new Step<std::vector<double>,
double>);
32 mAllFunctions_.insert(std::make_pair(function->getName(), function));
34 function = (FunctionP_basic) (
new Neg<std::vector<double>,
double>);
35 mAllFunctions_.insert(std::make_pair(function->getName(), function));
37 function = (FunctionP_basic) (
new Sin<std::vector<double>,
double>);
38 mAllFunctions_.insert(std::make_pair(function->getName(), function));
40 function = (FunctionP_basic) (
new Cos<std::vector<double>,
double>);
41 mAllFunctions_.insert(std::make_pair(function->getName(), function));
43 function = (FunctionP_basic) (
new Max<std::vector<double>,
double>);
44 mAllFunctions_.insert(std::make_pair(function->getName(), function));
46 function = (FunctionP_basic) (
new Min<std::vector<double>,
double>);
47 mAllFunctions_.insert(std::make_pair(function->getName(), function));
49 function = (FunctionP_basic) (
new Sq_exp<std::vector<double>,
double>);
50 mAllFunctions_.insert(std::make_pair(function->getName(), function));
54 bool FunctionSet::addFunction(
const std::string &name)
57 std::map<std::string,FunctionP_basic>::iterator result = mAllFunctions_.find(name);
58 if(result == mAllFunctions_.end()) {
61 vActiveFunctions_.push_back(result->second);
62 mActiveFunctions_.insert(std::make_pair(name,result->second));