From 09541f10ef3abf64d88f6d5b2c68f0f10c25fcc0 Mon Sep 17 00:00:00 2001 From: Houtan Bastani Date: Wed, 19 Aug 2015 10:59:30 +0200 Subject: [PATCH] load steady_state! function into model.steady_state --- preprocessor/ModFile.cc | 4 +++- preprocessor/SteadyStateModel.cc | 5 ++++- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/preprocessor/ModFile.cc b/preprocessor/ModFile.cc index addd10c32..b575512ef 100644 --- a/preprocessor/ModFile.cc +++ b/preprocessor/ModFile.cc @@ -1086,7 +1086,8 @@ ModFile::writeExternalFilesJulia(const string &basename, FileOutputType output) << "using DynareOutput" << endl << "using Utils" << endl << "using " << basename << "Static" << endl - << "using " << basename << "Dynamic" << endl << endl + << "using " << basename << "Dynamic" << endl + << "using " << basename << "SteadyState2" << endl << endl << "export model" << endl; // Write Output @@ -1146,6 +1147,7 @@ ModFile::writeExternalFilesJulia(const string &basename, FileOutputType output) jlOutputFile << "model.static = " << basename << "Static.getStaticFunction()" << endl << "model.dynamic = " << basename << "Dynamic.getDynamicFunction()" << endl + << "model.steady_state = " << basename << "SteadyState2.getSteadyStateFunction()" << endl << "try" << endl << " using " << basename << "StaticParamsDerivs" << endl << " model.static_params_derivs = " << basename diff --git a/preprocessor/SteadyStateModel.cc b/preprocessor/SteadyStateModel.cc index f340fc422..9dfbc22d9 100644 --- a/preprocessor/SteadyStateModel.cc +++ b/preprocessor/SteadyStateModel.cc @@ -128,7 +128,10 @@ SteadyStateModel::writeSteadyStateFile(const string &basename, bool ramsey_model << " info = 0;" << endl; else output << "module " << basename << "SteadyState2" << endl << endl - << "export steady_state!" << endl << endl + << "export getSteadyStateFunction" << endl << endl + << "function getSteadyStateFunction()" << endl + << " steady_state!" << endl + << "end" << endl << endl << "function steady_state!(ys_, exo_, params)" << endl; for (size_t i = 0; i < def_table.size(); i++)