From e3fbefc616941d0df3624bfc49a1a743171f8814 Mon Sep 17 00:00:00 2001
From: Houtan Bastani <houtan@dynare.org>
Date: Thu, 27 Oct 2016 11:18:56 +0200
Subject: [PATCH] mjdgges: fix bug where qz_criterium was not taken into
 account if a threshold argument is also passed

---
 mex/sources/mjdgges/mjdgges.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/mex/sources/mjdgges/mjdgges.c b/mex/sources/mjdgges/mjdgges.c
index 551485d355..700f769b8e 100644
--- a/mex/sources/mjdgges/mjdgges.c
+++ b/mex/sources/mjdgges/mjdgges.c
@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 2006-2012 Dynare Team
+ * Copyright (C) 2006-2016 Dynare Team
  *
  * This file is part of Dynare.
  *
@@ -127,7 +127,7 @@ mexFunction(int nlhs, mxArray *plhs[],
   b = mxGetPr(prhs[1]);
 
   /* set criterium for stable eigenvalues */
-  if (nrhs == 3 && mxGetM(prhs[2]) > 0)
+  if (nrhs >= 3 && mxGetM(prhs[2]) > 0)
     {
       criterium = *mxGetPr(prhs[2]);
     }
-- 
GitLab