write names of epilogue variables

issue#70
Houtan Bastani 2019-12-11 12:20:13 +01:00
parent 3694fc40b3
commit 41d38551e5
No known key found for this signature in database
GPG Key ID: 000094FB955BE169
3 changed files with 18 additions and 0 deletions

View File

@ -1011,6 +1011,8 @@ ModFile::writeOutputFiles(const string &basename, bool clear_all, bool clear_glo
<< "M_.ramsey_eq_nbr = " << mod_file_struct.ramsey_eq_nbr << ";" << endl
<< "M_.set_auxiliary_variables = exist(['./+' M_.fname '/set_auxiliary_variables.m'], 'file') == 2;" << endl;
epilogue.writeOutput(mOutputFile);
if (dynamic_model.equation_number() > 0)
{
if (linear_decomposition)

View File

@ -415,3 +415,16 @@ Epilogue::writeEpilogueFile(const string &basename) const
output << "end" << endl;
output.close();
}
void
Epilogue::writeOutput(ostream &output) const
{
if (def_table.empty())
return;
int idx = 1;
output << "M_.epilogue_names = cell(" << def_table.size() << ",1);" << endl;
for (const auto & [symb_id, expr] : def_table)
output << "M_.epilogue_names{" << idx++ << "} = '"
<< symbol_table.getName(symb_id) << "';" << endl;
}

View File

@ -95,6 +95,9 @@ public:
//! Write the steady state file
void writeEpilogueFile(const string &basename) const;
//! Write Output
void writeOutput(ostream &output) const;
};