diff --git a/src/DynamicModel.cc b/src/DynamicModel.cc index a3b18744..95cfaa94 100644 --- a/src/DynamicModel.cc +++ b/src/DynamicModel.cc @@ -5191,7 +5191,7 @@ DynamicModel::substituteAdl() void DynamicModel::substituteDiff(StaticModel &static_model, ExprNode::subst_table_t &diff_subst_table) { - // Find unary ops in diff Nodes + // Find diff Nodes diff_table_t diff_table; for (map::iterator it = local_variables_table.begin(); it != local_variables_table.end(); it++) @@ -5229,7 +5229,7 @@ void DynamicModel::substituteDiffUnaryOps(StaticModel &static_model) { // Find diff Nodes - diff_table_t nodes; + set nodes; for (map::iterator it = local_variables_table.begin(); it != local_variables_table.end(); it++) it->second->findDiffUnaryOpNodes(static_model, nodes); @@ -5237,17 +5237,6 @@ DynamicModel::substituteDiffUnaryOps(StaticModel &static_model) for (int i = 0; i < (int) equations.size(); i++) equations[i]->findDiffUnaryOpNodes(static_model, nodes); - if (nodes.empty()) - return; - - // Find matching unary ops that may be outside of diffs (i.e., those with different lags) - for (map::iterator it = local_variables_table.begin(); - it != local_variables_table.end(); it++) - it->second->findUnaryOpNodesForAuxVarCreation(static_model, nodes); - - for (int i = 0; i < (int) equations.size(); i++) - equations[i]->findUnaryOpNodesForAuxVarCreation(static_model, nodes); - // Substitute in model local variables ExprNode::subst_table_t subst_table; vector neweqs; diff --git a/src/ExprNode.cc b/src/ExprNode.cc index 86194634..528ea617 100644 --- a/src/ExprNode.cc +++ b/src/ExprNode.cc @@ -539,12 +539,7 @@ NumConstNode::findDiffNodes(DataTree &static_datatree, diff_table_t &diff_table) } void -NumConstNode::findDiffUnaryOpNodes(DataTree &static_datatree, diff_table_t &unary_op_nodes_in_diff) const -{ -} - -void -NumConstNode::findUnaryOpNodesForAuxVarCreation(DataTree &static_datatree, diff_table_t &unary_op_nodes_in_diff) const +NumConstNode::findDiffUnaryOpNodes(DataTree &static_datatree, set &unary_op_nodes_in_diff) const { } @@ -555,7 +550,7 @@ NumConstNode::substituteDiff(DataTree &static_datatree, diff_table_t &diff_table } expr_t -NumConstNode::substituteDiffUnaryOpNodes(DataTree &static_datatree, diff_table_t &nodes, subst_table_t &subst_table, vector &neweqs) const +NumConstNode::substituteDiffUnaryOpNodes(DataTree &static_datatree, set &nodes, subst_table_t &subst_table, vector &neweqs) const { return const_cast(this); } @@ -1430,12 +1425,7 @@ VariableNode::findDiffNodes(DataTree &static_datatree, diff_table_t &diff_table) } void -VariableNode::findDiffUnaryOpNodes(DataTree &static_datatree, diff_table_t &unary_op_nodes_in_diff) const -{ -} - -void -VariableNode::findUnaryOpNodesForAuxVarCreation(DataTree &static_datatree, diff_table_t &unary_op_nodes_in_diff) const +VariableNode::findDiffUnaryOpNodes(DataTree &static_datatree, set &unary_op_nodes_in_diff) const { } @@ -1447,7 +1437,7 @@ VariableNode::substituteDiff(DataTree &static_datatree, diff_table_t &diff_table } expr_t -VariableNode::substituteDiffUnaryOpNodes(DataTree &static_datatree, diff_table_t &nodes, subst_table_t &subst_table, vector &neweqs) const +VariableNode::substituteDiffUnaryOpNodes(DataTree &static_datatree, set &nodes, subst_table_t &subst_table, vector &neweqs) const { return const_cast(this); } @@ -3046,7 +3036,7 @@ UnaryOpNode::isDiffPresent() const } void -UnaryOpNode::findDiffUnaryOpNodes(DataTree &static_datatree, diff_table_t &unary_op_nodes_in_diff) const +UnaryOpNode::findDiffUnaryOpNodes(DataTree &static_datatree, set &unary_op_nodes_in_diff) const { if (op_code != oDiff) { @@ -3065,6 +3055,9 @@ UnaryOpNode::findDiffUnaryOpNodes(DataTree &static_datatree, diff_table_t &unary exit(EXIT_FAILURE); } + if (unary_op_nodes_in_diff.find(sarg) != unary_op_nodes_in_diff.end()) + return; + if (sarg->get_op_code() == oDiff) { arg->findDiffUnaryOpNodes(static_datatree, unary_op_nodes_in_diff); @@ -3078,39 +3071,7 @@ UnaryOpNode::findDiffUnaryOpNodes(DataTree &static_datatree, diff_table_t &unary exit(EXIT_FAILURE); } - int arg_max_lag = -arg->maxLag(); - diff_table_t::iterator it = unary_op_nodes_in_diff.find(sarg); - if (it != unary_op_nodes_in_diff.end()) - { - for (map::const_iterator it1 = it->second.begin(); - it1 != it->second.end(); it1++) - if (arg == it1->second) - return; - it->second[arg_max_lag] = dynamic_cast(arg); - } - else - unary_op_nodes_in_diff[sarg][arg_max_lag] = dynamic_cast(arg); -} - -void -UnaryOpNode::findUnaryOpNodesForAuxVarCreation(DataTree &static_datatree, diff_table_t &unary_op_nodes_in_diff) const -{ - UnaryOpNode *sthis = dynamic_cast(this->toStatic(static_datatree)); - diff_table_t::iterator it = unary_op_nodes_in_diff.find(sthis); - if (it == unary_op_nodes_in_diff.end()) - { - arg->findUnaryOpNodesForAuxVarCreation(static_datatree, unary_op_nodes_in_diff); - return; - } - else - { - int this_max_lag = -this->maxLag(); - for (map::const_iterator it1 = it->second.begin(); - it1 != it->second.end(); it1++) - if (this == it1->second) - return; - it->second[this_max_lag] = const_cast(this); - } + unary_op_nodes_in_diff.insert(sarg); } bool @@ -3328,42 +3289,40 @@ UnaryOpNode::substituteDiff(DataTree &static_datatree, diff_table_t &diff_table, } expr_t -UnaryOpNode::substituteDiffUnaryOpNodes(DataTree &static_datatree, diff_table_t &nodes, subst_table_t &subst_table, vector &neweqs) const +UnaryOpNode::substituteDiffUnaryOpNodes(DataTree &static_datatree, set &nodes, subst_table_t &subst_table, vector &neweqs) const { - UnaryOpNode *sthis = dynamic_cast(this->toStatic(static_datatree)); - diff_table_t::iterator it = nodes.find(sthis); - if (it == nodes.end()) + UnaryOpNode *sarg, *argtouse; + if (op_code == oDiff) + { + sarg = dynamic_cast(arg->toStatic(static_datatree)); + argtouse = dynamic_cast(arg); + } + else + { + sarg = dynamic_cast(this->toStatic(static_datatree)); + argtouse = const_cast(this); + } + + if (sarg == NULL || nodes.find(sarg) == nodes.end()) { expr_t argsubst = arg->substituteDiffUnaryOpNodes(static_datatree, nodes, subst_table, neweqs); return buildSimilarUnaryOpNode(argsubst, datatree); } - subst_table_t::const_iterator sit = subst_table.find(this); + subst_table_t::const_iterator sit = subst_table.find(argtouse); if (sit != subst_table.end()) return const_cast(sit->second); - VariableNode *aux_var = NULL; - for (map::reverse_iterator rit = it->second.rbegin(); - rit != it->second.rend(); rit++) - { - if (rit == it->second.rbegin()) - { - VariableNode *vn = dynamic_cast(const_cast(this)->get_arg()); - int symb_id = datatree.symbol_table.addUnaryOpInsideDiffAuxiliaryVar(this->idx, const_cast(this), - vn->get_symb_id(), vn->get_lag()); - aux_var = datatree.AddVariable(symb_id, 0); - neweqs.push_back(dynamic_cast(datatree.AddEqual(aux_var, const_cast(this)))); - subst_table[rit->second] = dynamic_cast(aux_var); - } - else - { - VariableNode *vn = dynamic_cast(dynamic_cast(rit->second)->get_arg()); - subst_table[rit->second] = dynamic_cast(aux_var->decreaseLeadsLags(-vn->get_lag())); - } - } - - sit = subst_table.find(this); - return const_cast(sit->second); + VariableNode *vn = dynamic_cast(dynamic_cast(argtouse)->get_arg()); + int lag = vn->get_lag(); + int symb_id = datatree.symbol_table.addUnaryOpInsideDiffAuxiliaryVar(argtouse->idx, argtouse, + vn->get_symb_id(), lag); + VariableNode *aux_var = datatree.AddVariable(symb_id, 0); + neweqs.push_back(dynamic_cast(datatree.AddEqual(aux_var, argtouse))); + subst_table[argtouse] = dynamic_cast(aux_var); + if (op_code == oDiff) + return buildSimilarUnaryOpNode(aux_var, datatree); + return const_cast(aux_var); } expr_t @@ -5035,19 +4994,12 @@ BinaryOpNode::substituteAdl() const } void -BinaryOpNode::findDiffUnaryOpNodes(DataTree &static_datatree, diff_table_t &unary_op_nodes_in_diff) const +BinaryOpNode::findDiffUnaryOpNodes(DataTree &static_datatree, set &unary_op_nodes_in_diff) const { arg1->findDiffUnaryOpNodes(static_datatree, unary_op_nodes_in_diff); arg2->findDiffUnaryOpNodes(static_datatree, unary_op_nodes_in_diff); } -void -BinaryOpNode::findUnaryOpNodesForAuxVarCreation(DataTree &static_datatree, diff_table_t &unary_op_nodes_in_diff) const -{ - arg1->findUnaryOpNodesForAuxVarCreation(static_datatree, unary_op_nodes_in_diff); - arg2->findUnaryOpNodesForAuxVarCreation(static_datatree, unary_op_nodes_in_diff); -} - void BinaryOpNode::findDiffNodes(DataTree &static_datatree, diff_table_t &diff_table) const { @@ -5065,7 +5017,7 @@ BinaryOpNode::substituteDiff(DataTree &static_datatree, diff_table_t &diff_table } expr_t -BinaryOpNode::substituteDiffUnaryOpNodes(DataTree &static_datatree, diff_table_t &nodes, subst_table_t &subst_table, vector &neweqs) const +BinaryOpNode::substituteDiffUnaryOpNodes(DataTree &static_datatree, set &nodes, subst_table_t &subst_table, vector &neweqs) const { expr_t arg1subst = arg1->substituteDiffUnaryOpNodes(static_datatree, nodes, subst_table, neweqs); expr_t arg2subst = arg2->substituteDiffUnaryOpNodes(static_datatree, nodes, subst_table, neweqs); @@ -5958,21 +5910,13 @@ TrinaryOpNode::findDiffNodes(DataTree &static_datatree, diff_table_t &diff_table } void -TrinaryOpNode::findDiffUnaryOpNodes(DataTree &static_datatree, diff_table_t &unary_op_nodes_in_diff) const +TrinaryOpNode::findDiffUnaryOpNodes(DataTree &static_datatree, set &unary_op_nodes_in_diff) const { arg1->findDiffUnaryOpNodes(static_datatree, unary_op_nodes_in_diff); arg2->findDiffUnaryOpNodes(static_datatree, unary_op_nodes_in_diff); arg3->findDiffUnaryOpNodes(static_datatree, unary_op_nodes_in_diff); } -void -TrinaryOpNode::findUnaryOpNodesForAuxVarCreation(DataTree &static_datatree, diff_table_t &unary_op_nodes_in_diff) const -{ - arg1->findUnaryOpNodesForAuxVarCreation(static_datatree, unary_op_nodes_in_diff); - arg2->findUnaryOpNodesForAuxVarCreation(static_datatree, unary_op_nodes_in_diff); - arg3->findUnaryOpNodesForAuxVarCreation(static_datatree, unary_op_nodes_in_diff); -} - expr_t TrinaryOpNode::substituteDiff(DataTree &static_datatree, diff_table_t &diff_table, subst_table_t &subst_table, vector &neweqs) const @@ -5984,7 +5928,7 @@ TrinaryOpNode::substituteDiff(DataTree &static_datatree, diff_table_t &diff_tabl } expr_t -TrinaryOpNode::substituteDiffUnaryOpNodes(DataTree &static_datatree, diff_table_t &nodes, subst_table_t &subst_table, vector &neweqs) const +TrinaryOpNode::substituteDiffUnaryOpNodes(DataTree &static_datatree, set &nodes, subst_table_t &subst_table, vector &neweqs) const { expr_t arg1subst = arg1->substituteDiffUnaryOpNodes(static_datatree, nodes, subst_table, neweqs); expr_t arg2subst = arg2->substituteDiffUnaryOpNodes(static_datatree, nodes, subst_table, neweqs); @@ -6406,19 +6350,12 @@ AbstractExternalFunctionNode::findDiffNodes(DataTree &static_datatree, diff_tabl } void -AbstractExternalFunctionNode::findDiffUnaryOpNodes(DataTree &static_datatree, diff_table_t &unary_op_nodes_in_diff) const +AbstractExternalFunctionNode::findDiffUnaryOpNodes(DataTree &static_datatree, set &unary_op_nodes_in_diff) const { for (vector::const_iterator it = arguments.begin(); it != arguments.end(); it++) (*it)->findDiffUnaryOpNodes(static_datatree, unary_op_nodes_in_diff); } -void -AbstractExternalFunctionNode::findUnaryOpNodesForAuxVarCreation(DataTree &static_datatree, diff_table_t &unary_op_nodes_in_diff) const -{ - for (vector::const_iterator it = arguments.begin(); it != arguments.end(); it++) - (*it)->findUnaryOpNodesForAuxVarCreation(static_datatree, unary_op_nodes_in_diff); -} - expr_t AbstractExternalFunctionNode::substituteDiff(DataTree &static_datatree, diff_table_t &diff_table, subst_table_t &subst_table, vector &neweqs) const @@ -6430,7 +6367,7 @@ AbstractExternalFunctionNode::substituteDiff(DataTree &static_datatree, diff_tab } expr_t -AbstractExternalFunctionNode::substituteDiffUnaryOpNodes(DataTree &static_datatree, diff_table_t &nodes, subst_table_t &subst_table, vector &neweqs) const +AbstractExternalFunctionNode::substituteDiffUnaryOpNodes(DataTree &static_datatree, set &nodes, subst_table_t &subst_table, vector &neweqs) const { vector arguments_subst; for (vector::const_iterator it = arguments.begin(); it != arguments.end(); it++) @@ -7992,12 +7929,7 @@ VarExpectationNode::findDiffNodes(DataTree &static_datatree, diff_table_t &diff_ } void -VarExpectationNode::findDiffUnaryOpNodes(DataTree &static_datatree, diff_table_t &unary_op_nodes_in_diff) const -{ -} - -void -VarExpectationNode::findUnaryOpNodesForAuxVarCreation(DataTree &static_datatree, diff_table_t &unary_op_nodes_in_diff) const +VarExpectationNode::findDiffUnaryOpNodes(DataTree &static_datatree, set &unary_op_nodes_in_diff) const { } @@ -8009,7 +7941,7 @@ VarExpectationNode::substituteDiff(DataTree &static_datatree, diff_table_t &diff } expr_t -VarExpectationNode::substituteDiffUnaryOpNodes(DataTree &static_datatree, diff_table_t &nodes, subst_table_t &subst_table, vector &neweqs) const +VarExpectationNode::substituteDiffUnaryOpNodes(DataTree &static_datatree, set &nodes, subst_table_t &subst_table, vector &neweqs) const { return const_cast(this); } @@ -8442,12 +8374,7 @@ PacExpectationNode::findDiffNodes(DataTree &static_datatree, diff_table_t &diff_ } void -PacExpectationNode::findDiffUnaryOpNodes(DataTree &static_datatree, diff_table_t &unary_op_nodes_in_diff) const -{ -} - -void -PacExpectationNode::findUnaryOpNodesForAuxVarCreation(DataTree &static_datatree, diff_table_t &unary_op_nodes_in_diff) const +PacExpectationNode::findDiffUnaryOpNodes(DataTree &static_datatree, set &unary_op_nodes_in_diff) const { } @@ -8459,7 +8386,7 @@ PacExpectationNode::substituteDiff(DataTree &static_datatree, diff_table_t &diff } expr_t -PacExpectationNode::substituteDiffUnaryOpNodes(DataTree &static_datatree, diff_table_t &nodes, subst_table_t &subst_table, vector &neweqs) const +PacExpectationNode::substituteDiffUnaryOpNodes(DataTree &static_datatree, set &nodes, subst_table_t &subst_table, vector &neweqs) const { return const_cast(this); } diff --git a/src/ExprNode.hh b/src/ExprNode.hh index 5a70b86b..f28a6b1f 100644 --- a/src/ExprNode.hh +++ b/src/ExprNode.hh @@ -492,10 +492,9 @@ class ExprNode //! Substitute diff operator virtual void findDiffNodes(DataTree &static_datatree, diff_table_t &diff_table) const = 0; - virtual void findDiffUnaryOpNodes(DataTree &static_datatree, diff_table_t &unary_op_nodes_in_diff) const = 0; - virtual void findUnaryOpNodesForAuxVarCreation(DataTree &static_datatree, diff_table_t &unary_op_nodes_in_diff) const = 0; + virtual void findDiffUnaryOpNodes(DataTree &static_datatree, set &unary_op_nodes_in_diff) const = 0; virtual expr_t substituteDiff(DataTree &static_datatree, diff_table_t &diff_table, subst_table_t &subst_table, vector &neweqs) const = 0; - virtual expr_t substituteDiffUnaryOpNodes(DataTree &static_datatree, diff_table_t &nodes, subst_table_t &subst_table, vector &neweqs) const = 0; + virtual expr_t substituteDiffUnaryOpNodes(DataTree &static_datatree, set &nodes, subst_table_t &subst_table, vector &neweqs) const = 0; //! Substitute pac_expectation operator virtual expr_t substitutePacExpectation(map &subst_table) = 0; @@ -587,10 +586,9 @@ public: virtual expr_t substituteExpectation(subst_table_t &subst_table, vector &neweqs, bool partial_information_model) const; virtual expr_t substituteAdl() const; virtual void findDiffNodes(DataTree &static_datatree, diff_table_t &diff_table) const; - virtual void findDiffUnaryOpNodes(DataTree &static_datatree, diff_table_t &unary_op_nodes_in_diff) const; - virtual void findUnaryOpNodesForAuxVarCreation(DataTree &static_datatree, diff_table_t &unary_op_nodes_in_diff) const; + virtual void findDiffUnaryOpNodes(DataTree &static_datatree, set &unary_op_nodes_in_diff) const; virtual expr_t substituteDiff(DataTree &static_datatree, diff_table_t &diff_table, subst_table_t &subst_table, vector &neweqs) const; - virtual expr_t substituteDiffUnaryOpNodes(DataTree &static_datatree, diff_table_t &nodes, subst_table_t &subst_table, vector &neweqs) const; + virtual expr_t substituteDiffUnaryOpNodes(DataTree &static_datatree, set &nodes, subst_table_t &subst_table, vector &neweqs) const; virtual expr_t substitutePacExpectation(map &subst_table); virtual expr_t decreaseLeadsLagsPredeterminedVariables() const; virtual expr_t differentiateForwardVars(const vector &subset, subst_table_t &subst_table, vector &neweqs) const; @@ -678,10 +676,9 @@ public: virtual expr_t substituteExpectation(subst_table_t &subst_table, vector &neweqs, bool partial_information_model) const; virtual expr_t substituteAdl() const; virtual void findDiffNodes(DataTree &static_datatree, diff_table_t &diff_table) const; - virtual void findDiffUnaryOpNodes(DataTree &static_datatree, diff_table_t &unary_op_nodes_in_diff) const; - virtual void findUnaryOpNodesForAuxVarCreation(DataTree &static_datatree, diff_table_t &unary_op_nodes_in_diff) const; + virtual void findDiffUnaryOpNodes(DataTree &static_datatree, set &unary_op_nodes_in_diff) const; virtual expr_t substituteDiff(DataTree &static_datatree, diff_table_t &diff_table, subst_table_t &subst_table, vector &neweqs) const; - virtual expr_t substituteDiffUnaryOpNodes(DataTree &static_datatree, diff_table_t &nodes, subst_table_t &subst_table, vector &neweqs) const; + virtual expr_t substituteDiffUnaryOpNodes(DataTree &static_datatree, set &nodes, subst_table_t &subst_table, vector &neweqs) const; virtual expr_t substitutePacExpectation(map &subst_table); virtual expr_t decreaseLeadsLagsPredeterminedVariables() const; virtual expr_t differentiateForwardVars(const vector &subset, subst_table_t &subst_table, vector &neweqs) const; @@ -792,11 +789,10 @@ public: virtual expr_t substituteAdl() const; virtual void findDiffNodes(DataTree &static_datatree, diff_table_t &diff_table) const; bool createAuxVarForUnaryOpNodeInDiffOp() const; - virtual void findDiffUnaryOpNodes(DataTree &static_datatree, diff_table_t &unary_op_nodes_in_diff) const; - virtual void findUnaryOpNodesForAuxVarCreation(DataTree &static_datatree, diff_table_t &unary_op_nodes_in_diff) const; + virtual void findDiffUnaryOpNodes(DataTree &static_datatree, set &unary_op_nodes_in_diff) const; void getDiffArgUnaryOperatorIfAny(string &op_handle) const; virtual expr_t substituteDiff(DataTree &static_datatree, diff_table_t &diff_table, subst_table_t &subst_table, vector &neweqs) const; - virtual expr_t substituteDiffUnaryOpNodes(DataTree &static_datatree, diff_table_t &nodes, subst_table_t &subst_table, vector &neweqs) const; + virtual expr_t substituteDiffUnaryOpNodes(DataTree &static_datatree, set &nodes, subst_table_t &subst_table, vector &neweqs) const; virtual expr_t substitutePacExpectation(map &subst_table); virtual expr_t decreaseLeadsLagsPredeterminedVariables() const; virtual expr_t differentiateForwardVars(const vector &subset, subst_table_t &subst_table, vector &neweqs) const; @@ -923,10 +919,9 @@ public: virtual expr_t substituteExpectation(subst_table_t &subst_table, vector &neweqs, bool partial_information_model) const; virtual expr_t substituteAdl() const; virtual void findDiffNodes(DataTree &static_datatree, diff_table_t &diff_table) const; - virtual void findDiffUnaryOpNodes(DataTree &static_datatree, diff_table_t &unary_op_nodes_in_diff) const; - virtual void findUnaryOpNodesForAuxVarCreation(DataTree &static_datatree, diff_table_t &unary_op_nodes_in_diff) const; + virtual void findDiffUnaryOpNodes(DataTree &static_datatree, set &unary_op_nodes_in_diff) const; virtual expr_t substituteDiff(DataTree &static_datatree, diff_table_t &diff_table, subst_table_t &subst_table, vector &neweqs) const; - virtual expr_t substituteDiffUnaryOpNodes(DataTree &static_datatree, diff_table_t &nodes, subst_table_t &subst_table, vector &neweqs) const; + virtual expr_t substituteDiffUnaryOpNodes(DataTree &static_datatree, set &nodes, subst_table_t &subst_table, vector &neweqs) const; virtual expr_t substitutePacExpectation(map &subst_table); virtual expr_t decreaseLeadsLagsPredeterminedVariables() const; virtual expr_t differentiateForwardVars(const vector &subset, subst_table_t &subst_table, vector &neweqs) const; @@ -1029,10 +1024,9 @@ public: virtual expr_t substituteExpectation(subst_table_t &subst_table, vector &neweqs, bool partial_information_model) const; virtual expr_t substituteAdl() const; virtual void findDiffNodes(DataTree &static_datatree, diff_table_t &diff_table) const; - virtual void findDiffUnaryOpNodes(DataTree &static_datatree, diff_table_t &unary_op_nodes_in_diff) const; - virtual void findUnaryOpNodesForAuxVarCreation(DataTree &static_datatree, diff_table_t &unary_op_nodes_in_diff) const; + virtual void findDiffUnaryOpNodes(DataTree &static_datatree, set &unary_op_nodes_in_diff) const; virtual expr_t substituteDiff(DataTree &static_datatree, diff_table_t &diff_table, subst_table_t &subst_table, vector &neweqs) const; - virtual expr_t substituteDiffUnaryOpNodes(DataTree &static_datatree, diff_table_t &nodes, subst_table_t &subst_table, vector &neweqs) const; + virtual expr_t substituteDiffUnaryOpNodes(DataTree &static_datatree, set &nodes, subst_table_t &subst_table, vector &neweqs) const; virtual expr_t substitutePacExpectation(map &subst_table); virtual expr_t decreaseLeadsLagsPredeterminedVariables() const; virtual expr_t differentiateForwardVars(const vector &subset, subst_table_t &subst_table, vector &neweqs) const; @@ -1135,10 +1129,9 @@ public: virtual expr_t substituteExpectation(subst_table_t &subst_table, vector &neweqs, bool partial_information_model) const; virtual expr_t substituteAdl() const; virtual void findDiffNodes(DataTree &static_datatree, diff_table_t &diff_table) const; - virtual void findDiffUnaryOpNodes(DataTree &static_datatree, diff_table_t &unary_op_nodes_in_diff) const; - virtual void findUnaryOpNodesForAuxVarCreation(DataTree &static_datatree, diff_table_t &unary_op_nodes_in_diff) const; + virtual void findDiffUnaryOpNodes(DataTree &static_datatree, set &unary_op_nodes_in_diff) const; virtual expr_t substituteDiff(DataTree &static_datatree, diff_table_t &diff_table, subst_table_t &subst_table, vector &neweqs) const; - virtual expr_t substituteDiffUnaryOpNodes(DataTree &static_datatree, diff_table_t &nodes, subst_table_t &subst_table, vector &neweqs) const; + virtual expr_t substituteDiffUnaryOpNodes(DataTree &static_datatree, set &nodes, subst_table_t &subst_table, vector &neweqs) const; virtual expr_t substitutePacExpectation(map &subst_table); virtual expr_t buildSimilarExternalFunctionNode(vector &alt_args, DataTree &alt_datatree) const = 0; virtual expr_t decreaseLeadsLagsPredeterminedVariables() const; @@ -1331,10 +1324,9 @@ public: virtual expr_t substituteExpectation(subst_table_t &subst_table, vector &neweqs, bool partial_information_model) const; virtual expr_t substituteAdl() const; virtual void findDiffNodes(DataTree &static_datatree, diff_table_t &diff_table) const; - virtual void findDiffUnaryOpNodes(DataTree &static_datatree, diff_table_t &unary_op_nodes_in_diff) const; - virtual void findUnaryOpNodesForAuxVarCreation(DataTree &static_datatree, diff_table_t &unary_op_nodes_in_diff) const; + virtual void findDiffUnaryOpNodes(DataTree &static_datatree, set &unary_op_nodes_in_diff) const; virtual expr_t substituteDiff(DataTree &static_datatree, diff_table_t &diff_table, subst_table_t &subst_table, vector &neweqs) const; - virtual expr_t substituteDiffUnaryOpNodes(DataTree &static_datatree, diff_table_t &nodes, subst_table_t &subst_table, vector &neweqs) const; + virtual expr_t substituteDiffUnaryOpNodes(DataTree &static_datatree, set &nodes, subst_table_t &subst_table, vector &neweqs) const; virtual expr_t substitutePacExpectation(map &subst_table); virtual pair normalizeEquation(int symb_id_endo, vector > > &List_of_Op_RHS) const; virtual void compile(ostream &CompileCode, unsigned int &instruction_number, @@ -1417,10 +1409,9 @@ public: virtual expr_t substituteExpectation(subst_table_t &subst_table, vector &neweqs, bool partial_information_model) const; virtual expr_t substituteAdl() const; virtual void findDiffNodes(DataTree &static_datatree, diff_table_t &diff_table) const; - virtual void findDiffUnaryOpNodes(DataTree &static_datatree, diff_table_t &unary_op_nodes_in_diff) const; - virtual void findUnaryOpNodesForAuxVarCreation(DataTree &static_datatree, diff_table_t &unary_op_nodes_in_diff) const; + virtual void findDiffUnaryOpNodes(DataTree &static_datatree, set &unary_op_nodes_in_diff) const; virtual expr_t substituteDiff(DataTree &static_datatree, diff_table_t &diff_table, subst_table_t &subst_table, vector &neweqs) const; - virtual expr_t substituteDiffUnaryOpNodes(DataTree &static_datatree, diff_table_t &nodes, subst_table_t &subst_table, vector &neweqs) const; + virtual expr_t substituteDiffUnaryOpNodes(DataTree &static_datatree, set &nodes, subst_table_t &subst_table, vector &neweqs) const; virtual expr_t substitutePacExpectation(map &subst_table); virtual pair normalizeEquation(int symb_id_endo, vector > > &List_of_Op_RHS) const; virtual void compile(ostream &CompileCode, unsigned int &instruction_number,