00001 /* $Id: OSExpressionTree.h 4438 2012-01-25 00:01:04Z Gassmann $ */ 00016 #ifndef EXPRESSIONTREE_H 00017 #define EXPRESSIONTREE_H 00018 00019 #include "OSnLNode.h" 00020 #include <vector> 00021 #include <map> 00022 00023 00033 class OSExpressionTree 00034 { 00035 00036 public: 00037 00041 OSnLNode *m_treeRoot; 00042 00046 OSExpressionTree(); 00047 00051 ~OSExpressionTree(); 00052 00056 bool IsEqual(OSExpressionTree *that); 00057 00070 double calculateFunction( double *x, bool new_x); 00071 00072 00081 std::vector<OSnLNode*> getPrefixFromExpressionTree(); 00082 00091 std::vector<OSnLNode*> getPostfixFromExpressionTree(); 00092 00093 00094 00101 std::map<int, int> *mapVarIdx; 00102 00113 std::map<int, int> *getVariableIndiciesMap(); 00114 00123 std::map<int, int> *getVariableIndicesMap(); 00124 00128 bool m_bIndexMapGenerated; 00129 00134 bool bADMustReTape; 00135 00139 bool bDestroyNlNodes; 00140 00141 00142 private: 00143 00144 00148 double m_dTreeRootValue; 00149 00150 00151 00152 };//end OSExpressionTree 00153 00154 00155 00156 00157 #endif 00158