From 4d99ea5e8243bde611db47b74f30d115e350811b Mon Sep 17 00:00:00 2001 From: Martin Kroeker Date: Wed, 2 Dec 2026 19:42:50 +0100 Subject: [PATCH] Treat NaN in a leading principal minor like a non-positive result (and factorization failure) --- lapack/potf2/potf2_L.c | 2 +- lapack/potf2/potf2_U.c | 2 +- lapack/potf2/zpotf2_L.c | 2 +- lapack/potf2/zpotf2_U.c | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/lapack/potf2/potf2_L.c b/lapack/potf2/potf2_L.c index 8cd094ac20..dde32c587b 100644 --- a/lapack/potf2/potf2_L.c +++ b/lapack/potf2/potf2_L.c @@ -71,7 +71,7 @@ blasint CNAME(blas_arg_t *args, BLASLONG *range_m, BLASLONG *range_n, FLOAT *sa, ajj = *(aoffset + j) - DOTU_K(j, a + j, lda, a + j, lda); - if (ajj <= 0){ + if (ajj <= 0|| ajj!=ajj){ *(aoffset + j) = ajj; return j + 1; } diff --git a/lapack/potf2/potf2_U.c b/lapack/potf2/potf2_U.c index 9f908c14cc..9bfea43976 100644 --- a/lapack/potf2/potf2_U.c +++ b/lapack/potf2/potf2_U.c @@ -68,7 +68,7 @@ blasint CNAME(blas_arg_t *args, BLASLONG *range_m, BLASLONG *range_n, FLOAT *sa, ajj = *(a + j) - DOTU_K(j, a, 1, a, 1); - if (ajj <= 0){ + if (ajj <= 0|| ajj!=ajj){ *(a + j) = ajj; return j + 1; } diff --git a/lapack/potf2/zpotf2_L.c b/lapack/potf2/zpotf2_L.c index d265c5d884..dbf3ff23f6 100644 --- a/lapack/potf2/zpotf2_L.c +++ b/lapack/potf2/zpotf2_L.c @@ -72,7 +72,7 @@ blasint CNAME(blas_arg_t *args, BLASLONG *range_m, BLASLONG *range_n, FLOAT *sa, ajj = *(aoffset + j * 2) - ajj; - if (ajj <= 0){ + if (ajj <= 0|| ajj!=ajj){ *(aoffset + j * 2 + 0) = ajj; *(aoffset + j * 2 + 1) = ZERO; return j + 1; diff --git a/lapack/potf2/zpotf2_U.c b/lapack/potf2/zpotf2_U.c index 594a90ad3f..c8792eef28 100644 --- a/lapack/potf2/zpotf2_U.c +++ b/lapack/potf2/zpotf2_U.c @@ -69,7 +69,7 @@ blasint CNAME(blas_arg_t *args, BLASLONG *range_m, BLASLONG *range_n, FLOAT *sa, ajj = *(a + j * 2) - ajj; - if (ajj <= 0){ + if (ajj <= 0||ajj!=ajj){ *(a + j * 2 + 0) = ajj; *(a + j * 2 + 1) = ZERO; return j + 1;