From 704b0c965916b7ee3b1ae03fbd0f7fc46d473832 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?St=C3=A9phane=20Adjemian=20=28Charybdis=29?=
 <stephane.adjemian@univ-lemans.fr>
Date: Sat, 4 Feb 2012 16:26:22 +0100
Subject: [PATCH] Added an option specifying if the bytecode solver has to be
 used first.

---
 matlab/ep/extended_path.m      | 15 +++++++++++++--
 matlab/global_initialization.m |  2 ++
 2 files changed, 15 insertions(+), 2 deletions(-)

diff --git a/matlab/ep/extended_path.m b/matlab/ep/extended_path.m
index bec06dc1d7..1e07356429 100644
--- a/matlab/ep/extended_path.m
+++ b/matlab/ep/extended_path.m
@@ -120,6 +120,9 @@ if options_.ep.set_dynare_seed_to_default
     set_dynare_seed('default');
 end
 
+% Set bytecode flag
+bytecode_flag = options_.ep.use_bytecode;
+
 % Simulate shocks.
 switch options_.ep.innovation_distribution
   case 'gaussian'
@@ -223,7 +226,11 @@ while (t<sample_size)
         endo_simul = oo_.endo_simul;
         while 1
             if ~increase_periods
-                [flag,tmp] = bytecode('dynamic');
+                if bytecode_flag
+                    [flag,tmp] = bytecode('dynamic');
+                else
+                    flag = 1;
+                end
                 if flag
                     [flag,tmp] = solve_perfect_foresight_model(oo_.endo_simul,oo_.exo_simul,pfm);
                 end
@@ -292,7 +299,11 @@ while (t<sample_size)
                     oo_.exo_simul  = [ oo_.exo_simul ; zeros(options_.ep.step,size(shocks,2)) ];
                 end
                 % Solve the perfect foresight model with an increased number of periods.
-                [flag,tmp] = bytecode('dynamic');
+                if bytecode_flag
+                    [flag,tmp] = bytecode('dynamic');
+                else
+                    flag = 1;
+                end
                 if flag
                     [flag,tmp] = solve_perfect_foresight_model(oo_.endo_simul,oo_.exo_simul,pfm);
                 end
diff --git a/matlab/global_initialization.m b/matlab/global_initialization.m
index 3ae136f2c6..3b7417935b 100644
--- a/matlab/global_initialization.m
+++ b/matlab/global_initialization.m
@@ -115,6 +115,8 @@ ep.debug = 0;
 ep.memory = 0;
 % Set verbose mode
 ep.verbosity = 0;
+% Set bytecode flag
+ep.use_bytecode = 1;
 % Initialization of the perfect foresight equilibrium paths
 % * init=0, previous solution is used.  
 % * init=1, a path generated with the first order reduced form is used.
-- 
GitLab