ECF 1.5
Sin.cpp
1#include "../ECF_base.h"
2#include <cmath>
3#include "Sin.h"
4
5namespace Tree {
6namespace Primitives {
7
8Sin::Sin(void)
9{
10 nArguments_ = 1;
11 name_ = "sin";
12 complementName_ = "cos";
13}
14
15
16Sin::~Sin(void)
17{ }
18
19
20void Sin::execute(void* result, Tree &tree)
21{
22 double& arg = *(double*)result;
23 getNextArgument(&arg, tree);
24 // argument in radians
25 arg = sin(arg);
26}
27
28}
29}
void getNextArgument(void *result, Tree &tree)
Execute next child node's primitive (execute next subtree).
Definition: Primitive.cpp:71
void execute(void *result, Tree &tree)
Execute the primitive.
Definition: Sin.cpp:20
Tree class - implements genotype as a tree.
Definition: Tree_c.h:29