Commit 9e6bdc23 authored by Houtan Bastani's avatar Houtan Bastani

Revert "fix bug in collection of ec vars of pac equation"

This reverts commit 74dd6a69.
parent 74dd6a69
......@@ -5096,10 +5096,18 @@ BinaryOpNode::getPacOptimizingPartHelper(const expr_t arg1, const expr_t arg2,
{
auto *testarg2 = dynamic_cast<BinaryOpNode *>(arg2);
if (testarg2 != nullptr && testarg2->get_op_code() == BinaryOpcode::minus)
if (dynamic_cast<VariableNode *>(testarg2->get_arg1()) != nullptr
&& dynamic_cast<VariableNode *>(testarg2->get_arg2()) != nullptr)
for (auto it : endogs)
ec_params_and_vars.emplace(*(params.begin()), it);
{
auto *test_arg1 = dynamic_cast<VariableNode *>(testarg2->get_arg1());
auto *test_arg2 = dynamic_cast<VariableNode *>(testarg2->get_arg2());
if (test_arg1 != nullptr && test_arg2 != nullptr)
{
test_arg1->collectDynamicVariables(SymbolType::endogenous, endogs);
ec_params_and_vars.emplace(*(params.begin()), *(endogs.begin()));
endogs.clear();
test_arg2->collectDynamicVariables(SymbolType::endogenous, endogs);
ec_params_and_vars.emplace(*(params.begin()), *(endogs.begin()));
}
}
}
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment