Revert "remove unnecessary code for calculation of max lag when equation have been undiffed"
This reverts commit d7c979a4e6
.
issue#70
parent
d7c979a4e6
commit
f338e87692
|
@ -3555,6 +3555,22 @@ DynamicModel::getUndiffLHSForPac(vector<int> &lhs, vector<expr_t> &lhs_expr_t, v
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
int
|
||||||
|
DynamicModel::getUndiffMaxLag(StaticModel &static_model, vector<expr_t> &lhs, vector<int> &eqnumber) const
|
||||||
|
{
|
||||||
|
set<expr_t> lhs_static;
|
||||||
|
for(vector<expr_t>::const_iterator it = lhs.begin();
|
||||||
|
it != lhs.end(); it++)
|
||||||
|
lhs_static.insert((*it)->toStatic(static_model));
|
||||||
|
|
||||||
|
int max_lag = 0;
|
||||||
|
for (vector<int>::const_iterator it = eqnumber.begin();
|
||||||
|
it != eqnumber.end(); it++)
|
||||||
|
equations[*it]->get_arg2()->VarMaxLag(static_model, lhs_static, max_lag);
|
||||||
|
|
||||||
|
return max_lag;
|
||||||
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
DynamicModel::walkPacParameters()
|
DynamicModel::walkPacParameters()
|
||||||
{
|
{
|
||||||
|
|
|
@ -316,6 +316,8 @@ public:
|
||||||
int max_lag,
|
int max_lag,
|
||||||
vector<bool> &nonstationary,
|
vector<bool> &nonstationary,
|
||||||
int growth_symb_id);
|
int growth_symb_id);
|
||||||
|
//! Get the max lag for the PAC VAR
|
||||||
|
int getUndiffMaxLag(StaticModel &static_model, vector<expr_t> &lhs, vector<int> &eqnumber) const;
|
||||||
|
|
||||||
//! Substitutes pac_expectation operator
|
//! Substitutes pac_expectation operator
|
||||||
void substitutePacExpectation();
|
void substitutePacExpectation();
|
||||||
|
|
|
@ -427,6 +427,7 @@ ModFile::transformPass(bool nostrict, bool stochastic, bool compute_xrefs, const
|
||||||
vector<int> orig_diff_var = var_model_info_pac_expectation[var_model_name].first.second.second;
|
vector<int> orig_diff_var = var_model_info_pac_expectation[var_model_name].first.second.second;
|
||||||
vector<int> eqnumber = var_model_info_pac_expectation[var_model_name].second.second;
|
vector<int> eqnumber = var_model_info_pac_expectation[var_model_name].second.second;
|
||||||
dynamic_model.getUndiffLHSForPac(lhs, lhs_expr_t, diff, orig_diff_var, eqnumber, undiff, diff_subst_table);
|
dynamic_model.getUndiffLHSForPac(lhs, lhs_expr_t, diff, orig_diff_var, eqnumber, undiff, diff_subst_table);
|
||||||
|
max_lag = original_model.getUndiffMaxLag(diff_static_model, lhs_expr_t, eqnumber);
|
||||||
}
|
}
|
||||||
pms->fillUndiffedLHS(lhs);
|
pms->fillUndiffedLHS(lhs);
|
||||||
dynamic_model.walkPacParameters();
|
dynamic_model.walkPacParameters();
|
||||||
|
|
Loading…
Reference in New Issue