From 5e1521f42b3e6cff6fc32eb30d62d470d7648d86 Mon Sep 17 00:00:00 2001 From: Houtan Bastani Date: Wed, 20 Feb 2019 16:38:44 +0100 Subject: [PATCH] =?UTF-8?q?don=E2=80=99t=20save=20unnecessary=20pac=20mode?= =?UTF-8?q?l=20info?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/DynamicModel.cc | 27 ++++++++++++--------------- src/DynamicModel.hh | 6 +++--- 2 files changed, 15 insertions(+), 18 deletions(-) diff --git a/src/DynamicModel.cc b/src/DynamicModel.cc index ae512e56..7f336dc1 100644 --- a/src/DynamicModel.cc +++ b/src/DynamicModel.cc @@ -3647,16 +3647,16 @@ DynamicModel::writeOutput(ostream &output, const string &basename, bool block_de for (auto & it : pac_model_info) { - int growth_param_index = get<6>(it.second); - if (growth_param_index >= 0) - output << modstruct << "pac." << it.first << ".growth_neutrality_param_index = " - << symbol_table.getTypeSpecificID(growth_param_index) + 1 << ";" << endl; - vector lhs = get<0>(it.second); output << modstruct << "pac." << it.first << ".lhs = ["; for (auto it : lhs) output << it + 1 << " "; output << "];" << endl; + + int growth_param_index = get<1>(it.second); + if (growth_param_index >= 0) + output << modstruct << "pac." << it.first << ".growth_neutrality_param_index = " + << symbol_table.getTypeSpecificID(growth_param_index) + 1 << ";" << endl; } for (auto & pit : pac_equation_info) @@ -4604,7 +4604,7 @@ DynamicModel::addPacModelConsistentExpectationEquation(const string & name, int void DynamicModel::fillPacModelInfo(const string &pac_model_name, - vector &lhs, + vector lhs, int max_lag, const map, pair> &eqtag_and_lag, const vector &nonstationary, @@ -4624,12 +4624,12 @@ DynamicModel::fillPacModelInfo(const string &pac_model_name, stationary_vars_present = true; int growth_param_index = -1; - if (growth_symb_id >= 0) - growth_param_index = symbol_table.addSymbol(pac_model_name + - "_pac_growth_neutrality_correction", - SymbolType::parameter); + if (growth_symb_id >= 0) + growth_param_index = symbol_table.addSymbol(pac_model_name + + "_pac_growth_neutrality_correction", + SymbolType::parameter); - for (auto pac_models_and_eqtags : pac_eqtag_and_lag) + for (auto pac_models_and_eqtags : pac_eqtag_and_lag) { if (pac_models_and_eqtags.first.first != pac_model_name) continue; @@ -4675,10 +4675,7 @@ DynamicModel::fillPacModelInfo(const string &pac_model_name, pac_expectation_substitution[make_pair(pac_model_name, eqtag)] = subExpr; } - - pac_model_info[pac_model_name] = make_tuple(lhs, max_lag, - nonstationary_vars_present, stationary_vars_present, - growth_symb_id, growth_lag, growth_param_index); + pac_model_info[pac_model_name] = make_tuple(move(lhs), growth_param_index); } void diff --git a/src/DynamicModel.hh b/src/DynamicModel.hh index 10e4ab59..c23dffc5 100644 --- a/src/DynamicModel.hh +++ b/src/DynamicModel.hh @@ -344,7 +344,7 @@ public: void walkPacParameters(const string &name, map, pair> &eqtag_and_lag); //! Add var_model info to pac_expectation nodes void fillPacModelInfo(const string &pac_model_name, - vector &lhs, + vector lhs, int max_lag, const map, pair> &eqtag_and_lag, const vector &nonstationary, @@ -476,8 +476,8 @@ public: map, expr_t> pac_expectation_substitution; //! Store info about pac models: - //! pac_model_name -> (lhsvars, max_lag, nonstationary_vars_present, stationary_vars_present, growth_symb_id, growth_lag, growth_param_index) - map, int, bool, bool, int, int, int>> pac_model_info; + //! pac_model_name -> (lhsvars, growth_param_index) + map, int>> pac_model_info; //! Store info about pac models specific to the equation they appear in //! (pac_model_name, standardized_eqtag) ->