ECF 1.5
IACos.cpp
1#include "GPSymbRegEvalOp.h"
2
3#include "IACos.h"
4#include "IATree.h"
5#include <cmath>
6
7void IACos::execute(void* result, Tree::Tree& tree)
8{
9 if (!calculateBoundsIfRootNode(result, tree)) {
10 return;
11 }
12
14}
15
16IABounds IACos::calculateBounds(Tree::IATree& tree) {
17 // get next argument
18 tree.iNode_++;
19 IAPrimitiveP prim = boost::dynamic_pointer_cast<IAPrimitive>(tree[tree.iNode_]->primitive_);
20 // calculate bounds
21 IABounds bounds = prim->calculateBounds(tree);
22
23 if (!bounds.isWithinBounds) {
24 // subtree not within bounds, delete expression
25 return bounds;
26 } else {
27 // subtree is ok
28 IABounds retVal;
29 retVal.isWithinBounds = true;
30 retVal.isLowerBoundInclusive = true;
31 retVal.lowerBound = -1.0;
32 retVal.isUpperBoundInclusive = true;
33 retVal.upperBound = 1.0;
34 return retVal;
35 }
36}
virtual void execute(void *result, Tree::Tree &tree)
Execute the primitive.
Definition: IACos.cpp:7
void execute(void *result, Tree &tree)
Execute the primitive.
Definition: Cos.cpp:20
Tree class - implements genotype as a tree.
Definition: Tree_c.h:29
uint iNode_
current node index (when parsing the tree)
Definition: Tree_c.h:75