From aa0af5e5563803e534e59d90a759194fdd88a76b Mon Sep 17 00:00:00 2001
From: Houtan Bastani <houtan@dynare.org>
Date: Tue, 19 Nov 2013 11:53:00 +0100
Subject: [PATCH] proprocessor: block code bug fix: M and oo not being passed
 to solve_two_boundaries

---
 matlab/solve_two_boundaries.m | 2 ++
 preprocessor/DynamicModel.cc  | 2 +-
 2 files changed, 3 insertions(+), 1 deletion(-)

diff --git a/matlab/solve_two_boundaries.m b/matlab/solve_two_boundaries.m
index 5883a89065..099aa6b62c 100644
--- a/matlab/solve_two_boundaries.m
+++ b/matlab/solve_two_boundaries.m
@@ -32,6 +32,8 @@ function y = solve_two_boundaries(fname, y, x, params, steady_state, y_index, nz
 %                                            - 2 GMRES
 %                                            - 3 BicGStab
 %                                            - 4 Optimal path length
+%   M                   [structure]     Model description
+%   oo                  [structure]     Results
 %
 % OUTPUTS
 %   y                   [matrix]        All endogenous variables of the model      
diff --git a/preprocessor/DynamicModel.cc b/preprocessor/DynamicModel.cc
index 61f60f35f9..2252db981b 100644
--- a/preprocessor/DynamicModel.cc
+++ b/preprocessor/DynamicModel.cc
@@ -2054,7 +2054,7 @@ DynamicModel::writeSparseDynamicMFile(const string &dynamic_basename, const stri
                             <<", options_.periods, " << max_leadlag_block[block].first
                             <<", " << max_leadlag_block[block].second
                             <<", " << blocks_linear[block]
-                            <<", blck_num, y_kmin, options_.simul.maxit, options_.solve_tolf, options_.slowc, " << cutoff << ", options_.stack_solve_algo);\n";
+                            <<", blck_num, y_kmin, options_.simul.maxit, options_.solve_tolf, options_.slowc, " << cutoff << ", options_.stack_solve_algo, M_, oo_);\n";
           mDynamicModelFile << "  tmp = y(:,M_.block_structure.block(" << block + 1 << ").variable);\n";
           mDynamicModelFile << "  if any(isnan(tmp) | isinf(tmp))\n";
           mDynamicModelFile << "    disp(['Inf or Nan value during the resolution of block " << block <<"']);\n";
-- 
GitLab