move validation check from constructor to checkpass

time-shift
Houtan Bastani 2010-06-18 15:09:47 +02:00
parent bb47d78611
commit b5baf45f36
1 changed files with 12 additions and 11 deletions

View File

@ -350,9 +350,18 @@ EstimatedParamsStatement::EstimatedParamsStatement(const vector<EstimationParams
const SymbolTable &symbol_table_arg) :
estim_params_list(estim_params_list_arg),
symbol_table(symbol_table_arg)
{
}
void
EstimatedParamsStatement::checkPass(ModFileStructure &mod_file_struct)
{
for (vector<EstimationParams>::const_iterator it = estim_params_list.begin();
it != estim_params_list.end(); it++)
{
if (it->name == "dsge_prior_weight")
mod_file_struct.dsge_prior_weight_in_estimated_params = true;
if (it->prior == "1") //BETA_PDF is associated with "1" in DynareBison.yy
if (dynamic_cast<NumConstNode *>(it->mean)->isNumConstNodeEqualTo(0.5) &&
dynamic_cast<NumConstNode *>(it->std)->isNumConstNodeEqualTo(0.5))
@ -361,14 +370,6 @@ EstimatedParamsStatement::EstimatedParamsStatement(const vector<EstimationParams
exit(EXIT_FAILURE);
}
}
void
EstimatedParamsStatement::checkPass(ModFileStructure &mod_file_struct)
{
for (vector<EstimationParams>::const_iterator it = estim_params_list.begin();
it != estim_params_list.end(); it++)
if (it->name == "dsge_prior_weight")
mod_file_struct.dsge_prior_weight_in_estimated_params = true;
}
void