-
Notifications
You must be signed in to change notification settings - Fork 441
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
rcond is 0 for NaN matrix in lapack-3.11 #763
Comments
Note that neither dgecon.f nor dgetrf.f were changed in recent years, also OpenBLAS uses its own reimplementation of GETRF. |
Thanks @martin-frbg Related past issues, comments: |
I downgraded back to lapack-3.10.1:
|
I suggest we fix the NaN issue with the patch: diff --git a/SRC/dgecon.f b/SRC/dgecon.f
index aa10dee9a..103457b3e 100644
--- a/SRC/dgecon.f
+++ b/SRC/dgecon.f
@@ -106,6 +106,7 @@
*> INFO is INTEGER
*> = 0: successful exit
*> < 0: if INFO = -i, the i-th argument had an illegal value
+*> =-5: if ANORM is NAN.
*> \endverbatim
*
* Authors:
@@ -152,10 +153,10 @@
INTEGER ISAVE( 3 )
* ..
* .. External Functions ..
- LOGICAL LSAME
+ LOGICAL LSAME, DISNAN
INTEGER IDAMAX
DOUBLE PRECISION DLAMCH
- EXTERNAL LSAME, IDAMAX, DLAMCH
+ EXTERNAL LSAME, IDAMAX, DLAMCH, DISNAN
* ..
* .. External Subroutines ..
EXTERNAL DLACN2, DLATRS, DRSCL, XERBLA
@@ -175,7 +176,7 @@
INFO = -2
ELSE IF( LDA.LT.MAX( 1, N ) ) THEN
INFO = -4
- ELSE IF( ANORM.LT.ZERO ) THEN
+ ELSE IF( ANORM.LT.ZERO .OR. DISNAN( ANORM ) ) THEN
INFO = -5
END IF
IF( INFO.NE.0 ) THEN |
Thanks for the patch, @weslleyspereira. The patch sounds great to me. This patch will fix this bug and this is the way to go. We do want these quick return when we have a NaN in input and when we compute ANORM early in the routine. So this is perfect. That being said, this patch masks the bug. We might want to know how the |
With the patch (allegedly) in Fedora's lapack-3.11.0-4 rpm I see:
Is this a desired result? The way OpenBlas propagates NaN looks better to me. |
Hi @dasergatskov, I think you are saying that, for a 2x2 matrix with 4 NaNs, you would prefer the output of DGECON to be NaN as opposed to DGECON throwing the error message What bothers me the most about this is example is that DGETRF returns INFO = 0. This is also inline with Line 174 in bd77187
Line 191 in bd77187
Julien. |
Hi @dasergatskov. Please, take a look at #926. Thanks! |
Description
rcond for matrix of NaN values returns 0 while it should (and used to in previous version) return NaN
Checklist
This came up as a bug in octave: https://savannah.gnu.org/bugs/?63384
With the fortran test file (attached):
Openblas is 0.3.21 and is linked with lapack 3.10.1
Dmitri.
p.s. tagging @mmuetzel
bug-63384.f.gz
The text was updated successfully, but these errors were encountered: