Verified Commit 5e1521f4 authored by Houtan Bastani's avatar Houtan Bastani
Browse files

don’t save unnecessary pac model info

parent 240aba67
......@@ -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<int> 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<int> &lhs,
vector<int> lhs,
int max_lag,
const map<pair<string, string>, pair<string, int>> &eqtag_and_lag,
const vector<bool> &nonstationary,
......@@ -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
......
......@@ -344,7 +344,7 @@ public:
void walkPacParameters(const string &name, map<pair<string, string>, pair<string, int>> &eqtag_and_lag);
//! Add var_model info to pac_expectation nodes
void fillPacModelInfo(const string &pac_model_name,
vector<int> &lhs,
vector<int> lhs,
int max_lag,
const map<pair<string, string>, pair<string, int>> &eqtag_and_lag,
const vector<bool> &nonstationary,
......@@ -476,8 +476,8 @@ public:
map<pair<string, string>, 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<string, tuple<vector<int>, int, bool, bool, int, int, int>> pac_model_info;
//! pac_model_name -> (lhsvars, growth_param_index)
map<string, pair<vector<int>, int>> pac_model_info;
//! Store info about pac models specific to the equation they appear in
//! (pac_model_name, standardized_eqtag) ->
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment