From ba214a100d7f03dda09750241c0877744893b9d9 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?S=C3=A9bastien=20Villemot?= <sebastien@dynare.org>
Date: Thu, 7 May 2020 16:51:49 +0200
Subject: [PATCH] Block decomposition: bugfix, cutoff option was ignored

Introduced in c699d57308ed766ab6b9a6f6fd690c81d0656cb4
---
 src/ModelTree.cc | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/ModelTree.cc b/src/ModelTree.cc
index dd652c79..f6b1b936 100644
--- a/src/ModelTree.cc
+++ b/src/ModelTree.cc
@@ -346,7 +346,7 @@ ModelTree::evaluateAndReduceJacobian(const eval_context_t &eval_context) const
               cerr << endl;
               exit(EXIT_FAILURE);
             }
-          if (lag == 0)
+          if ((isnan(val) || fabs(val) >= cutoff) && lag == 0)
             contemporaneous_jacobian[{ eq, var }] = val;
         }
     }
-- 
GitLab