1 /* 2 * OpNode.cpp 3 * 4 * Created on: 8 Apr 2013 5 * Author: s0965328 6 */ 7 8 #include "OPNode.h" 9 #include "Stack.h" 10 #include "Tape.h" 11 #include "PNode.h" 12 /*********************************************************** 13 h 14 / \ 15 u v ----- hu hv represent dh/du dh/dv resepectively. 16 - - - 17 x1....xn 18 ***********************************************************/ 19 20 namespace AutoDiff{ 21 OPNode(OPCODE op,Node * left)22OPNode::OPNode(OPCODE op, Node* left) : ActNode(), op(op), left(left),val(NaN_Double) { 23 } 24 getType()25TYPE OPNode::getType() 26 { 27 return OPNode_Type; 28 } 29 ~OPNode()30OPNode::~OPNode() { 31 if(left->getType()!=VNode_Type) 32 { 33 delete left; 34 this->left = NULL; 35 } 36 } 37 } 38