Skip to content

Commit

Permalink
Makes NaN an illegal value for ANORM on input of GECON. Let NaNs prop…
Browse files Browse the repository at this point in the history
…agate in the computation of RCOND
  • Loading branch information
weslleyspereira committed Nov 8, 2023
1 parent 09abbd0 commit 90b06e0
Show file tree
Hide file tree
Showing 4 changed files with 32 additions and 16 deletions.
12 changes: 8 additions & 4 deletions SRC/cgecon.f
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,12 @@
*> \verbatim
*> INFO is INTEGER
*> = 0: successful exit
*> < 0: if INFO = -i, the i-th argument had an illegal value
*> < 0: if INFO = -i, the i-th argument had an illegal value.
*> NaNs are illegal values for ANORM, and they propagate to
*> the output parameter RCOND.
*> Infinity values are valid inputs for ANORM, because the values
*> in A can still be finite and, thus, norm of the inverse can be
*> computed as a strictly positive number.
*> = 1: RCOND = NaN.
*> \endverbatim
*
Expand Down Expand Up @@ -201,7 +206,7 @@ SUBROUTINE CGECON( NORM, N, A, LDA, ANORM, RCOND, WORK, RWORK,
RETURN
ELSE IF( SISNAN( ANORM ) ) THEN
RCOND = ANORM
INFO = 1
INFO = -5
RETURN
END IF
*
Expand Down Expand Up @@ -260,8 +265,7 @@ SUBROUTINE CGECON( NORM, N, A, LDA, ANORM, RCOND, WORK, RWORK,
*
* Compute the estimate of the reciprocal condition number.
*
IF( AINVNM.NE.ZERO )
$ RCOND = ( ONE / AINVNM ) / ANORM
RCOND = ( ONE / AINVNM ) / ANORM
*
* Check for NaNs
*
Expand Down
12 changes: 8 additions & 4 deletions SRC/dgecon.f
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,12 @@
*> \verbatim
*> INFO is INTEGER
*> = 0: successful exit
*> < 0: if INFO = -i, the i-th argument had an illegal value
*> < 0: if INFO = -i, the i-th argument had an illegal value.
*> NaNs are illegal values for ANORM, and they propagate to
*> the output parameter RCOND.
*> Infinity values are valid inputs for ANORM, because the values
*> in A can still be finite and, thus, norm of the inverse can be
*> computed as a strictly positive number.
*> = 1: RCOND = NaN.
*> \endverbatim
*
Expand Down Expand Up @@ -194,7 +199,7 @@ SUBROUTINE DGECON( NORM, N, A, LDA, ANORM, RCOND, WORK, IWORK,
RETURN
ELSE IF( DISNAN( ANORM ) ) THEN
RCOND = ANORM
INFO = 1
INFO = -5
RETURN
END IF
*
Expand Down Expand Up @@ -252,8 +257,7 @@ SUBROUTINE DGECON( NORM, N, A, LDA, ANORM, RCOND, WORK, IWORK,
*
* Compute the estimate of the reciprocal condition number.
*
IF( AINVNM.NE.ZERO )
$ RCOND = ( ONE / AINVNM ) / ANORM
RCOND = ( ONE / AINVNM ) / ANORM
*
* Check for NaNs
*
Expand Down
12 changes: 8 additions & 4 deletions SRC/sgecon.f
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,12 @@
*> \verbatim
*> INFO is INTEGER
*> = 0: successful exit
*> < 0: if INFO = -i, the i-th argument had an illegal value
*> < 0: if INFO = -i, the i-th argument had an illegal value.
*> NaNs are illegal values for ANORM, and they propagate to
*> the output parameter RCOND.
*> Infinity values are valid inputs for ANORM, because the values
*> in A can still be finite and, thus, norm of the inverse can be
*> computed as a strictly positive number.
*> = 1: RCOND = NaN.
*> \endverbatim
*
Expand Down Expand Up @@ -194,7 +199,7 @@ SUBROUTINE SGECON( NORM, N, A, LDA, ANORM, RCOND, WORK, IWORK,
RETURN
ELSE IF( SISNAN( ANORM ) ) THEN
RCOND = ANORM
INFO = 1
INFO = -5
RETURN
END IF
*
Expand Down Expand Up @@ -252,8 +257,7 @@ SUBROUTINE SGECON( NORM, N, A, LDA, ANORM, RCOND, WORK, IWORK,
*
* Compute the estimate of the reciprocal condition number.
*
IF( AINVNM.NE.ZERO )
$ RCOND = ( ONE / AINVNM ) / ANORM
RCOND = ( ONE / AINVNM ) / ANORM
*
* Check for NaNs
*
Expand Down
12 changes: 8 additions & 4 deletions SRC/zgecon.f
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,12 @@
*> \verbatim
*> INFO is INTEGER
*> = 0: successful exit
*> < 0: if INFO = -i, the i-th argument had an illegal value
*> < 0: if INFO = -i, the i-th argument had an illegal value.
*> NaNs are illegal values for ANORM, and they propagate to
*> the output parameter RCOND.
*> Infinity values are valid inputs for ANORM, because the values
*> in A can still be finite and, thus, norm of the inverse can be
*> computed as a strictly positive number.
*> = 1: RCOND = NaN.
*> \endverbatim
*
Expand Down Expand Up @@ -201,7 +206,7 @@ SUBROUTINE ZGECON( NORM, N, A, LDA, ANORM, RCOND, WORK, RWORK,
RETURN
ELSE IF( DISNAN( ANORM ) ) THEN
RCOND = ANORM
INFO = 1
INFO = -5
RETURN
END IF
*
Expand Down Expand Up @@ -260,8 +265,7 @@ SUBROUTINE ZGECON( NORM, N, A, LDA, ANORM, RCOND, WORK, RWORK,
*
* Compute the estimate of the reciprocal condition number.
*
IF( AINVNM.NE.ZERO )
$ RCOND = ( ONE / AINVNM ) / ANORM
RCOND = ( ONE / AINVNM ) / ANORM
*
* Check for NaNs
*
Expand Down

0 comments on commit 90b06e0

Please sign in to comment.