00001 /* $Id: OSExpressionTree.h 3488 2010-04-29 20:16:06Z kmartin $ */ 00018 #ifndef EXPRESSIONTREE_H 00019 #define EXPRESSIONTREE_H 00020 00021 #include "OSnLNode.h" 00022 #include <vector> 00023 #include <map> 00024 00025 00035 class OSExpressionTree{ 00036 00037 public: 00038 00042 OSnLNode *m_treeRoot; 00043 00047 OSExpressionTree(); 00048 00052 ~OSExpressionTree(); 00053 00066 double calculateFunction( double *x, bool new_x); 00067 00068 00077 std::vector<OSnLNode*> getPrefixFromExpressionTree(); 00078 00087 std::vector<OSnLNode*> getPostfixFromExpressionTree(); 00088 00089 00090 00097 std::map<int, int> *mapVarIdx; 00098 00107 std::map<int, int> *getVariableIndiciesMap(); 00111 bool m_bIndexMapGenerated; 00112 00117 bool bADMustReTape; 00118 00122 bool bDestroyNlNodes; 00123 00124 00125 private: 00126 00127 00131 double m_dTreeRootValue; 00132 00133 00134 00135 };//end OSExpressionTree 00136 00137 00138 00139 00140 #endif 00141