From fd5b9279da0b583a6649ba09826230c4936893e0 Mon Sep 17 00:00:00 2001 From: Houtan Bastani Date: Thu, 2 Apr 2015 18:03:16 +0200 Subject: [PATCH] take care of extra exos in estimated_params_bounds --- ComputingTasks.cc | 26 ++++++++++++++++++++++++++ ComputingTasks.hh | 1 + 2 files changed, 27 insertions(+) diff --git a/ComputingTasks.cc b/ComputingTasks.cc index c617fbf4..4b7b7c7e 100644 --- a/ComputingTasks.cc +++ b/ComputingTasks.cc @@ -1067,6 +1067,32 @@ EstimatedParamsBoundsStatement::EstimatedParamsBoundsStatement(const vector new_estim_params_list; + SymbolTable *new_symbol_table = dynamic_datatree.getSymbolTable(); + try + { + for (vector::const_iterator it = estim_params_list.begin(); + it != estim_params_list.end(); it++) + if (!it->name2.empty()) + { + new_symbol_table->getID(it->name); + new_symbol_table->getID(it->name2); + } + else + new_symbol_table->getID(it->name); + } + catch (SymbolTable::UnknownSymbolNameException &e) + { + cerr << "ERROR: A variable in the estimated_params_bounds 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 EstimatedParamsBoundsStatement(estim_params_list, *new_symbol_table); +} + void EstimatedParamsBoundsStatement::writeOutput(ostream &output, const string &basename) const { diff --git a/ComputingTasks.hh b/ComputingTasks.hh index d1b08beb..968fd5d9 100644 --- a/ComputingTasks.hh +++ b/ComputingTasks.hh @@ -345,6 +345,7 @@ public: EstimatedParamsBoundsStatement(const vector &estim_params_list_arg, const SymbolTable &symbol_table_arg); virtual void writeOutput(ostream &output, const string &basename) const; + virtual Statement *cloneAndReindexSymbIds(DataTree &dynamic_datatree, SymbolTable &orig_symbol_table); }; class OptimWeightsStatement : public Statement