From 7d6aec268f3317f0820110b5ea7181b4ff2d2b76 Mon Sep 17 00:00:00 2001 From: ces42 Date: Tue, 30 Jul 2019 18:40:25 +0200 Subject: [PATCH] fix error in last iteration of ldl --- uncertainties/core.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/uncertainties/core.py b/uncertainties/core.py index 7a557d02..9924f00e 100644 --- a/uncertainties/core.py +++ b/uncertainties/core.py @@ -195,7 +195,7 @@ def ldl(A): a = A[i, i] l = A[i+1:, i] - if a < -EPS or (a <= 0 and abs(l).max() >= EPS): + if a < -EPS or (a <= 0 and len(l) > 0 and abs(l).max() >= EPS): raise numpy.linalg.LinAlgError('matrix must be positive ' 'semidefinite (failed on %s-th diagonal entry)' % i)