rename ds variable in epilogue to a longer name

parent a8c7fb69
Pipeline #330 passed with stage
in 1 minute and 21 seconds
......@@ -367,20 +367,20 @@ Epilogue::writeEpilogueFile(const string &basename) const
}
ExprNodeOutputType output_type = ExprNodeOutputType::epilogueFile;
output << "function ds = epilogue(params, ds)" << endl
<< "% function ds = epilogue(params, ds)" << endl
output << "function epilogue_dseries__ = epilogue(params, epilogue_dseries__)" << endl
<< "% function epilogue_dseries__ = epilogue(params, epilogue_dseries__)" << endl
<< "% Epilogue file generated by Dynare preprocessor" << endl << endl
<< "epilogue_ds_first_date__ = ds.firstdate;" << endl
<< "epilogue_loop_begin_idx__ = lastdate(ds) - ds.lastobservedperiod;" << endl
<< "epilogue_loop_end_idx__ = lastdate(ds) - firstdate(ds) + 1;" << endl << endl;
<< "% loop range variables" << endl
<< "epilogue_loop_begin_idx__ = lastdate(epilogue_dseries__) - epilogue_dseries__.lastobservedperiod;" << endl
<< "epilogue_loop_end_idx__ = lastdate(epilogue_dseries__) - firstdate(epilogue_dseries__) + 1;" << endl << endl;
output << "% endogenous" << endl;
for (auto symb_id : endogs)
output << symbol_table.getName(symb_id) << " = ds." << symbol_table.getName(symb_id) << ".data;" << endl;
output << symbol_table.getName(symb_id) << " = epilogue_dseries__." << symbol_table.getName(symb_id) << ".data;" << endl;
output << endl
<< "% exogenous" << endl;
for (auto symb_id : exogs)
output << symbol_table.getName(symb_id) << " = ds." << symbol_table.getName(symb_id) << ".data;" << endl;
output << symbol_table.getName(symb_id) << " = epilogue_dseries__." << symbol_table.getName(symb_id) << ".data;" << endl;
output << endl
<< "for epilogue_it__ = epilogue_loop_begin_idx__:epilogue_loop_end_idx__" << endl;
......@@ -404,8 +404,8 @@ Epilogue::writeEpilogueFile(const string &basename) const
}
output << "end" << endl << endl;
for (auto symb_id : endogs)
output << "ds." << symbol_table.getName(symb_id) << " = dseries(" << symbol_table.getName(symb_id)
<< ", epilogue_ds_first_date__);" << endl;
output << "epilogue_dseries__." << symbol_table.getName(symb_id) << " = dseries(" << symbol_table.getName(symb_id)
<< ", epilogue_dseries__.firstdate);" << endl;
output << endl
<< "end" << endl;
output.close();
......
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