Commit 595171a0 authored by Houtan Bastani's avatar Houtan Bastani
Browse files

identification: added advanced and max_dim_cova_group to the preprocessor

parent 33787d4b
......@@ -939,9 +939,18 @@ MS_SBVARStatement::writeOutput(ostream &output, const string &basename) const
output << "ms_sbvar(1,M_,options_);" << endl;
}
IdentificationStatement::IdentificationStatement(const OptionsList &options_list_arg) :
options_list(options_list_arg)
IdentificationStatement::IdentificationStatement(const OptionsList &options_list_arg)
{
options_list = options_list_arg;
if (options_list.num_options.find("advanced") == options_list.num_options.end())
options_list.num_options["advanced"] = "0";
if (options_list.num_options.find("max_dim_cova_group") != options_list.num_options.end())
if (atoi(options_list.num_options["max_dim_cova_group"].c_str()) == 0)
{
cerr << "ERROR: The max_dim_cova_group option to identification only accepts integers > 0." << endl;
exit(EXIT_FAILURE);
}
}
void
......
......@@ -391,7 +391,7 @@ public:
class IdentificationStatement : public Statement
{
private:
const OptionsList options_list;
OptionsList options_list;
public:
IdentificationStatement(const OptionsList &options_list_arg);
virtual void checkPass(ModFileStructure &mod_file_struct);
......
......@@ -113,7 +113,7 @@ class ParsingDriver;
%token <string_val> NAME
%token NAN_CONSTANT NO_STATIC NOBS NOCONSTANT NOCORR NODIAGNOSTIC NOFUNCTIONS
%token NOGRAPH NOMOMENTS NOPRINT NORMAL_PDF
%token OBSERVATION_TRENDS OPTIM OPTIM_WEIGHTS ORDER OSR OSR_PARAMS
%token OBSERVATION_TRENDS OPTIM OPTIM_WEIGHTS ORDER OSR OSR_PARAMS MAX_DIM_COVA_GROUP ADVANCED
%token PARAMETERS PARAMETER_SET PARTIAL_INFORMATION PERIODS PLANNER_OBJECTIVE PLOT_CONDITIONAL_FORECAST PLOT_PRIORS PREFILTER PRESAMPLE
%token PRINT PRIOR_MC PRIOR_TRUNC PRIOR_MODE PRIOR_MEAN POSTERIOR_MODE POSTERIOR_MEAN POSTERIOR_MEDIAN PRUNING
%token <string_val> QUOTED_STRING
......@@ -1265,6 +1265,8 @@ identification_option : o_ar
| o_useautocorr
| o_load_ident_files
| o_prior_mc
| o_advanced
| o_max_dim_cova_group
;
model_comparison : MODEL_COMPARISON mc_filename_list ';'
......@@ -1820,6 +1822,8 @@ o_gsa_trans_ident : TRANS_IDENT EQUAL INT_NUMBER { driver.option_num("trans_iden
o_load_ident_files : LOAD_IDENT_FILES EQUAL INT_NUMBER { driver.option_num("load_ident_files", $3); }
o_useautocorr : USEAUTOCORR EQUAL INT_NUMBER { driver.option_num("useautocorr", $3); }
o_prior_mc : PRIOR_MC EQUAL INT_NUMBER { driver.option_num("prior_mc", $3); }
o_advanced : ADVANCED EQUAL signed_integer { driver.option_num("advanced", $3); }
o_max_dim_cova_group : MAX_DIM_COVA_GROUP EQUAL INT_NUMBER { driver.option_num("max_dim_cova_group", $3); }
o_homotopy_mode : HOMOTOPY_MODE EQUAL INT_NUMBER {driver.option_num("homotopy_mode",$3); };
o_homotopy_steps : HOMOTOPY_STEPS EQUAL INT_NUMBER {driver.option_num("homotopy_steps",$3); };
......
......@@ -530,7 +530,8 @@ string eofbuff;
/* For identification() statement */
<DYNARE_STATEMENT>prior_mc {return token::PRIOR_MC;}
<DYNARE_STATEMENT>advanced {return token::ADVANCED;}
<DYNARE_STATEMENT>max_dim_cova_group {return token::MAX_DIM_COVA_GROUP;}
<DYNARE_STATEMENT,DYNARE_BLOCK>[A-Za-z_][A-Za-z0-9_]* {
yylval->string_val = new string(yytext);
......
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