From 948eeb222981044da4fcb53c88abd505c2c9f9f8 Mon Sep 17 00:00:00 2001 From: Gard Spreemann Date: Thu, 30 Jul 2020 10:17:26 +0200 Subject: Add patch from SciPy for bug #966448. --- debian/patches/0003-Prevent-bound-violation.patch | 27 +++++++++++++++++++++++ debian/patches/series | 1 + 2 files changed, 28 insertions(+) create mode 100644 debian/patches/0003-Prevent-bound-violation.patch (limited to 'debian') diff --git a/debian/patches/0003-Prevent-bound-violation.patch b/debian/patches/0003-Prevent-bound-violation.patch new file mode 100644 index 0000000..04a4acc --- /dev/null +++ b/debian/patches/0003-Prevent-bound-violation.patch @@ -0,0 +1,27 @@ +From: Gard Spreemann +Date: Thu, 30 Jul 2020 10:15:21 +0200 +Subject: Prevent bound violation. + +This is based on SciPy's commits + cb9ed45d1a25d77204c737a8e1489dfb9606241f + e5ffa787555a60caf2ed9d0046a9ab782457fea4 +--- + lbfgsb.f | 3 +++ + 1 file changed, 3 insertions(+) + +diff --git a/lbfgsb.f b/lbfgsb.f +index 008370d..7c6b7fc 100644 +--- a/lbfgsb.f ++++ b/lbfgsb.f +@@ -2569,8 +2569,11 @@ c Line search is impossible. + if (stp .eq. one) then + call dcopy(n,z,1,x,1) + else ++c take step and prevent rounding error beyond bound + do 41 i = 1, n + x(i) = stp*d(i) + t(i) ++ if (nbd(i).eq.1.or.nbd(i).eq.2) x(i) = max(x(i), l(i)) ++ if (nbd(i).eq.2.or.nbd(i).eq.3) x(i) = min(x(i), u(i)) + 41 continue + endif + else diff --git a/debian/patches/series b/debian/patches/series index 6d5db6c..b3574bc 100644 --- a/debian/patches/series +++ b/debian/patches/series @@ -1,2 +1,3 @@ replace-linpack-with-lapack.patch silence.patch +0003-Prevent-bound-violation.patch -- cgit v1.2.3