From 81541d6210acd4521a9200d6ebee6fbc3de0f274 Mon Sep 17 00:00:00 2001 From: Gard Spreemann Date: Thu, 30 Jul 2020 10:26:31 +0200 Subject: Add patch from SciPy's upstream to fix NaN propagation. --- debian/patches/0004-Fix-NaN-propagation.patch | 26 ++++++++++++++++++++++++++ debian/patches/series | 1 + 2 files changed, 27 insertions(+) create mode 100644 debian/patches/0004-Fix-NaN-propagation.patch (limited to 'debian') diff --git a/debian/patches/0004-Fix-NaN-propagation.patch b/debian/patches/0004-Fix-NaN-propagation.patch new file mode 100644 index 0000000..dae12ec --- /dev/null +++ b/debian/patches/0004-Fix-NaN-propagation.patch @@ -0,0 +1,26 @@ +From: Gard Spreemann +Date: Thu, 30 Jul 2020 10:25:38 +0200 +Subject: Fix NaN propagation. + +This is based on SciPy commit + 4eb242fabeef7d1871d21936bee275be4fda1844 +--- + lbfgsb.f | 5 +++++ + 1 file changed, 5 insertions(+) + +diff --git a/lbfgsb.f b/lbfgsb.f +index 7c6b7fc..501879b 100644 +--- a/lbfgsb.f ++++ b/lbfgsb.f +@@ -2977,6 +2977,11 @@ c ************ + sbgnrm = zero + do 15 i = 1, n + gi = g(i) ++ if (gi.ne.gi) then ++c NaN value in gradient: propagate it ++ sbgnrm = gi ++ return ++ endif + if (nbd(i) .ne. 0) then + if (gi .lt. zero) then + if (nbd(i) .ge. 2) gi = max((x(i)-u(i)),gi) diff --git a/debian/patches/series b/debian/patches/series index b3574bc..ed25a9a 100644 --- a/debian/patches/series +++ b/debian/patches/series @@ -1,3 +1,4 @@ replace-linpack-with-lapack.patch silence.patch 0003-Prevent-bound-violation.patch +0004-Fix-NaN-propagation.patch -- cgit v1.2.3