preprocessor: take care of extra exos in stoch_simul
parent
8fa6dbc233
commit
5873adc5df
|
@ -165,6 +165,42 @@ StochSimulStatement::checkPass(ModFileStructure &mod_file_struct, WarningConsoli
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Statement *
|
||||||
|
StochSimulStatement::cloneAndReindexSymbIds(DataTree &dynamic_datatree, SymbolTable &orig_symbol_table)
|
||||||
|
{
|
||||||
|
SymbolList new_symbol_list, new_options_symbol_list;
|
||||||
|
OptionsList new_options_list = options_list;
|
||||||
|
try
|
||||||
|
{
|
||||||
|
SymbolTable *new_symbol_table = dynamic_datatree.getSymbolTable();
|
||||||
|
vector<string> symbols = symbol_list.get_symbols();
|
||||||
|
for (vector<string>::const_iterator it = symbols.begin(); it != symbols.end(); it++)
|
||||||
|
{
|
||||||
|
new_symbol_table->getID(*it);
|
||||||
|
new_symbol_list.addSymbol(*it);
|
||||||
|
}
|
||||||
|
|
||||||
|
OptionsList::symbol_list_options_t::const_iterator it = options_list.symbol_list_options.find("irf_shocks");
|
||||||
|
if (it != options_list.symbol_list_options.end())
|
||||||
|
{
|
||||||
|
symbols = it->second.get_symbols();
|
||||||
|
for (vector<string>::const_iterator it1 = symbols.begin(); it1 != symbols.end(); it1++)
|
||||||
|
{
|
||||||
|
new_symbol_table->getID(*it1);
|
||||||
|
new_options_symbol_list.addSymbol(*it1);
|
||||||
|
}
|
||||||
|
new_options_list.symbol_list_options["irf_shocks"] = new_options_symbol_list;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
catch (SymbolTable::UnknownSymbolNameException &e)
|
||||||
|
{
|
||||||
|
cerr << "ERROR: A variable in the stoch_simul statement was not found in the symbol table" << endl
|
||||||
|
<< " This likely means that you have declared a varexo that is not used in the model" << endl;
|
||||||
|
exit(EXIT_FAILURE);
|
||||||
|
}
|
||||||
|
return new StochSimulStatement(new_symbol_list, new_options_list);
|
||||||
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
StochSimulStatement::writeOutput(ostream &output, const string &basename) const
|
StochSimulStatement::writeOutput(ostream &output, const string &basename) const
|
||||||
{
|
{
|
||||||
|
|
|
@ -97,6 +97,7 @@ public:
|
||||||
const OptionsList &options_list_arg);
|
const OptionsList &options_list_arg);
|
||||||
virtual void checkPass(ModFileStructure &mod_file_struct, WarningConsolidation &warnings);
|
virtual void checkPass(ModFileStructure &mod_file_struct, WarningConsolidation &warnings);
|
||||||
virtual void writeOutput(ostream &output, const string &basename) const;
|
virtual void writeOutput(ostream &output, const string &basename) const;
|
||||||
|
virtual Statement *cloneAndReindexSymbIds(DataTree &dynamic_datatree, SymbolTable &orig_symbol_table);
|
||||||
};
|
};
|
||||||
|
|
||||||
class ForecastStatement : public Statement
|
class ForecastStatement : public Statement
|
||||||
|
|
Loading…
Reference in New Issue