Commit d70a6a81 authored by michel's avatar michel
Browse files

preprocessor: mod_file_struct.option_order must be the LARGEST stated in the...

preprocessor: mod_file_struct.option_order must be the LARGEST stated in the *.mod file, not the last one

git-svn-id: https://www.dynare.org/svn/dynare/dynare_v4@1717 ac1d8469-bf42-47a9-8791-bf33cf982152
parent e56af01f
......@@ -153,7 +153,7 @@ StochSimulStatement::checkPass(ModFileStructure &mod_file_struct)
// Fill in option_order of mod_file_struct
OptionsList::num_options_type::const_iterator it = options_list.num_options.find("order");
if (it != options_list.num_options.end())
mod_file_struct.order_option = atoi(it->second.c_str());
mod_file_struct.order_option = max(mod_file_struct.order_option,atoi(it->second.c_str()));
}
void
......@@ -181,7 +181,7 @@ RamseyPolicyStatement::checkPass(ModFileStructure &mod_file_struct)
approximation, it needs 2nd derivatives), we add 1 to the order declared by user */
OptionsList::num_options_type::const_iterator it = options_list.num_options.find("order");
if (it != options_list.num_options.end())
mod_file_struct.order_option = atoi(it->second.c_str()) + 1;
mod_file_struct.order_option = max(mod_file_struct.order_option,atoi(it->second.c_str()) + 1);
}
void
......@@ -207,7 +207,7 @@ EstimationStatement::checkPass(ModFileStructure &mod_file_struct)
// Fill in option_order of mod_file_struct
OptionsList::num_options_type::const_iterator it = options_list.num_options.find("order");
if (it != options_list.num_options.end())
mod_file_struct.order_option = atoi(it->second.c_str());
mod_file_struct.order_option = max(mod_file_struct.order_option,atoi(it->second.c_str()));
}
void
......@@ -679,7 +679,7 @@ OsrStatement::checkPass(ModFileStructure &mod_file_struct)
// Fill in option_order of mod_file_struct
OptionsList::num_options_type::const_iterator it = options_list.num_options.find("order");
if (it != options_list.num_options.end())
mod_file_struct.order_option = atoi(it->second.c_str());
mod_file_struct.order_option = max(mod_file_struct.order_option,atoi(it->second.c_str()));
}
void
......
Supports Markdown
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