rename model__ to model
parent
ba8518bf43
commit
601a52a093
38
ModFile.cc
38
ModFile.cc
|
@ -1086,31 +1086,31 @@ ModFile::writeExternalFilesJulia(const string &basename, FileOutputType output)
|
||||||
<< "using Utils" << endl
|
<< "using Utils" << endl
|
||||||
<< "using " << basename << "Static" << endl
|
<< "using " << basename << "Static" << endl
|
||||||
<< "using " << basename << "Dynamic" << endl << endl
|
<< "using " << basename << "Dynamic" << endl << endl
|
||||||
<< "export model__" << endl << endl
|
<< "export model" << endl << endl
|
||||||
<< "options = dynare_options()" << endl
|
<< "options = dynare_options()" << endl
|
||||||
<< "options.dynare_version = \"" << PACKAGE_VERSION << "\"" << endl << endl
|
<< "options.dynare_version = \"" << PACKAGE_VERSION << "\"" << endl << endl
|
||||||
<< "model__ = model()" << endl
|
<< "model = dynare_model()" << endl
|
||||||
<< "model__.fname = \"" << basename << "\"" << endl
|
<< "model.fname = \"" << basename << "\"" << endl
|
||||||
<< "model__.dynare_version = \"" << PACKAGE_VERSION << "\"" << endl
|
<< "model.dynare_version = \"" << PACKAGE_VERSION << "\"" << endl
|
||||||
<< "model__.sigma_e = zeros(Float64, " << symbol_table.exo_nbr() << ", "
|
<< "model.sigma_e = zeros(Float64, " << symbol_table.exo_nbr() << ", "
|
||||||
<< symbol_table.exo_nbr() << ")" << endl
|
<< symbol_table.exo_nbr() << ")" << endl
|
||||||
<< "model__.sigma_e_is_diagonal = 1;" << endl
|
<< "model.sigma_e_is_diagonal = 1;" << 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 = " << orig_eqn_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 = " << ramsey_eqn_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,"
|
||||||
<< symbol_table.observedVariablesNbr() << ", "
|
<< symbol_table.observedVariablesNbr() << ", "
|
||||||
<< symbol_table.observedVariablesNbr() << ");" << endl
|
<< symbol_table.observedVariablesNbr() << ");" << endl
|
||||||
<< "model__.correlation_matrix_me = ones(Float64, "
|
<< "model.correlation_matrix_me = ones(Float64, "
|
||||||
<< symbol_table.observedVariablesNbr() << ", "
|
<< symbol_table.observedVariablesNbr() << ", "
|
||||||
<< symbol_table.observedVariablesNbr() << ");" << endl;
|
<< symbol_table.observedVariablesNbr() << ");" << endl;
|
||||||
else
|
else
|
||||||
jlOutputFile << "model__.h = zeros(Float64, 1, 1)" << endl
|
jlOutputFile << "model.h = zeros(Float64, 1, 1)" << endl
|
||||||
<< "model__.correlation_matrix_me = ones(Float64, 1, 1)" << endl;
|
<< "model.correlation_matrix_me = ones(Float64, 1, 1)" << endl;
|
||||||
|
|
||||||
cout << "Processing outputs ..." << endl;
|
cout << "Processing outputs ..." << endl;
|
||||||
symbol_table.writeJuliaOutput(jlOutputFile);
|
symbol_table.writeJuliaOutput(jlOutputFile);
|
||||||
|
@ -1128,23 +1128,23 @@ ModFile::writeExternalFilesJulia(const string &basename, FileOutputType output)
|
||||||
}
|
}
|
||||||
steady_state_model.writeSteadyStateFile(basename, mod_file_struct.ramsey_model_present, true);
|
steady_state_model.writeSteadyStateFile(basename, mod_file_struct.ramsey_model_present, true);
|
||||||
|
|
||||||
jlOutputFile << "model__.static = " << basename << "Static.getStaticFunction()" << endl
|
jlOutputFile << "model.static = " << basename << "Static.getStaticFunction()" << endl
|
||||||
<< "model__.dynamic = " << basename << "Dynamic.getDynamicFunction()" << endl
|
<< "model.dynamic = " << basename << "Dynamic.getDynamicFunction()" << endl
|
||||||
<< "try" << endl
|
<< "try" << endl
|
||||||
<< " using " << basename << "StaticParamsDerivs" << endl
|
<< " using " << basename << "StaticParamsDerivs" << endl
|
||||||
<< " model__.static_params_derivs = " << basename
|
<< " model.static_params_derivs = " << basename
|
||||||
<< "StaticParamsDerivs.params_derivs" << endl
|
<< "StaticParamsDerivs.params_derivs" << endl
|
||||||
<< "catch" << endl
|
<< "catch" << endl
|
||||||
<< "end" << endl
|
<< "end" << endl
|
||||||
<< "try" << endl
|
<< "try" << endl
|
||||||
<< " using " << basename << "DynamicParamsDerivs" << endl
|
<< " using " << basename << "DynamicParamsDerivs" << endl
|
||||||
<< " model__.dynamic_params_derivs = " << basename
|
<< " model.dynamic_params_derivs = " << basename
|
||||||
<< "DynamicParamsDerivs.params_derivs" << endl
|
<< "DynamicParamsDerivs.params_derivs" << endl
|
||||||
<< "catch" << endl
|
<< "catch" << endl
|
||||||
<< "end" << endl
|
<< "end" << endl
|
||||||
<< "try" << endl
|
<< "try" << endl
|
||||||
<< " using " << basename << "SteadyState2" << endl
|
<< " using " << basename << "SteadyState2" << endl
|
||||||
<< " model__.steady_state = " << basename << "SteadyState2.steady_state" << endl
|
<< " model.steady_state = " << basename << "SteadyState2.steady_state" << endl
|
||||||
<< "catch" << endl
|
<< "catch" << endl
|
||||||
<< "end" << endl
|
<< "end" << endl
|
||||||
<< "end" << endl;
|
<< "end" << endl;
|
||||||
|
|
|
@ -726,7 +726,7 @@ SymbolTable::writeJuliaOutput(ostream &output) const throw (NotYetFrozenExceptio
|
||||||
throw NotYetFrozenException();
|
throw NotYetFrozenException();
|
||||||
|
|
||||||
output << "# Endogenous Variables" << endl
|
output << "# Endogenous Variables" << endl
|
||||||
<< "model__.endo = [" << endl;
|
<< "model.endo = [" << endl;
|
||||||
if (endo_nbr() > 0)
|
if (endo_nbr() > 0)
|
||||||
for (int id = 0; id < endo_nbr(); id++)
|
for (int id = 0; id < endo_nbr(); id++)
|
||||||
output << " DynareModel.Endo(\""
|
output << " DynareModel.Endo(\""
|
||||||
|
@ -736,7 +736,7 @@ SymbolTable::writeJuliaOutput(ostream &output) const throw (NotYetFrozenExceptio
|
||||||
output << " ]" << endl;
|
output << " ]" << endl;
|
||||||
|
|
||||||
output << "# Exogenous Variables" << endl
|
output << "# Exogenous Variables" << endl
|
||||||
<< "model__.exo = [" << endl;
|
<< "model.exo = [" << endl;
|
||||||
if (exo_nbr() > 0)
|
if (exo_nbr() > 0)
|
||||||
for (int id = 0; id < exo_nbr(); id++)
|
for (int id = 0; id < exo_nbr(); id++)
|
||||||
output << " DynareModel.Exo(\""
|
output << " DynareModel.Exo(\""
|
||||||
|
@ -748,7 +748,7 @@ SymbolTable::writeJuliaOutput(ostream &output) const throw (NotYetFrozenExceptio
|
||||||
if (exo_det_nbr() > 0)
|
if (exo_det_nbr() > 0)
|
||||||
{
|
{
|
||||||
output << "# Exogenous Deterministic Variables" << endl
|
output << "# Exogenous Deterministic Variables" << endl
|
||||||
<< "model__.exo_det = [" << endl;
|
<< "model.exo_det = [" << endl;
|
||||||
if (exo_det_nbr() > 0)
|
if (exo_det_nbr() > 0)
|
||||||
for (int id = 0; id < exo_det_nbr(); id++)
|
for (int id = 0; id < exo_det_nbr(); id++)
|
||||||
output << " DynareModel.ExoDet(\""
|
output << " DynareModel.ExoDet(\""
|
||||||
|
@ -759,7 +759,7 @@ SymbolTable::writeJuliaOutput(ostream &output) const throw (NotYetFrozenExceptio
|
||||||
}
|
}
|
||||||
|
|
||||||
output << "# Parameters" << endl
|
output << "# Parameters" << endl
|
||||||
<< "model__.param = [" << endl;
|
<< "model.param = [" << endl;
|
||||||
if (param_nbr() > 0)
|
if (param_nbr() > 0)
|
||||||
for (int id = 0; id < param_nbr(); id++)
|
for (int id = 0; id < param_nbr(); id++)
|
||||||
output << " DynareModel.Param(\""
|
output << " DynareModel.Param(\""
|
||||||
|
@ -768,12 +768,12 @@ SymbolTable::writeJuliaOutput(ostream &output) const throw (NotYetFrozenExceptio
|
||||||
<< getLongName(param_ids[id]) << "\")" << endl;
|
<< getLongName(param_ids[id]) << "\")" << endl;
|
||||||
output << " ]" << endl;
|
output << " ]" << endl;
|
||||||
|
|
||||||
output << "model__.orig_endo_nbr = " << orig_endo_nbr() << endl;
|
output << "model.orig_endo_nbr = " << orig_endo_nbr() << endl;
|
||||||
|
|
||||||
if (aux_vars.size() > 0)
|
if (aux_vars.size() > 0)
|
||||||
for (int i = 0; i < (int) aux_vars.size(); i++)
|
for (int i = 0; i < (int) aux_vars.size(); i++)
|
||||||
{
|
{
|
||||||
output << "push!(model__.aux_vars, "
|
output << "push!(model.aux_vars, "
|
||||||
<< getTypeSpecificID(aux_vars[i].get_symb_id()) + 1 << ", "
|
<< getTypeSpecificID(aux_vars[i].get_symb_id()) + 1 << ", "
|
||||||
<< aux_vars[i].get_type() << ", ";
|
<< aux_vars[i].get_type() << ", ";
|
||||||
switch (aux_vars[i].get_type())
|
switch (aux_vars[i].get_type())
|
||||||
|
@ -804,7 +804,7 @@ SymbolTable::writeJuliaOutput(ostream &output) const throw (NotYetFrozenExceptio
|
||||||
|
|
||||||
if (predeterminedNbr() > 0)
|
if (predeterminedNbr() > 0)
|
||||||
{
|
{
|
||||||
output << "model__.pred_vars = [ ";
|
output << "model.pred_vars = [ ";
|
||||||
for (set<int>::const_iterator it = predetermined_variables.begin();
|
for (set<int>::const_iterator it = predetermined_variables.begin();
|
||||||
it != predetermined_variables.end(); it++)
|
it != predetermined_variables.end(); it++)
|
||||||
output << getTypeSpecificID(*it)+1 << "; ";
|
output << getTypeSpecificID(*it)+1 << "; ";
|
||||||
|
|
Loading…
Reference in New Issue