Cleanup "cutoff" and "mfs" options (the former is no longer in options_)

git-svn-id: https://www.dynare.org/svn/dynare/trunk@2888 ac1d8469-bf42-47a9-8791-bf33cf982152
issue#70
sebastien 2009-09-03 10:10:06 +00:00
parent 743041ecc4
commit d26ff57671
4 changed files with 27 additions and 15 deletions

View File

@ -1595,7 +1595,7 @@ DynamicModel::writeSparseDynamicMFile(const string &dynamic_basename, const stri
mDynamicModelFile << " y = solve_one_boundary('" << dynamic_basename << "_" << i + 1 << "'" <<
", y, x, params, y_index, " << nze <<
", options_.periods, " << block_triangular.ModelBlock->Block_List[i].is_linear <<
", blck_num, y_kmin, options_.maxit_, options_.solve_tolf, options_.slowc, options_.cutoff, options_.stack_solve_algo, 1, 1, 0);\n";
", blck_num, y_kmin, options_.maxit_, options_.solve_tolf, options_.slowc, " << cutoff << ", options_.stack_solve_algo, 1, 1, 0);\n";
mDynamicModelFile << " tmp = y(:,M_.block_structure.block(" << i + 1 << ").variable);\n";
mDynamicModelFile << " if(isnan(tmp) | isinf(tmp))\n";
mDynamicModelFile << " disp(['Inf or Nan value during the resolution of block " << i <<"']);\n";
@ -1626,7 +1626,7 @@ DynamicModel::writeSparseDynamicMFile(const string &dynamic_basename, const stri
mDynamicModelFile << " y = solve_one_boundary('" << dynamic_basename << "_" << i + 1 << "'" <<
", y, x, params, y_index, " << nze <<
", options_.periods, " << block_triangular.ModelBlock->Block_List[i].is_linear <<
", blck_num, y_kmin, options_.maxit_, options_.solve_tolf, options_.slowc, options_.cutoff, options_.stack_solve_algo, 1, 1, 0);\n";
", blck_num, y_kmin, options_.maxit_, options_.solve_tolf, options_.slowc, " << cutoff << ", options_.stack_solve_algo, 1, 1, 0);\n";
mDynamicModelFile << " tmp = y(:,M_.block_structure.block(" << i + 1 << ").variable);\n";
mDynamicModelFile << " if(isnan(tmp) | isinf(tmp))\n";
mDynamicModelFile << " disp(['Inf or Nan value during the resolution of block " << i <<"']);\n";
@ -1658,7 +1658,7 @@ DynamicModel::writeSparseDynamicMFile(const string &dynamic_basename, const stri
", options_.periods, " << block_triangular.ModelBlock->Block_List[i].Max_Lag <<
", " << block_triangular.ModelBlock->Block_List[i].Max_Lead <<
", " << block_triangular.ModelBlock->Block_List[i].is_linear <<
", blck_num, y_kmin, options_.maxit_, options_.solve_tolf, options_.slowc, options_.cutoff, options_.stack_solve_algo);\n";
", blck_num, y_kmin, options_.maxit_, options_.solve_tolf, options_.slowc, " << cutoff << ", options_.stack_solve_algo);\n";
mDynamicModelFile << " tmp = y(:,M_.block_structure.block(" << i + 1 << ").variable);\n";
mDynamicModelFile << " if(isnan(tmp) | isinf(tmp))\n";
mDynamicModelFile << " disp(['Inf or Nan value during the resolution of block " << i <<"']);\n";

View File

@ -1495,9 +1495,9 @@ o_hp_filter : HP_FILTER EQUAL INT_NUMBER { driver.option_num("hp_filter", $3); }
o_hp_ngrid : HP_NGRID EQUAL INT_NUMBER { driver.option_num("hp_ngrid", $3); };
o_periods : PERIODS EQUAL INT_NUMBER
{ driver.option_num("periods", $3); driver.option_num("simul", "1"); };
o_cutoff : CUTOFF EQUAL number { driver.option_num("cutoff", $3); }
o_cutoff : CUTOFF EQUAL number { driver.cutoff($3); }
o_markowitz : MARKOWITZ EQUAL number { driver.option_num("markowitz", $3); };
o_mfs : MFS EQUAL number { driver.option_num("mfs", $3); };
o_mfs : MFS EQUAL INT_NUMBER { driver.mfs($3); };
o_simul : SIMUL { driver.option_num("simul", "1"); };
o_simul_seed : SIMUL_SEED EQUAL INT_NUMBER { driver.option_num("simul_seed", $3); } ;
o_qz_criterium : QZ_CRITERIUM EQUAL number { driver.option_num("qz_criterium", $3); };

View File

@ -355,6 +355,24 @@ ParsingDriver::byte_code()
mod_file->byte_code = true;
}
void
ParsingDriver::cutoff(string *value)
{
double val = atof(value->c_str());
mod_file->dynamic_model.cutoff = val;
mod_file->static_dll_model.cutoff = val;
delete value;
}
void
ParsingDriver::mfs(string *value)
{
int val = atoi(value->c_str());
mod_file->dynamic_model.mfs = val;
mod_file->static_dll_model.mfs = val;
delete value;
}
void
ParsingDriver::end_initval()
{
@ -612,16 +630,6 @@ ParsingDriver::option_num(const string &name_option, const string &opt)
if ((name_option == "periods") && mod_file->block)
mod_file->dynamic_model.block_triangular.periods = atoi(opt.c_str());
else if (name_option == "cutoff")
{
mod_file->dynamic_model.cutoff = atof(opt.c_str());
mod_file->static_dll_model.cutoff = atof(opt.c_str());
}
else if (name_option == "mfs")
{
mod_file->dynamic_model.mfs = atoi(opt.c_str());
mod_file->static_dll_model.mfs = atoi(opt.c_str());
}
options_list.num_options[name_option] = opt;
}

View File

@ -179,6 +179,10 @@ public:
void block();
//! the model is stored in a binary file
void byte_code();
//! cutoff option of model block
void cutoff(string *value);
//! mfs option of model block
void mfs(string *value);
//! Sets the FILENAME for the initial value in initval
void initval_file(string *filename);
//! Declares an endogenous variable