diff --git a/matlab/dynare_m.exe b/matlab/dynare_m.exe index 698ef49df..cf81eeebe 100755 Binary files a/matlab/dynare_m.exe and b/matlab/dynare_m.exe differ diff --git a/preprocessor/ComputingTasks.cc b/preprocessor/ComputingTasks.cc index e92d5a28e..ddd707183 100644 --- a/preprocessor/ComputingTasks.cc +++ b/preprocessor/ComputingTasks.cc @@ -256,8 +256,8 @@ DynareSensitivityStatement::DynareSensitivityStatement(const OptionsList &option void DynareSensitivityStatement::writeOutput(ostream &output, const string &basename) const { - options_list.writeOutput(output); - output << "dynare_sensitivity;" << endl; + options_list.writeOutput(output,"options_gsa"); + output << "dynare_sensitivity(options_gsa);" << endl; } RplotStatement::RplotStatement(const TmpSymbolTable &tmp_symbol_table_arg, diff --git a/preprocessor/Statement.cc b/preprocessor/Statement.cc index 735f21c3f..2297e6142 100644 --- a/preprocessor/Statement.cc +++ b/preprocessor/Statement.cc @@ -73,6 +73,29 @@ OptionsList::writeOutput(ostream &output) const it->second->writeOutput("options_."+it->first,output); } +void +OptionsList::writeOutput(ostream &output, const string &option_group) const +{ + output << option_group << " = struct();" << endl; + + for(num_options_type::const_iterator it = num_options.begin(); + it != num_options.end(); it++) + output << option_group << "." << it->first << " = " << it->second << ";" << endl; + + for(paired_num_options_type::const_iterator it = paired_num_options.begin(); + it != paired_num_options.end(); it++) + output << option_group << "." << it->first << " = [" << it->second.first << "; " + << it->second.second << "];" << endl; + + for(string_options_type::const_iterator it = string_options.begin(); + it != string_options.end(); it++) + output << option_group << "." << it->first << " = '" << it->second << "';" << endl; + + for(string_list_options_type::const_iterator it = string_list_options.begin(); + it != string_list_options.end(); it++) + it->second->writeOutput(option_group+"."+it->first,output); +} + void OptionsList::clear() { diff --git a/preprocessor/include/Statement.hh b/preprocessor/include/Statement.hh index 4379066db..a05733c7d 100644 --- a/preprocessor/include/Statement.hh +++ b/preprocessor/include/Statement.hh @@ -78,6 +78,7 @@ public: string_options_type string_options; string_list_options_type string_list_options; void writeOutput(ostream &output) const; + void writeOutput(ostream &output, const string &option_group) const; void clear(); };