Skip to content
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

dgesdd: Handle norm nan value #471

Merged
merged 1 commit into from
Jan 8, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 6 additions & 2 deletions SRC/cgesdd.f
Original file line number Diff line number Diff line change
Expand Up @@ -281,9 +281,9 @@ SUBROUTINE CGESDD( JOBZ, M, N, A, LDA, S, U, LDU, VT, LDVT,
$ CUNGQR, CUNMBR, SBDSDC, SLASCL, XERBLA
* ..
* .. External Functions ..
LOGICAL LSAME
LOGICAL LSAME, SISNAN
REAL SLAMCH, CLANGE
EXTERNAL LSAME, SLAMCH, CLANGE
EXTERNAL LSAME, SLAMCH, CLANGE, SISNAN
* ..
* .. Intrinsic Functions ..
INTRINSIC INT, MAX, MIN, SQRT
Expand Down Expand Up @@ -647,6 +647,10 @@ SUBROUTINE CGESDD( JOBZ, M, N, A, LDA, S, U, LDU, VT, LDVT,
* Scale A if max element outside range [SMLNUM,BIGNUM]
*
ANRM = CLANGE( 'M', M, N, A, LDA, DUM )
IF( SISNAN ( ANRM ) ) THEN
INFO = -4
RETURN
END IF
ISCL = 0
IF( ANRM.GT.ZERO .AND. ANRM.LT.SMLNUM ) THEN
ISCL = 1
Expand Down
8 changes: 6 additions & 2 deletions SRC/dgesdd.f
Original file line number Diff line number Diff line change
Expand Up @@ -267,9 +267,9 @@ SUBROUTINE DGESDD( JOBZ, M, N, A, LDA, S, U, LDU, VT, LDVT,
$ XERBLA
* ..
* .. External Functions ..
LOGICAL LSAME
LOGICAL LSAME, DISNAN
DOUBLE PRECISION DLAMCH, DLANGE
EXTERNAL DLAMCH, DLANGE, LSAME
EXTERNAL DLAMCH, DLANGE, LSAME, DISNAN
* ..
* .. Intrinsic Functions ..
INTRINSIC INT, MAX, MIN, SQRT
Expand Down Expand Up @@ -599,6 +599,10 @@ SUBROUTINE DGESDD( JOBZ, M, N, A, LDA, S, U, LDU, VT, LDVT,
* Scale A if max element outside range [SMLNUM,BIGNUM]
*
ANRM = DLANGE( 'M', M, N, A, LDA, DUM )
IF( DISNAN( ANRM ) ) THEN
INFO = -4
RETURN
END IF
ISCL = 0
IF( ANRM.GT.ZERO .AND. ANRM.LT.SMLNUM ) THEN
ISCL = 1
Expand Down
8 changes: 6 additions & 2 deletions SRC/sgesdd.f
Original file line number Diff line number Diff line change
Expand Up @@ -267,9 +267,9 @@ SUBROUTINE SGESDD( JOBZ, M, N, A, LDA, S, U, LDU, VT, LDVT,
$ XERBLA
* ..
* .. External Functions ..
LOGICAL LSAME
LOGICAL LSAME, SISNAN
REAL SLAMCH, SLANGE
EXTERNAL SLAMCH, SLANGE, LSAME
EXTERNAL SLAMCH, SLANGE, LSAME, SISNAN
* ..
* .. Intrinsic Functions ..
INTRINSIC INT, MAX, MIN, SQRT
Expand Down Expand Up @@ -599,6 +599,10 @@ SUBROUTINE SGESDD( JOBZ, M, N, A, LDA, S, U, LDU, VT, LDVT,
* Scale A if max element outside range [SMLNUM,BIGNUM]
*
ANRM = SLANGE( 'M', M, N, A, LDA, DUM )
IF( SISNAN( ANRM ) ) THEN
INFO = -4
RETURN
END IF
ISCL = 0
IF( ANRM.GT.ZERO .AND. ANRM.LT.SMLNUM ) THEN
ISCL = 1
Expand Down
8 changes: 6 additions & 2 deletions SRC/zgesdd.f
Original file line number Diff line number Diff line change
Expand Up @@ -281,9 +281,9 @@ SUBROUTINE ZGESDD( JOBZ, M, N, A, LDA, S, U, LDU, VT, LDVT,
$ ZLASET, ZUNGBR, ZUNGLQ, ZUNGQR, ZUNMBR
* ..
* .. External Functions ..
LOGICAL LSAME
LOGICAL LSAME, DISNAN
DOUBLE PRECISION DLAMCH, ZLANGE
EXTERNAL LSAME, DLAMCH, ZLANGE
EXTERNAL LSAME, DLAMCH, ZLANGE, DISNAN
* ..
* .. Intrinsic Functions ..
INTRINSIC INT, MAX, MIN, SQRT
Expand Down Expand Up @@ -647,6 +647,10 @@ SUBROUTINE ZGESDD( JOBZ, M, N, A, LDA, S, U, LDU, VT, LDVT,
* Scale A if max element outside range [SMLNUM,BIGNUM]
*
ANRM = ZLANGE( 'M', M, N, A, LDA, DUM )
IF( DISNAN( ANRM ) ) THEN
INFO = -4
RETURN
END IF
ISCL = 0
IF( ANRM.GT.ZERO .AND. ANRM.LT.SMLNUM ) THEN
ISCL = 1
Expand Down