From 3eff2b91c2d24227c494afa09994a654e3ee5072 Mon Sep 17 00:00:00 2001 From: Houtan Bastani <houtan@dynare.org> Date: Thu, 15 Nov 2018 15:04:02 +0100 Subject: [PATCH] rename ds variable in epilogue to a longer name --- src/ModelEquationBlock.cc | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/src/ModelEquationBlock.cc b/src/ModelEquationBlock.cc index d4d2d717..04747614 100644 --- a/src/ModelEquationBlock.cc +++ b/src/ModelEquationBlock.cc @@ -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(); -- GitLab