From 7352cc4fe28b73d6ae48433d75efa41f8e451b1a Mon Sep 17 00:00:00 2001 From: Houtan Bastani <houtan@dynare.org> Date: Mon, 13 Oct 2014 17:25:08 +0200 Subject: [PATCH] preprocessor: add field to store the number of multiplier equations added to ramsey problem. closes #728 --- ModFile.cc | 6 ++++-- ModFile.hh | 3 +++ 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/ModFile.cc b/ModFile.cc index 553f0b3e..55490177 100644 --- a/ModFile.cc +++ b/ModFile.cc @@ -39,7 +39,7 @@ ModFile::ModFile(WarningConsolidation &warnings_arg) steady_state_model(symbol_table, num_constants, external_functions_table, static_model), linear(false), block(false), byte_code(false), use_dll(false), no_static(false), differentiate_forward_vars(false), - nonstationary_variables(false), orig_eqn_nbr(0), + nonstationary_variables(false), orig_eqn_nbr(0), ramsey_eqn_nbr(0), warnings(warnings_arg) { } @@ -349,6 +349,7 @@ ModFile::transformPass(bool nostrict) dynamic_model.cloneDynamic(ramsey_FOC_equations_dynamic_model); ramsey_FOC_equations_dynamic_model.computeRamseyPolicyFOCs(*planner_objective); ramsey_FOC_equations_dynamic_model.replaceMyEquations(dynamic_model); + ramsey_eqn_nbr = dynamic_model.equation_number() - orig_eqn_nbr; } if (mod_file_struct.stoch_simul_present @@ -741,7 +742,8 @@ ModFile::writeOutputFiles(const string &basename, bool clear_all, bool no_log, b mOutputFile << "addpath " << basename << ";" << endl; mOutputFile << "M_.orig_eq_nbr = " << orig_eqn_nbr << ";" << endl - << "M_.eq_nbr = " << dynamic_model.equation_number() << ";" << endl; + << "M_.eq_nbr = " << dynamic_model.equation_number() << ";" << endl + << "M_.ramsey_eq_nbr = " << ramsey_eqn_nbr << ";" << endl; if (dynamic_model.equation_number() > 0) { diff --git a/ModFile.hh b/ModFile.hh index 465d905e..d8b042a7 100644 --- a/ModFile.hh +++ b/ModFile.hh @@ -95,6 +95,9 @@ public: //! Stores the original number of equations in the model_block int orig_eqn_nbr; + //! Stores the number of equations added to the Ramsey model + int ramsey_eqn_nbr; + //! Stores the list of extra files to be transefered during a parallel run /*! (i.e. option parallel_local_files of model block) */ vector<string> parallel_local_files; -- GitLab