diff --git a/preprocessor/ExprNode.cc b/preprocessor/ExprNode.cc index cb8ba7fb2fdeb2ef806a36a20c1f2a6c5c7003bf..9e997ebf1be63d4059c292361a92f16694961252 100644 --- a/preprocessor/ExprNode.cc +++ b/preprocessor/ExprNode.cc @@ -966,10 +966,10 @@ VariableNode::substituteExpectation(subst_table_t &subst_table, vector<BinaryOpN return const_cast<VariableNode *>(this); } -UnaryOpNode::UnaryOpNode(DataTree &datatree_arg, UnaryOpcode op_code_arg, const NodeID arg_arg, const int arg_exp_info_set) : +UnaryOpNode::UnaryOpNode(DataTree &datatree_arg, UnaryOpcode op_code_arg, const NodeID arg_arg, const int expectation_information_set_arg) : ExprNode(datatree_arg), arg(arg_arg), - Expectation_information_set(arg_exp_info_set), + expectation_information_set(expectation_information_set_arg), op_code(op_code_arg) { // Add myself to the unary op map @@ -1593,7 +1593,7 @@ UnaryOpNode::buildSimilarUnaryOpNode(NodeID alt_arg, DataTree &alt_datatree) con case oSteadyState: return alt_datatree.AddSteadyState(alt_arg); case oExpectation: - return alt_datatree.AddExpectation(Expectation_information_set, alt_arg); + return alt_datatree.AddExpectation(expectation_information_set, alt_arg); } // Suppress GCC warning exit(EXIT_FAILURE); @@ -1687,11 +1687,11 @@ UnaryOpNode::substituteExpectation(subst_table_t &subst_table, vector<BinaryOpNo return const_cast<VariableNode *>(it->second); //Arriving here, we need to create an auxiliary variable for this Expectation Operator: - int symb_id = datatree.symbol_table.addExpectationAuxiliaryVar(Expectation_information_set, arg->idx); //AUXE_period_arg.idx + int symb_id = datatree.symbol_table.addExpectationAuxiliaryVar(expectation_information_set, arg->idx); //AUXE_period_arg.idx NodeID newAuxE = datatree.AddVariable(symb_id, 0); assert(dynamic_cast<VariableNode *>(newAuxE) != NULL); - if (partial_information_model && Expectation_information_set==0) + if (partial_information_model && expectation_information_set==0) { //Ensure x is a single variable as opposed to an expression if (dynamic_cast<VariableNode *>(arg) == NULL) @@ -1704,12 +1704,12 @@ UnaryOpNode::substituteExpectation(subst_table_t &subst_table, vector<BinaryOpNo { //take care of any nested expectation operators by calling arg->substituteExpectation(.), then decreaseLeadsLags for this oExp operator //arg(lag-period) (holds entire subtree of arg(lag-period) - NodeID substexpr = (arg->substituteExpectation(subst_table, neweqs, partial_information_model))->decreaseLeadsLags(Expectation_information_set); + NodeID substexpr = (arg->substituteExpectation(subst_table, neweqs, partial_information_model))->decreaseLeadsLags(expectation_information_set); assert(substexpr != NULL); neweqs.push_back(dynamic_cast<BinaryOpNode *>(datatree.AddEqual(newAuxE, substexpr))); //AUXE_period_arg.idx = arg(lag-period) - newAuxE = newAuxE->decreaseLeadsLags(-1*Expectation_information_set); + newAuxE = newAuxE->decreaseLeadsLags(-1*expectation_information_set); assert(dynamic_cast<VariableNode *>(newAuxE) != NULL); } diff --git a/preprocessor/ExprNode.hh b/preprocessor/ExprNode.hh index 752e31d35d0c952a6702be791ec60acbfb215cda..9091d33aea3f4c57190bba1ce6b0a1c50668788b 100644 --- a/preprocessor/ExprNode.hh +++ b/preprocessor/ExprNode.hh @@ -387,14 +387,15 @@ class UnaryOpNode : public ExprNode { private: const NodeID arg; - const int Expectation_information_set; + //! Stores the information set. Only used for expectation operator + const int expectation_information_set; const UnaryOpcode op_code; virtual NodeID computeDerivative(int deriv_id); virtual int cost(const temporary_terms_type &temporary_terms, bool is_matlab) const; //! Returns the derivative of this node if darg is the derivative of the argument NodeID composeDerivatives(NodeID darg); public: - UnaryOpNode(DataTree &datatree_arg, UnaryOpcode op_code_arg, const NodeID arg_arg, const int arg_exp_info_set); + UnaryOpNode(DataTree &datatree_arg, UnaryOpcode op_code_arg, const NodeID arg_arg, const int expectation_information_set_arg); virtual void prepareForDerivation(); virtual void computeTemporaryTerms(map<NodeID, int> &reference_count, temporary_terms_type &temporary_terms, bool is_matlab) const; virtual void writeOutput(ostream &output, ExprNodeOutputType output_type, const temporary_terms_type &temporary_terms) const;