Skip to content
GitLab
Menu
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
Dynare
preprocessor
Commits
f338e876
Commit
f338e876
authored
Jun 02, 2018
by
Houtan Bastani
Browse files
Revert "remove unnecessary code for calculation of max lag when equation have been undiffed"
This reverts commit
d7c979a4
.
parent
d7c979a4
Changes
3
Hide whitespace changes
Inline
Side-by-side
src/DynamicModel.cc
View file @
f338e876
...
...
@@ -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
DynamicModel::walkPacParameters()
{
...
...
src/DynamicModel.hh
View file @
f338e876
...
...
@@ -316,6 +316,8 @@ public:
int
max_lag
,
vector
<
bool
>
&
nonstationary
,
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
void
substitutePacExpectation
();
...
...
src/ModFile.cc
View file @
f338e876
...
...
@@ -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
>
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
);
max_lag
=
original_model
.
getUndiffMaxLag
(
diff_static_model
,
lhs_expr_t
,
eqnumber
);
}
pms
->
fillUndiffedLHS
(
lhs
);
dynamic_model
.
walkPacParameters
();
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment