Skip to content
Snippets Groups Projects
Commit 489b7780 authored by MichelJuillard's avatar MichelJuillard
Browse files

put orig_eq_nbr and ramsey_eq_nbr in mod_file_struct

parent 4419b9e9
No related branches found
No related tags found
No related merge requests found
...@@ -39,8 +39,7 @@ ModFile::ModFile(WarningConsolidation &warnings_arg) ...@@ -39,8 +39,7 @@ ModFile::ModFile(WarningConsolidation &warnings_arg)
static_model(symbol_table, num_constants, external_functions_table), static_model(symbol_table, num_constants, external_functions_table),
steady_state_model(symbol_table, num_constants, external_functions_table, static_model), steady_state_model(symbol_table, num_constants, external_functions_table, static_model),
linear(false), block(false), byte_code(false), use_dll(false), no_static(false), linear(false), block(false), byte_code(false), use_dll(false), no_static(false),
differentiate_forward_vars(false), differentiate_forward_vars(false), nonstationary_variables(false),
nonstationary_variables(false), orig_eqn_nbr(0), ramsey_eqn_nbr(0),
param_used_with_lead_lag(false), warnings(warnings_arg) param_used_with_lead_lag(false), warnings(warnings_arg)
{ {
} }
...@@ -345,7 +344,7 @@ ModFile::transformPass(bool nostrict) ...@@ -345,7 +344,7 @@ ModFile::transformPass(bool nostrict)
dynamic_model.removeTrendVariableFromEquations(); dynamic_model.removeTrendVariableFromEquations();
} }
orig_eqn_nbr = dynamic_model.equation_number(); mod_file_struct.orig_eq_nbr = dynamic_model.equation_number();
if (mod_file_struct.ramsey_model_present) if (mod_file_struct.ramsey_model_present)
{ {
StaticModel *planner_objective = NULL; StaticModel *planner_objective = NULL;
...@@ -364,7 +363,7 @@ ModFile::transformPass(bool nostrict) ...@@ -364,7 +363,7 @@ ModFile::transformPass(bool nostrict)
dynamic_model.cloneDynamic(ramsey_FOC_equations_dynamic_model); dynamic_model.cloneDynamic(ramsey_FOC_equations_dynamic_model);
ramsey_FOC_equations_dynamic_model.computeRamseyPolicyFOCs(*planner_objective); ramsey_FOC_equations_dynamic_model.computeRamseyPolicyFOCs(*planner_objective);
ramsey_FOC_equations_dynamic_model.replaceMyEquations(dynamic_model); ramsey_FOC_equations_dynamic_model.replaceMyEquations(dynamic_model);
ramsey_eqn_nbr = dynamic_model.equation_number() - orig_eqn_nbr; mod_file_struct.ramsey_eq_nbr = dynamic_model.equation_number() - mod_file_struct.orig_eq_nbr;
} }
if (mod_file_struct.stoch_simul_present if (mod_file_struct.stoch_simul_present
...@@ -446,7 +445,7 @@ ModFile::transformPass(bool nostrict) ...@@ -446,7 +445,7 @@ ModFile::transformPass(bool nostrict)
cout << "Found " << dynamic_model.equation_number() << " equation(s)." << endl; cout << "Found " << dynamic_model.equation_number() << " equation(s)." << endl;
else else
{ {
cout << "Found " << orig_eqn_nbr << " equation(s)." << endl; cout << "Found " << mod_file_struct.orig_eq_nbr << " equation(s)." << endl;
cout << "Found " << dynamic_model.equation_number() << " FOC equation(s) for Ramsey Problem." << endl; cout << "Found " << dynamic_model.equation_number() << " FOC equation(s) for Ramsey Problem." << endl;
} }
...@@ -748,9 +747,9 @@ ModFile::writeOutputFiles(const string &basename, bool clear_all, bool clear_glo ...@@ -748,9 +747,9 @@ ModFile::writeOutputFiles(const string &basename, bool clear_all, bool clear_glo
if (block && !byte_code) if (block && !byte_code)
mOutputFile << "addpath " << basename << ";" << endl; mOutputFile << "addpath " << basename << ";" << endl;
mOutputFile << "M_.orig_eq_nbr = " << orig_eqn_nbr << ";" << endl mOutputFile << "M_.orig_eq_nbr = " << mod_file_struct.orig_eq_nbr << ";" << endl
<< "M_.eq_nbr = " << dynamic_model.equation_number() << ";" << endl << "M_.eq_nbr = " << dynamic_model.equation_number() << ";" << endl
<< "M_.ramsey_eq_nbr = " << ramsey_eqn_nbr << ";" << endl; << "M_.ramsey_eq_nbr = " << mod_file_struct.ramsey_eq_nbr << ";" << endl;
if (dynamic_model.equation_number() > 0) if (dynamic_model.equation_number() > 0)
{ {
...@@ -1133,9 +1132,9 @@ ModFile::writeExternalFilesJulia(const string &basename, FileOutputType output) ...@@ -1133,9 +1132,9 @@ ModFile::writeExternalFilesJulia(const string &basename, FileOutputType output)
<< symbol_table.exo_nbr() << ")" << endl << symbol_table.exo_nbr() << ")" << endl
<< "model.correlation_matrix = ones(Float64, " << symbol_table.exo_nbr() << ", " << "model.correlation_matrix = ones(Float64, " << symbol_table.exo_nbr() << ", "
<< symbol_table.exo_nbr() << ")" << endl << symbol_table.exo_nbr() << ")" << endl
<< "model.orig_eq_nbr = " << orig_eqn_nbr << endl << "model.orig_eq_nbr = " << mod_file_struct.orig_eq_nbr << endl
<< "model.eq_nbr = " << dynamic_model.equation_number() << endl << "model.eq_nbr = " << dynamic_model.equation_number() << endl
<< "model.ramsey_eq_nbr = " << ramsey_eqn_nbr << endl; << "model.ramsey_eq_nbr = " << mod_file_struct.ramsey_eq_nbr << endl;
if (mod_file_struct.calibrated_measurement_errors) if (mod_file_struct.calibrated_measurement_errors)
jlOutputFile << "model.h = zeros(Float64," jlOutputFile << "model.h = zeros(Float64,"
......
...@@ -101,12 +101,6 @@ public: ...@@ -101,12 +101,6 @@ public:
/*! Filled using initval blocks and parameters initializations */ /*! Filled using initval blocks and parameters initializations */
eval_context_t global_eval_context; eval_context_t global_eval_context;
//! Stores the original number of equations in the model_block
int orig_eqn_nbr;
//! Stores the number of equations added to the Ramsey model
int ramsey_eqn_nbr;
//! Parameter used with lead/lag //! Parameter used with lead/lag
bool param_used_with_lead_lag; bool param_used_with_lead_lag;
......
...@@ -91,7 +91,7 @@ public: ...@@ -91,7 +91,7 @@ public:
bool bayesian_irf_present; bool bayesian_irf_present;
//! Whether there is a data statement present //! Whether there is a data statement present
bool estimation_data_statement_present; bool estimation_data_statement_present;
//! Last chain number for Markov Switching statement //! Last chain number for Markov Switching statement2
int last_markov_switching_chain; int last_markov_switching_chain;
//! Whether a calib_smoother statement is present //! Whether a calib_smoother statement is present
bool calib_smoother_present; bool calib_smoother_present;
...@@ -118,6 +118,11 @@ public: ...@@ -118,6 +118,11 @@ public:
bool ms_dsge_present; bool ms_dsge_present;
//! Whether occbin is present //! Whether occbin is present
bool occbin_option; bool occbin_option;
//! Stores the original number of equations in the model_block
int orig_eq_nbr;
//! Stores the number of equations added to the Ramsey model
int ramsey_eq_nbr;
}; };
class Statement class Statement
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment