Commit f63c2c09 authored by michel's avatar michel
Browse files

v4 preprocessor: added provision for local options; used by dynare_sensitivity.m

git-svn-id: https://www.dynare.org/svn/dynare/dynare_v4@1784 ac1d8469-bf42-47a9-8791-bf33cf982152
parent 9059f594
......@@ -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,
......
......@@ -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()
{
......
......@@ -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();
};
......
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