From 5fd307cfd502a924b2367c1a7a5f2aa79a284fbe Mon Sep 17 00:00:00 2001 From: Michel Juillard Date: Thu, 4 Jun 2015 14:16:52 +0200 Subject: [PATCH] option occbin allows for more equations than variables --- preprocessor/ComputingTasks.cc | 9 +++++++++ preprocessor/ModFile.cc | 1 + preprocessor/Statement.cc | 3 ++- preprocessor/Statement.hh | 2 ++ 4 files changed, 14 insertions(+), 1 deletion(-) diff --git a/preprocessor/ComputingTasks.cc b/preprocessor/ComputingTasks.cc index 4e95890d2..32d3690bf 100644 --- a/preprocessor/ComputingTasks.cc +++ b/preprocessor/ComputingTasks.cc @@ -126,6 +126,10 @@ void PerfectForesightSolverStatement::checkPass(ModFileStructure &mod_file_struct, WarningConsolidation &warnings) { mod_file_struct.perfect_foresight_solver_present = true; + // Fill in option_occbin of mod_file_struct + OptionsList::string_options_t::const_iterator it = options_list.num_options.find("occbin"); + if (it != options_list.string_options.end()) + mod_file_struct.occbin_option = true; } void @@ -4221,6 +4225,11 @@ ExtendedPathStatement::checkPass(ModFileStructure &mod_file_struct, WarningConso cerr << "ERROR: the 'periods' option of 'extended_path' is mandatory" << endl; exit(EXIT_FAILURE); } + + // Fill in option_occbin of mod_file_struct + OptionsList::string_options_t::const_iterator it = options_list.num_options.find("occbin"); + if (it != options_list.string_options.end()) + mod_file_struct.occbin_option = true; } void diff --git a/preprocessor/ModFile.cc b/preprocessor/ModFile.cc index 9c303b01e..862fd4ca6 100644 --- a/preprocessor/ModFile.cc +++ b/preprocessor/ModFile.cc @@ -421,6 +421,7 @@ ModFile::transformPass(bool nostrict) */ if (!(mod_file_struct.ramsey_model_present || mod_file_struct.discretionary_policy_present) && !(mod_file_struct.bvar_present && dynamic_model.equation_number() == 0) + && !(mod_file_struct.occbin_option) && (dynamic_model.equation_number() != symbol_table.endo_nbr())) { cerr << "ERROR: There are " << dynamic_model.equation_number() << " equations but " << symbol_table.endo_nbr() << " endogenous variables!" << endl; diff --git a/preprocessor/Statement.cc b/preprocessor/Statement.cc index b7669c11d..a061a6b68 100644 --- a/preprocessor/Statement.cc +++ b/preprocessor/Statement.cc @@ -50,7 +50,8 @@ ModFileStructure::ModFileStructure() : estimation_data_statement_present(false), last_markov_switching_chain(0), calib_smoother_present(false), - estim_params_use_calib(false) + estim_params_use_calib(false), + occbin_option(false) { } diff --git a/preprocessor/Statement.hh b/preprocessor/Statement.hh index 4075524d8..4c53f9fc3 100644 --- a/preprocessor/Statement.hh +++ b/preprocessor/Statement.hh @@ -118,6 +118,8 @@ public: bool corr_options_statement_present; //! Whether a Markov Switching DSGE is present bool ms_dsge_present; + //! Whether occbin is present + bool occbin_option; }; class Statement