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
2a2da609
Commit
2a2da609
authored
Jan 03, 2012
by
Houtan Bastani
Browse files
ms-sbvar: enforce consecutive chain numbers for markov_switching
parent
7ec25ee2
Changes
3
Hide whitespace changes
Inline
Side-by-side
preprocessor/ComputingTasks.cc
View file @
2a2da609
/*
* Copyright (C) 2003-201
1
Dynare Team
* Copyright (C) 2003-201
2
Dynare Team
*
* This file is part of Dynare.
*
...
...
@@ -1427,6 +1427,16 @@ MarkovSwitchingStatement::MarkovSwitchingStatement(const OptionsList &options_li
void
MarkovSwitchingStatement
::
checkPass
(
ModFileStructure
&
mod_file_struct
)
{
OptionsList
::
num_options_t
::
const_iterator
itChain
=
options_list
.
num_options
.
find
(
"ms.chain"
);
assert
(
itChain
!=
options_list
.
num_options
.
end
());
int
chainNumber
=
atoi
(
itChain
->
second
.
c_str
());
if
(
++
mod_file_struct
.
last_markov_switching_chain
!=
chainNumber
)
{
cerr
<<
"ERROR: The markov_switching chain option takes consecutive integers "
<<
"beginning at 1."
<<
endl
;
exit
(
EXIT_FAILURE
);
}
OptionsList
::
num_options_t
::
const_iterator
it_num
=
options_list
.
num_options
.
find
(
"ms.restrictions"
);
if
(
it_num
!=
options_list
.
num_options
.
end
())
{
...
...
preprocessor/Statement.cc
View file @
2a2da609
/*
* Copyright (C) 2006-201
1
Dynare Team
* Copyright (C) 2006-201
2
Dynare Team
*
* This file is part of Dynare.
*
...
...
@@ -50,7 +50,8 @@ ModFileStructure::ModFileStructure() :
corr_prior_statement_present
(
false
),
options_statement_present
(
false
),
std_options_statement_present
(
false
),
corr_options_statement_present
(
false
)
corr_options_statement_present
(
false
),
last_markov_switching_chain
(
0
)
{
}
...
...
preprocessor/Statement.hh
View file @
2a2da609
/*
* Copyright (C) 2006-201
1
Dynare Team
* Copyright (C) 2006-201
2
Dynare Team
*
* This file is part of Dynare.
*
...
...
@@ -100,6 +100,8 @@ public:
bool
std_options_statement_present
;
//! Whether there is a corr options statement present
bool
corr_options_statement_present
;
//! Last chain number for Markov Switching statement
int
last_markov_switching_chain
;
};
class
Statement
...
...
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