Split test condition in LU computation - non-denormal for computation, exact zero for reporting singularity

This commit is contained in:
Martin Kroeker 2023-03-29 22:14:21 +02:00 committed by GitHub
parent 23f2c4ca5b
commit 6c431239da
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 37 additions and 28 deletions

View File

@ -100,8 +100,12 @@ blasint CNAME(blas_arg_t *args, BLASLONG *range_m, BLASLONG *range_n, FLOAT *sa,
jp--;
temp1 = *(b + jp);
//if (temp1 != ZERO) {
if (temp1 != ZERO) {
#if defined(DOUBLE)
if (fabs(temp1) >= DBL_MIN ) {
#else
if (fabs(temp1) >= FLT_MIN ) {
#endif
temp1 = dp1 / temp1;
if (jp != j) {
@ -110,6 +114,7 @@ blasint CNAME(blas_arg_t *args, BLASLONG *range_m, BLASLONG *range_n, FLOAT *sa,
if (j + 1 < m) {
SCAL_K(m - j - 1, 0, 0, temp1, b + j + 1, 1, NULL, 0, NULL, 0);
}
}
} else {
if (!info) info = j + 1;
}

View File

@ -106,9 +106,12 @@ blasint CNAME(blas_arg_t *args, BLASLONG *range_m, BLASLONG *range_n, FLOAT *sa,
temp1 = *(b + jp * 2 + 0);
temp2 = *(b + jp * 2 + 1);
// if ((temp1 != ZERO) || (temp2 != ZERO)) {
if ((temp1 != ZERO) || (temp2 != ZERO)) {
#if defined(DOUBLE)
if ((fabs(temp1) >= DBL_MIN) || (fabs(temp2) >= DBL_MIN)) {
#else
if ((fabs(temp1) >= FLT_MIN) || (fabs(temp2) >= FLT_MIN)) {
#endif
if (jp != j) {
SWAP_K(j + 1, 0, 0, ZERO, ZERO, a + j * 2, lda,
a + jp * 2, lda, NULL, 0);
@ -130,6 +133,7 @@ blasint CNAME(blas_arg_t *args, BLASLONG *range_m, BLASLONG *range_n, FLOAT *sa,
SCAL_K(m - j - 1, 0, 0, temp3, temp4,
b + (j + 1) * 2, 1, NULL, 0, NULL, 0);
}
}
} else {
if (!info) info = j + 1;
}