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
Dóra Kocsis
dynare
Commits
dfec70bc
Commit
dfec70bc
authored
Aug 07, 2011
by
Ferhat Mihoubi
Browse files
correct a bug during the state variables detection
parent
95671d89
Changes
1
Hide whitespace changes
Inline
Side-by-side
preprocessor/DynamicModel.cc
View file @
dfec70bc
...
...
@@ -2324,16 +2324,15 @@ DynamicModel::writeOutput(ostream &output, const string &basename, bool block_de
<<
"M_.nboth = "
<<
nboth
<<
";"
<<
endl
;
for
(
int
endoID
=
0
;
endoID
<
symbol_table
.
endo_nbr
();
endoID
++
)
{
output
<<
endl
;
// Loop on periods
for
(
int
lag
=
-
max_endo_lag
;
lag
<
=
max_endo_lead
;
lag
++
)
for
(
int
lag
=
-
max_endo_lag
;
lag
<
0
;
lag
++
)
{
// Print variableID if exists with current period, otherwise print 0
try
{
int
varID
=
getDerivID
(
variable_reordered
[
symbol_table
.
getID
(
eEndogenous
,
endoID
)
],
lag
);
if
(
lag
<
0
&&
find
(
state_var
.
begin
(),
state_var
.
end
(),
variable_reordered
[
symbol_table
.
getID
(
eEndogenous
,
endoID
)
]
+
1
)
==
state_var
.
end
())
state_var
.
push_back
(
variable_reordered
[
symbol_table
.
getID
(
eEndogenous
,
endoID
)
]
+
1
);
getDerivID
(
symbol_table
.
getID
(
eEndogenous
,
variable_reordered
[
endoID
]
)
,
lag
);
if
(
lag
<
0
&&
find
(
state_var
.
begin
(),
state_var
.
end
(),
variable_reordered
[
endoID
]
+
1
)
==
state_var
.
end
())
state_var
.
push_back
(
variable_reordered
[
endoID
]
+
1
);
}
catch
(
UnknownDerivIDException
&
e
)
{
...
...
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