Skip to content

Commit

Permalink
GECON returns 1 if RCOND is NaN
Browse files Browse the repository at this point in the history
  • Loading branch information
weslleyspereira committed Nov 2, 2023
1 parent 3a6f462 commit 09abbd0
Show file tree
Hide file tree
Showing 4 changed files with 44 additions and 8 deletions.
13 changes: 11 additions & 2 deletions SRC/cgecon.f
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +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 or negative.
*> = 1: RCOND = NaN.
*> \endverbatim
*
* Authors:
Expand Down Expand Up @@ -183,7 +183,7 @@ SUBROUTINE CGECON( NORM, N, A, LDA, ANORM, RCOND, WORK, RWORK,
INFO = -2
ELSE IF( LDA.LT.MAX( 1, N ) ) THEN
INFO = -4
ELSE IF( ANORM.LT.ZERO .OR. SISNAN( ANORM ) ) THEN
ELSE IF( ANORM.LT.ZERO ) THEN
INFO = -5
END IF
IF( INFO.NE.0 ) THEN
Expand All @@ -199,6 +199,10 @@ SUBROUTINE CGECON( NORM, N, A, LDA, ANORM, RCOND, WORK, RWORK,
RETURN
ELSE IF( ANORM.EQ.ZERO ) THEN
RETURN
ELSE IF( SISNAN( ANORM ) ) THEN
RCOND = ANORM
INFO = 1
RETURN
END IF
*
SMLNUM = SLAMCH( 'Safe minimum' )
Expand Down Expand Up @@ -258,6 +262,11 @@ SUBROUTINE CGECON( NORM, N, A, LDA, ANORM, RCOND, WORK, RWORK,
*
IF( AINVNM.NE.ZERO )
$ RCOND = ( ONE / AINVNM ) / ANORM
*
* Check for NaNs
*
IF( SISNAN( RCOND ) )
$ INFO = 1
*
20 CONTINUE
RETURN
Expand Down
13 changes: 11 additions & 2 deletions SRC/dgecon.f
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +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 or negative.
*> = 1: RCOND = NaN.
*> \endverbatim
*
* Authors:
Expand Down Expand Up @@ -176,7 +176,7 @@ SUBROUTINE DGECON( NORM, N, A, LDA, ANORM, RCOND, WORK, IWORK,
INFO = -2
ELSE IF( LDA.LT.MAX( 1, N ) ) THEN
INFO = -4
ELSE IF( ANORM.LT.ZERO .OR. DISNAN( ANORM ) ) THEN
ELSE IF( ANORM.LT.ZERO ) THEN
INFO = -5
END IF
IF( INFO.NE.0 ) THEN
Expand All @@ -192,6 +192,10 @@ SUBROUTINE DGECON( NORM, N, A, LDA, ANORM, RCOND, WORK, IWORK,
RETURN
ELSE IF( ANORM.EQ.ZERO ) THEN
RETURN
ELSE IF( DISNAN( ANORM ) ) THEN
RCOND = ANORM
INFO = 1
RETURN
END IF
*
SMLNUM = DLAMCH( 'Safe minimum' )
Expand Down Expand Up @@ -250,6 +254,11 @@ SUBROUTINE DGECON( NORM, N, A, LDA, ANORM, RCOND, WORK, IWORK,
*
IF( AINVNM.NE.ZERO )
$ RCOND = ( ONE / AINVNM ) / ANORM
*
* Check for NaNs
*
IF( DISNAN( RCOND ) )
$ INFO = 1
*
20 CONTINUE
RETURN
Expand Down
13 changes: 11 additions & 2 deletions SRC/sgecon.f
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +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 or negative.
*> = 1: RCOND = NaN.
*> \endverbatim
*
* Authors:
Expand Down Expand Up @@ -176,7 +176,7 @@ SUBROUTINE SGECON( NORM, N, A, LDA, ANORM, RCOND, WORK, IWORK,
INFO = -2
ELSE IF( LDA.LT.MAX( 1, N ) ) THEN
INFO = -4
ELSE IF( ANORM.LT.ZERO .OR. SISNAN( ANORM ) ) THEN
ELSE IF( ANORM.LT.ZERO ) THEN
INFO = -5
END IF
IF( INFO.NE.0 ) THEN
Expand All @@ -192,6 +192,10 @@ SUBROUTINE SGECON( NORM, N, A, LDA, ANORM, RCOND, WORK, IWORK,
RETURN
ELSE IF( ANORM.EQ.ZERO ) THEN
RETURN
ELSE IF( SISNAN( ANORM ) ) THEN
RCOND = ANORM
INFO = 1
RETURN
END IF
*
SMLNUM = SLAMCH( 'Safe minimum' )
Expand Down Expand Up @@ -250,6 +254,11 @@ SUBROUTINE SGECON( NORM, N, A, LDA, ANORM, RCOND, WORK, IWORK,
*
IF( AINVNM.NE.ZERO )
$ RCOND = ( ONE / AINVNM ) / ANORM
*
* Check for NaNs
*
IF( SISNAN( RCOND ) )
$ INFO = 1
*
20 CONTINUE
RETURN
Expand Down
13 changes: 11 additions & 2 deletions SRC/zgecon.f
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +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 or negative.
*> = 1: RCOND = NaN.
*> \endverbatim
*
* Authors:
Expand Down Expand Up @@ -183,7 +183,7 @@ SUBROUTINE ZGECON( NORM, N, A, LDA, ANORM, RCOND, WORK, RWORK,
INFO = -2
ELSE IF( LDA.LT.MAX( 1, N ) ) THEN
INFO = -4
ELSE IF( ANORM.LT.ZERO .OR. DISNAN( ANORM ) ) THEN
ELSE IF( ANORM.LT.ZERO ) THEN
INFO = -5
END IF
IF( INFO.NE.0 ) THEN
Expand All @@ -199,6 +199,10 @@ SUBROUTINE ZGECON( NORM, N, A, LDA, ANORM, RCOND, WORK, RWORK,
RETURN
ELSE IF( ANORM.EQ.ZERO ) THEN
RETURN
ELSE IF( DISNAN( ANORM ) ) THEN
RCOND = ANORM
INFO = 1
RETURN
END IF
*
SMLNUM = DLAMCH( 'Safe minimum' )
Expand Down Expand Up @@ -258,6 +262,11 @@ SUBROUTINE ZGECON( NORM, N, A, LDA, ANORM, RCOND, WORK, RWORK,
*
IF( AINVNM.NE.ZERO )
$ RCOND = ( ONE / AINVNM ) / ANORM
*
* Check for NaNs
*
IF( DISNAN( RCOND ) )
$ INFO = 1
*
20 CONTINUE
RETURN
Expand Down

0 comments on commit 09abbd0

Please sign in to comment.