Skip to content
Snippets Groups Projects
Verified Commit d441ff05 authored by Sébastien Villemot's avatar Sébastien Villemot
Browse files

Fill the “M_.aux_vars(:).orig_expr” field for all auxiliary variables

This field contains a string representation of the expression that the
auxiliary variable replaces.

It is non-empty for all auxiliary variables, except for Lagrange multipliers.

Ref. dynare#773
parent 8b23a2d5
No related branches found
No related tags found
No related merge requests found
......@@ -378,11 +378,6 @@ SymbolTable::writeOutput(ostream &output) const noexcept(false)
output << "M_.aux_vars(" << i+1 << ").orig_index = " << getTypeSpecificID(aux_vars[i].get_orig_symb_id())+1 << ";" << endl;
break;
case AuxVarType::expectation:
output << "M_.aux_vars(" << i+1 << R"().orig_expr = '\mathbb{E}_{t)"
<< (aux_vars[i].get_information_set() < 0 ? "" : "+")
<< aux_vars[i].get_information_set() << "}(";
aux_vars[i].get_expr_node()->writeOutput(output, ExprNodeOutputType::latexDynamicModel);
output << ")';" << endl;
break;
case AuxVarType::diff:
case AuxVarType::diffLag:
......@@ -392,6 +387,14 @@ SymbolTable::writeOutput(ostream &output) const noexcept(false)
<< "M_.aux_vars(" << i+1 << ").orig_lead_lag = " << aux_vars[i].get_orig_lead_lag() << ";" << endl;
break;
}
if (expr_t orig_expr = aux_vars[i].get_expr_node();
orig_expr)
{
output << "M_.aux_vars(" << i+1 << ").orig_expr = '";
orig_expr->writeJsonOutput(output, {}, {});
output << "';" << endl;
}
}
if (predeterminedNbr() > 0)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment