00001 /* $Id: OSExpressionTree.h 3815 2010-11-03 23:46:16Z Gassmann $ */ 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 00057 bool IsEqual(OSExpressionTree *that); 00058 00071 double calculateFunction( double *x, bool new_x); 00072 00073 00082 std::vector<OSnLNode*> getPrefixFromExpressionTree(); 00083 00092 std::vector<OSnLNode*> getPostfixFromExpressionTree(); 00093 00094 00095 00102 std::map<int, int> *mapVarIdx; 00103 00112 std::map<int, int> *getVariableIndiciesMap(); 00116 bool m_bIndexMapGenerated; 00117 00122 bool bADMustReTape; 00123 00127 bool bDestroyNlNodes; 00128 00129 00130 private: 00131 00132 00136 double m_dTreeRootValue; 00137 00138 00139 00140 };//end OSExpressionTree 00141 00142 00143 00144 00145 #endif 00146