diff --git a/src/DynamicModel.cc b/src/DynamicModel.cc index e6228b8192fb62e90ac15aff69948e4142c2b104..416d5abb34df6f28e057f7978d5311fa81a42a9f 100644 --- a/src/DynamicModel.cc +++ b/src/DynamicModel.cc @@ -2820,7 +2820,7 @@ DynamicModel::writeBlockDriverOutput(ostream &output, const string &basename, co } void -DynamicModel::writeOutput(ostream &output, const string &basename, bool block_decomposition, bool linear_decomposition, bool byte_code, bool use_dll, bool estimation_present, bool compute_xrefs, bool julia) const +DynamicModel::writeOutput(ostream &output, const string &basename, bool block_decomposition, bool linear_decomposition, bool use_dll, bool estimation_present, bool compute_xrefs, bool julia) const { /* Writing initialisation for M_.lead_lag_incidence matrix M_.lead_lag_incidence is a matrix with as many columns as there are diff --git a/src/DynamicModel.hh b/src/DynamicModel.hh index c8035852e7a9a91e688ba00adb72e9691f9ddb31..885cbbcf80ffb2e33f692b9635bc4033e3c1d474 100644 --- a/src/DynamicModel.hh +++ b/src/DynamicModel.hh @@ -291,7 +291,7 @@ public: void computingPass(bool jacobianExo, int derivsOrder, int paramsDerivsOrder, const eval_context_t &eval_context, bool no_tmp_terms, bool block, bool use_dll, bool bytecode, bool linear_decomposition); //! Writes model initialization and lead/lag incidence matrix to output - void writeOutput(ostream &output, const string &basename, bool block, bool linear_decomposition, bool byte_code, bool use_dll, bool estimation_present, bool compute_xrefs, bool julia) const; + void writeOutput(ostream &output, const string &basename, bool block, bool linear_decomposition, bool use_dll, bool estimation_present, bool compute_xrefs, bool julia) const; //! Write JSON AST void writeJsonAST(ostream &output) const; diff --git a/src/DynareBison.yy b/src/DynareBison.yy index c8294fbba535d74b06629ddf0e90b8bdb226625f..78a087d93405647dcf8ac599e2fb147ef1fa788f 100644 --- a/src/DynareBison.yy +++ b/src/DynareBison.yy @@ -931,7 +931,7 @@ compilation_setup_option : SUBSTITUTE_FLAGS EQUAL QUOTED_STRING model_options : BLOCK { driver.block(); } | o_cutoff | o_mfs - | BYTECODE { driver.byte_code(); } + | BYTECODE { driver.bytecode(); } | USE_DLL { driver.use_dll(); } | NO_STATIC { driver.no_static();} | DIFFERENTIATE_FORWARD_VARS { driver.differentiate_forward_vars_all(); } diff --git a/src/ModFile.cc b/src/ModFile.cc index 049ac4563719100894ef8d5731fb7f3b96a4031b..e36d473dd67198fb755e90a597ef23b1bc620eb6 100644 --- a/src/ModFile.cc +++ b/src/ModFile.cc @@ -181,13 +181,13 @@ ModFile::checkPass(bool nostrict, bool stochastic) exit(EXIT_FAILURE); } - if (mod_file_struct.k_order_solver && byte_code) + if (mod_file_struct.k_order_solver && bytecode) { cerr << "ERROR: 'k_order_solver' (which is implicit if order >= 3), is not yet compatible with 'bytecode'." << endl; exit(EXIT_FAILURE); } - if (use_dll && (block || byte_code || linear_decomposition)) + if (use_dll && (block || bytecode || linear_decomposition)) { cerr << "ERROR: In 'model' block, 'use_dll' option is not compatible with 'block', 'bytecode' or 'linear_decomposition'" << endl; exit(EXIT_FAILURE); @@ -198,13 +198,13 @@ ModFile::checkPass(bool nostrict, bool stochastic) exit(EXIT_FAILURE); } - if (!byte_code && linear_decomposition) + if (!bytecode && linear_decomposition) { cerr << "ERROR: For the moment in 'model' block, 'linear_decomposition' option is compatible only with 'bytecode' option" << endl; exit(EXIT_FAILURE); } - if ((block || byte_code) && dynamic_model.isModelLocalVariableUsed()) + if ((block || bytecode) && dynamic_model.isModelLocalVariableUsed()) { cerr << "ERROR: In 'model' block, 'block' or 'bytecode' options are not yet compatible with pound expressions" << endl; exit(EXIT_FAILURE); @@ -739,7 +739,7 @@ ModFile::computingPass(bool no_tmp_terms, FileOutputType output, int params_deri { non_linear_equations_dynamic_model = dynamic_model; non_linear_equations_dynamic_model.set_cutoff_to_zero(); - non_linear_equations_dynamic_model.computingPass(true, 1, 0, global_eval_context, no_tmp_terms, block, use_dll, byte_code, linear_decomposition); + non_linear_equations_dynamic_model.computingPass(true, 1, 0, global_eval_context, no_tmp_terms, block, use_dll, bytecode, linear_decomposition); } if (!no_static) { @@ -756,7 +756,7 @@ ModFile::computingPass(bool no_tmp_terms, FileOutputType output, int params_deri derivsOrder = 2; paramsDerivsOrder = params_derivs_order; } - static_model.computingPass(derivsOrder, paramsDerivsOrder, global_eval_context, no_tmp_terms, block, byte_code); + static_model.computingPass(derivsOrder, paramsDerivsOrder, global_eval_context, no_tmp_terms, block, bytecode); } // Set things to compute for dynamic model if (mod_file_struct.perfect_foresight_solver_present || mod_file_struct.check_present @@ -766,7 +766,7 @@ ModFile::computingPass(bool no_tmp_terms, FileOutputType output, int params_deri || mod_file_struct.calib_smoother_present) { if (mod_file_struct.perfect_foresight_solver_present) - dynamic_model.computingPass(true, 1, 0, global_eval_context, no_tmp_terms, block, use_dll, byte_code, linear_decomposition); + dynamic_model.computingPass(true, 1, 0, global_eval_context, no_tmp_terms, block, use_dll, bytecode, linear_decomposition); else { if (mod_file_struct.stoch_simul_present @@ -788,13 +788,13 @@ ModFile::computingPass(bool no_tmp_terms, FileOutputType output, int params_deri int paramsDerivsOrder = 0; if (mod_file_struct.identification_present || mod_file_struct.estimation_analytic_derivation) paramsDerivsOrder = params_derivs_order; - dynamic_model.computingPass(true, derivsOrder, paramsDerivsOrder, global_eval_context, no_tmp_terms, block, use_dll, byte_code, linear_decomposition); + dynamic_model.computingPass(true, derivsOrder, paramsDerivsOrder, global_eval_context, no_tmp_terms, block, use_dll, bytecode, linear_decomposition); if (linear && mod_file_struct.ramsey_model_present) - orig_ramsey_dynamic_model.computingPass(true, 2, paramsDerivsOrder, global_eval_context, no_tmp_terms, block, use_dll, byte_code, linear_decomposition); + orig_ramsey_dynamic_model.computingPass(true, 2, paramsDerivsOrder, global_eval_context, no_tmp_terms, block, use_dll, bytecode, linear_decomposition); } } else // No computing task requested, compute derivatives up to 2nd order by default - dynamic_model.computingPass(true, 2, 0, global_eval_context, no_tmp_terms, block, use_dll, byte_code, linear_decomposition); + dynamic_model.computingPass(true, 2, 0, global_eval_context, no_tmp_terms, block, use_dll, bytecode, linear_decomposition); /* Check that the model is linear. FIXME: this check always passes if derivsOrder = 1, i.e. for a perfect @@ -976,7 +976,7 @@ ModFile::writeOutputFiles(const string &basename, bool clear_all, bool clear_glo mOutputFile << "options_.linear = " << to_matlab_logical(linear) << ";" << endl << "options_.block = " << to_matlab_logical(block) << ";" << endl - << "options_.bytecode = " << to_matlab_logical(byte_code) << ";" << endl + << "options_.bytecode = " << to_matlab_logical(bytecode) << ";" << endl << "options_.use_dll = " << to_matlab_logical(use_dll) << ";" << endl << "options_.linear_decomposition = " << to_matlab_logical(linear_decomposition) << ";" << endl; @@ -1006,7 +1006,7 @@ ModFile::writeOutputFiles(const string &basename, bool clear_all, bool clear_glo if (!onlymodel) config_file.writeCluster(mOutputFile); - if (byte_code) + if (bytecode) mOutputFile << "if exist('bytecode') ~= 3" << endl << " error('DYNARE: Can''t find bytecode DLL. Please compile it or remove the ''bytecode'' option.')" << endl << "end" << endl; @@ -1021,8 +1021,8 @@ ModFile::writeOutputFiles(const string &basename, bool clear_all, bool clear_glo if (dynamic_model.equation_number() > 0) { if (linear_decomposition) - non_linear_equations_dynamic_model.writeOutput(mOutputFile, basename, block, true, byte_code, use_dll, mod_file_struct.estimation_present, compute_xrefs, false); - dynamic_model.writeOutput(mOutputFile, basename, block, false, byte_code, use_dll, mod_file_struct.estimation_present, compute_xrefs, false); + non_linear_equations_dynamic_model.writeOutput(mOutputFile, basename, block, true, use_dll, mod_file_struct.estimation_present, compute_xrefs, false); + dynamic_model.writeOutput(mOutputFile, basename, block, false, use_dll, mod_file_struct.estimation_present, compute_xrefs, false); if (!no_static) static_model.writeOutput(mOutputFile, block); } @@ -1128,17 +1128,17 @@ ModFile::writeOutputFiles(const string &basename, bool clear_all, bool clear_glo { if (!no_static) { - static_model.writeStaticFile(basename, block, byte_code, use_dll, mexext, matlabroot, dynareroot, false); + static_model.writeStaticFile(basename, block, bytecode, use_dll, mexext, matlabroot, dynareroot, false); static_model.writeParamsDerivativesFile(basename, false); } if (linear_decomposition) { - non_linear_equations_dynamic_model.writeDynamicFile(basename, block, linear_decomposition, byte_code, use_dll, mexext, matlabroot, dynareroot, false); + non_linear_equations_dynamic_model.writeDynamicFile(basename, block, linear_decomposition, bytecode, use_dll, mexext, matlabroot, dynareroot, false); non_linear_equations_dynamic_model.writeParamsDerivativesFile(basename, false); } - dynamic_model.writeDynamicFile(basename, block, false, byte_code, use_dll, mexext, matlabroot, dynareroot, false); + dynamic_model.writeDynamicFile(basename, block, false, bytecode, use_dll, mexext, matlabroot, dynareroot, false); dynamic_model.writeParamsDerivativesFile(basename, false); @@ -1252,14 +1252,14 @@ ModFile::writeExternalFilesJulia(const string &basename) const if (dynamic_model.equation_number() > 0) { - dynamic_model.writeOutput(jlOutputFile, basename, false, false, false, false, + dynamic_model.writeOutput(jlOutputFile, basename, false, false, false, mod_file_struct.estimation_present, false, true); if (!no_static) { static_model.writeStaticFile(basename, false, false, false, "", {}, {}, true); static_model.writeParamsDerivativesFile(basename, true); } - dynamic_model.writeDynamicFile(basename, block, linear_decomposition, byte_code, use_dll, + dynamic_model.writeDynamicFile(basename, block, linear_decomposition, bytecode, use_dll, "", {}, {}, true); dynamic_model.writeParamsDerivativesFile(basename, true); } diff --git a/src/ModFile.hh b/src/ModFile.hh index 0ff5223f325d01470eaadb293db55546a0ae7753..16a3b3d2624d659f9cf80214d7c3ceab4ce6708e 100644 --- a/src/ModFile.hh +++ b/src/ModFile.hh @@ -1,5 +1,5 @@ /* - * Copyright © 2006-2019 Dynare Team + * Copyright © 2006-2020 Dynare Team * * This file is part of Dynare. * @@ -82,8 +82,8 @@ public: //! Is the model block decomposed? bool block{false}; - //! Is the model stored in bytecode format (byte_code=true) or in a M-file (byte_code=false) - bool byte_code{false}; + //! Is the model stored in bytecode format (bytecode=true) or in a M-file (bytecode=false) + bool bytecode{false}; //! Is the model stored in a MEX file ? (option "use_dll" of "model") bool use_dll{false}; diff --git a/src/ParsingDriver.cc b/src/ParsingDriver.cc index a1df034f67309e08ffd6d71a5efe5b4dfb25a2d6..1165ec40277b73e0f63e0f388eacc64e5fcaa863 100644 --- a/src/ParsingDriver.cc +++ b/src/ParsingDriver.cc @@ -760,9 +760,9 @@ ParsingDriver::no_static() } void -ParsingDriver::byte_code() +ParsingDriver::bytecode() { - mod_file->byte_code = true; + mod_file->bytecode = true; } void diff --git a/src/ParsingDriver.hh b/src/ParsingDriver.hh index fa8a97368ad5a026f99d420837df2050446805f3..58818be232eacafb78465e1861a24425e8703183 100644 --- a/src/ParsingDriver.hh +++ b/src/ParsingDriver.hh @@ -351,7 +351,7 @@ public: void linear_decomposition(); //! the model is stored in a binary file - void byte_code(); + void bytecode(); //! the static model is not computed void no_static(); //! the differentiate_forward_vars option is enabled (for all vars)