From 45d1f7c5b6e912fe7fc9e4365f7c6acac88c893c Mon Sep 17 00:00:00 2001
From: Houtan Bastani <houtan@dynare.org>
Date: Wed, 29 Jul 2015 13:31:42 +0200
Subject: [PATCH] add linear option to options

---
 julia/DynareOptions.jl  |  4 +++-
 preprocessor/ModFile.cc | 12 ++++++++++--
 2 files changed, 13 insertions(+), 3 deletions(-)

diff --git a/julia/DynareOptions.jl b/julia/DynareOptions.jl
index 71ae5961ab..bdcca5c162 100644
--- a/julia/DynareOptions.jl
+++ b/julia/DynareOptions.jl
@@ -23,10 +23,12 @@ export dynare_options
 
 type Options
     dynare_version::ASCIIString
+    linear::Bool
 end
 
 function dynare_options()
-    return Options(""          # dynare_version
+    return Options("",          # dynare_version
+                   false        # linear
                   )
 end
 
diff --git a/preprocessor/ModFile.cc b/preprocessor/ModFile.cc
index 7e51a4d752..fbeb3a9037 100644
--- a/preprocessor/ModFile.cc
+++ b/preprocessor/ModFile.cc
@@ -1086,9 +1086,17 @@ ModFile::writeExternalFilesJulia(const string &basename, FileOutputType output)
                << "using Utils" << endl
                << "using " << basename << "Static" << endl
                << "using " << basename << "Dynamic" << endl << endl
-               << "export model" << endl << endl
+               << "export model" << endl;
+
+  // Write Options
+  jlOutputFile << endl
                << "options = dynare_options()" << endl
-               << "options.dynare_version = \"" << PACKAGE_VERSION << "\"" << endl << endl
+               << "options.dynare_version = \"" << PACKAGE_VERSION << "\"" << endl;
+  if (linear == 1)
+    jlOutputFile << "options.linear = true" << endl;
+
+  // Write Model
+  jlOutputFile << endl
                << "model = dynare_model()" << endl
                << "model.fname = \"" << basename << "\"" << endl
                << "model.dynare_version = \"" << PACKAGE_VERSION << "\"" << endl
-- 
GitLab