Skip to content
Open
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: 4 additions & 4 deletions CMAKE/LAPACKTestHelpers.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -44,17 +44,17 @@ function(lapack_no_constant_propagation_flag out_var)
endif()
endfunction()

# Disable it for the ?errcxx drivers among ARGN, which manufacture their NaN
# with SQRT( -ONE ). Call this with every source list such a driver is built
# from: the generated _64 and _TEST copies need it as much as the originals.
# Disable it for the CXX and LS error-exit tests among ARGN, which
# manufacture NaNs. Call this with every source list: the generated _64
# and _TEST copies need it as much as the originals.
function(lapack_nag_disable_constant_propagation)
lapack_no_constant_propagation_flag(flag)
if(NOT flag)
return()
endif()
foreach(source IN LISTS ARGN)
get_filename_component(name "${source}" NAME)
if(name MATCHES "^[scdz]errcxx(_[A-Za-z0-9]+)*\\.f$")
if(name MATCHES "^[scdz]err(cxx|ls)(_[A-Za-z0-9]+)*\\.f$")
set_source_files_properties("${source}"
PROPERTIES COMPILE_OPTIONS "${flag}")
endif()
Expand Down
2 changes: 2 additions & 0 deletions SRC/cgelsd.f
Original file line number Diff line number Diff line change
Expand Up @@ -192,6 +192,8 @@
*> > 0: the algorithm for computing the SVD failed to converge;
*> if INFO = i, i off-diagonal elements of an intermediate
*> bidiagonal form did not converge to zero.
*> INFO = 1 is also returned if A contains a NaN or an
*> infinity.
*> \endverbatim
*
* Authors:
Expand Down
10 changes: 8 additions & 2 deletions SRC/clalsd.f
Original file line number Diff line number Diff line change
Expand Up @@ -153,6 +153,7 @@
*> > 0: The algorithm failed to compute a singular value while
*> working on the submatrix lying in rows and columns
*> INFO/(N+1) through MOD(INFO,N+1).
*> = 1: also if D or E contains a NaN.
*> \endverbatim
*
* Authors:
Expand Down Expand Up @@ -212,8 +213,8 @@ SUBROUTINE CLALSD( UPLO, SMLSIZ, N, NRHS, D, E, B, LDB, RCOND,
* .. External Functions ..
INTEGER ISAMAX
REAL SLAMCH, SLANST
LOGICAL LSAME
EXTERNAL ISAMAX, SLAMCH, SLANST, LSAME
LOGICAL SISNAN, LSAME
EXTERNAL ISAMAX, SLAMCH, SLANST, SISNAN, LSAME
* ..
* .. External Subroutines ..
EXTERNAL CCOPY, CLACPY, CLALSA, CLASCL, CLASET,
Expand Down Expand Up @@ -261,6 +262,8 @@ SUBROUTINE CLALSD( UPLO, SMLSIZ, N, NRHS, D, E, B, LDB, RCOND,
ELSE IF( N.EQ.1 ) THEN
IF( D( 1 ).EQ.ZERO ) THEN
CALL CLASET( 'A', 1, NRHS, CZERO, CZERO, B, LDB )
ELSE IF( SISNAN( D( 1 ) ) ) THEN
INFO = 1
ELSE
RANK = 1
CALL CLASCL( 'G', 0, 0, D( 1 ), ONE, 1, NRHS, B, LDB,
Expand Down Expand Up @@ -304,6 +307,9 @@ SUBROUTINE CLALSD( UPLO, SMLSIZ, N, NRHS, D, E, B, LDB, RCOND,
IF( ORGNRM.EQ.ZERO ) THEN
CALL CLASET( 'A', N, NRHS, CZERO, CZERO, B, LDB )
RETURN
ELSE IF( SISNAN( ORGNRM ) ) THEN
INFO = 1
RETURN
END IF
*
CALL SLASCL( 'G', 0, 0, ORGNRM, ONE, N, 1, D, N, INFO )
Expand Down
14 changes: 10 additions & 4 deletions SRC/dbdsdc.f
Original file line number Diff line number Diff line change
Expand Up @@ -172,6 +172,8 @@
*> < 0: if INFO = -i, the i-th argument had an illegal value.
*> > 0: The algorithm failed to compute a singular value.
*> The update process of divide and conquer failed.
*> = 1: also if D or E contains a NaN and the divide and
*> conquer path is taken (COMPQ = 'I' or 'P', N > SMLSIZ).
*> \endverbatim
*
* Authors:
Expand Down Expand Up @@ -227,10 +229,10 @@ SUBROUTINE DBDSDC( UPLO, COMPQ, N, D, E, U, LDU, VT, LDVT, Q,
DOUBLE PRECISION CS, EPS, ORGNRM, P, R, SN
* ..
* .. External Functions ..
LOGICAL LSAME
LOGICAL DISNAN, LSAME
INTEGER ILAENV
DOUBLE PRECISION DLAMCH, DLANST
EXTERNAL LSAME, ILAENV, DLAMCH, DLANST
EXTERNAL LSAME, ILAENV, DLAMCH, DLANST, DISNAN
* ..
* .. External Subroutines ..
EXTERNAL DCOPY, DLARTG, DLASCL, DLASD0, DLASDA,
Expand Down Expand Up @@ -370,8 +372,12 @@ SUBROUTINE DBDSDC( UPLO, COMPQ, N, D, E, U, LDU, VT, LDVT, Q,
* Scale.
*
ORGNRM = DLANST( 'M', N, D, E )
IF( ORGNRM.EQ.ZERO )
$ RETURN
IF( ORGNRM.EQ.ZERO ) THEN
RETURN
ELSE IF( DISNAN( ORGNRM ) ) THEN
INFO = 1
RETURN
END IF
CALL DLASCL( 'G', 0, 0, ORGNRM, ONE, N, 1, D, N, IERR )
CALL DLASCL( 'G', 0, 0, ORGNRM, ONE, NM1, 1, E, NM1, IERR )
*
Expand Down
2 changes: 2 additions & 0 deletions SRC/dgelsd.f
Original file line number Diff line number Diff line change
Expand Up @@ -176,6 +176,8 @@
*> > 0: the algorithm for computing the SVD failed to converge;
*> if INFO = i, i off-diagonal elements of an intermediate
*> bidiagonal form did not converge to zero.
*> INFO = 1 is also returned if A contains a NaN or an
*> infinity.
*> \endverbatim
*
* Authors:
Expand Down
10 changes: 8 additions & 2 deletions SRC/dlalsd.f
Original file line number Diff line number Diff line change
Expand Up @@ -146,6 +146,7 @@
*> > 0: The algorithm failed to compute a singular value while
*> working on the submatrix lying in rows and columns
*> INFO/(N+1) through MOD(INFO,N+1).
*> = 1: also if D or E contains a NaN.
*> \endverbatim
*
* Authors:
Expand Down Expand Up @@ -200,8 +201,8 @@ SUBROUTINE DLALSD( UPLO, SMLSIZ, N, NRHS, D, E, B, LDB, RCOND,
* .. External Functions ..
INTEGER IDAMAX
DOUBLE PRECISION DLAMCH, DLANST
LOGICAL LSAME
EXTERNAL IDAMAX, DLAMCH, DLANST, LSAME
LOGICAL DISNAN, LSAME
EXTERNAL IDAMAX, DLAMCH, DLANST, DISNAN, LSAME
* ..
* .. External Subroutines ..
EXTERNAL DCOPY, DGEMM, DLACPY, DLALSA, DLARTG,
Expand Down Expand Up @@ -248,6 +249,8 @@ SUBROUTINE DLALSD( UPLO, SMLSIZ, N, NRHS, D, E, B, LDB, RCOND,
ELSE IF( N.EQ.1 ) THEN
IF( D( 1 ).EQ.ZERO ) THEN
CALL DLASET( 'A', 1, NRHS, ZERO, ZERO, B, LDB )
ELSE IF( DISNAN( D( 1 ) ) ) THEN
INFO = 1
ELSE
RANK = 1
CALL DLASCL( 'G', 0, 0, D( 1 ), ONE, 1, NRHS, B, LDB,
Expand Down Expand Up @@ -291,6 +294,9 @@ SUBROUTINE DLALSD( UPLO, SMLSIZ, N, NRHS, D, E, B, LDB, RCOND,
IF( ORGNRM.EQ.ZERO ) THEN
CALL DLASET( 'A', N, NRHS, ZERO, ZERO, B, LDB )
RETURN
ELSE IF( DISNAN( ORGNRM ) ) THEN
INFO = 1
RETURN
END IF
*
CALL DLASCL( 'G', 0, 0, ORGNRM, ONE, N, 1, D, N, INFO )
Expand Down
14 changes: 10 additions & 4 deletions SRC/sbdsdc.f
Original file line number Diff line number Diff line change
Expand Up @@ -172,6 +172,8 @@
*> < 0: if INFO = -i, the i-th argument had an illegal value.
*> > 0: The algorithm failed to compute a singular value.
*> The update process of divide and conquer failed.
*> = 1: also if D or E contains a NaN and the divide and
*> conquer path is taken (COMPQ = 'I' or 'P', N > SMLSIZ).
*> \endverbatim
*
* Authors:
Expand Down Expand Up @@ -227,10 +229,10 @@ SUBROUTINE SBDSDC( UPLO, COMPQ, N, D, E, U, LDU, VT, LDVT, Q,
REAL CS, EPS, ORGNRM, P, R, SN
* ..
* .. External Functions ..
LOGICAL LSAME
LOGICAL SISNAN, LSAME
INTEGER ILAENV
REAL SLAMCH, SLANST
EXTERNAL SLAMCH, SLANST, ILAENV, LSAME
EXTERNAL SLAMCH, SLANST, ILAENV, LSAME, SISNAN
* ..
* .. External Subroutines ..
EXTERNAL SCOPY, SLARTG, SLASCL, SLASD0, SLASDA,
Expand Down Expand Up @@ -370,8 +372,12 @@ SUBROUTINE SBDSDC( UPLO, COMPQ, N, D, E, U, LDU, VT, LDVT, Q,
* Scale.
*
ORGNRM = SLANST( 'M', N, D, E )
IF( ORGNRM.EQ.ZERO )
$ RETURN
IF( ORGNRM.EQ.ZERO ) THEN
RETURN
ELSE IF( SISNAN( ORGNRM ) ) THEN
INFO = 1
RETURN
END IF
CALL SLASCL( 'G', 0, 0, ORGNRM, ONE, N, 1, D, N, IERR )
CALL SLASCL( 'G', 0, 0, ORGNRM, ONE, NM1, 1, E, NM1, IERR )
*
Expand Down
2 changes: 2 additions & 0 deletions SRC/sgelsd.f
Original file line number Diff line number Diff line change
Expand Up @@ -177,6 +177,8 @@
*> > 0: the algorithm for computing the SVD failed to converge;
*> if INFO = i, i off-diagonal elements of an intermediate
*> bidiagonal form did not converge to zero.
*> INFO = 1 is also returned if A contains a NaN or an
*> infinity.
*> \endverbatim
*
* Authors:
Expand Down
10 changes: 8 additions & 2 deletions SRC/slalsd.f
Original file line number Diff line number Diff line change
Expand Up @@ -146,6 +146,7 @@
*> > 0: The algorithm failed to compute a singular value while
*> working on the submatrix lying in rows and columns
*> INFO/(N+1) through MOD(INFO,N+1).
*> = 1: also if D or E contains a NaN.
*> \endverbatim
*
* Authors:
Expand Down Expand Up @@ -200,8 +201,8 @@ SUBROUTINE SLALSD( UPLO, SMLSIZ, N, NRHS, D, E, B, LDB, RCOND,
* .. External Functions ..
INTEGER ISAMAX
REAL SLAMCH, SLANST
LOGICAL LSAME
EXTERNAL ISAMAX, SLAMCH, SLANST, LSAME
LOGICAL SISNAN, LSAME
EXTERNAL ISAMAX, SLAMCH, SLANST, SISNAN, LSAME
* ..
* .. External Subroutines ..
EXTERNAL SCOPY, SGEMM, SLACPY, SLALSA, SLARTG,
Expand Down Expand Up @@ -248,6 +249,8 @@ SUBROUTINE SLALSD( UPLO, SMLSIZ, N, NRHS, D, E, B, LDB, RCOND,
ELSE IF( N.EQ.1 ) THEN
IF( D( 1 ).EQ.ZERO ) THEN
CALL SLASET( 'A', 1, NRHS, ZERO, ZERO, B, LDB )
ELSE IF( SISNAN( D( 1 ) ) ) THEN
INFO = 1
ELSE
RANK = 1
CALL SLASCL( 'G', 0, 0, D( 1 ), ONE, 1, NRHS, B, LDB,
Expand Down Expand Up @@ -291,6 +294,9 @@ SUBROUTINE SLALSD( UPLO, SMLSIZ, N, NRHS, D, E, B, LDB, RCOND,
IF( ORGNRM.EQ.ZERO ) THEN
CALL SLASET( 'A', N, NRHS, ZERO, ZERO, B, LDB )
RETURN
ELSE IF( SISNAN( ORGNRM ) ) THEN
INFO = 1
RETURN
END IF
*
CALL SLASCL( 'G', 0, 0, ORGNRM, ONE, N, 1, D, N, INFO )
Expand Down
2 changes: 2 additions & 0 deletions SRC/zgelsd.f
Original file line number Diff line number Diff line change
Expand Up @@ -192,6 +192,8 @@
*> > 0: the algorithm for computing the SVD failed to converge;
*> if INFO = i, i off-diagonal elements of an intermediate
*> bidiagonal form did not converge to zero.
*> INFO = 1 is also returned if A contains a NaN or an
*> infinity.
*> \endverbatim
*
* Authors:
Expand Down
10 changes: 8 additions & 2 deletions SRC/zlalsd.f
Original file line number Diff line number Diff line change
Expand Up @@ -154,6 +154,7 @@
*> > 0: The algorithm failed to compute a singular value while
*> working on the submatrix lying in rows and columns
*> INFO/(N+1) through MOD(INFO,N+1).
*> = 1: also if D or E contains a NaN.
*> \endverbatim
*
* Authors:
Expand Down Expand Up @@ -213,8 +214,8 @@ SUBROUTINE ZLALSD( UPLO, SMLSIZ, N, NRHS, D, E, B, LDB, RCOND,
* .. External Functions ..
INTEGER IDAMAX
DOUBLE PRECISION DLAMCH, DLANST
LOGICAL LSAME
EXTERNAL IDAMAX, DLAMCH, DLANST, LSAME
LOGICAL DISNAN, LSAME
EXTERNAL IDAMAX, DLAMCH, DLANST, DISNAN, LSAME
* ..
* .. External Subroutines ..
EXTERNAL DGEMM, DLARTG, DLASCL, DLASDA, DLASDQ,
Expand Down Expand Up @@ -262,6 +263,8 @@ SUBROUTINE ZLALSD( UPLO, SMLSIZ, N, NRHS, D, E, B, LDB, RCOND,
ELSE IF( N.EQ.1 ) THEN
IF( D( 1 ).EQ.ZERO ) THEN
CALL ZLASET( 'A', 1, NRHS, CZERO, CZERO, B, LDB )
ELSE IF( DISNAN( D( 1 ) ) ) THEN
INFO = 1
ELSE
RANK = 1
CALL ZLASCL( 'G', 0, 0, D( 1 ), ONE, 1, NRHS, B, LDB,
Expand Down Expand Up @@ -305,6 +308,9 @@ SUBROUTINE ZLALSD( UPLO, SMLSIZ, N, NRHS, D, E, B, LDB, RCOND,
IF( ORGNRM.EQ.ZERO ) THEN
CALL ZLASET( 'A', N, NRHS, CZERO, CZERO, B, LDB )
RETURN
ELSE IF( DISNAN( ORGNRM ) ) THEN
INFO = 1
RETURN
END IF
*
CALL DLASCL( 'G', 0, 0, ORGNRM, ONE, N, 1, D, N, INFO )
Expand Down
3 changes: 2 additions & 1 deletion TESTING/LIN/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -222,7 +222,8 @@ else()
endif()

lapack_nag_disable_constant_propagation(
serrcxx.f cerrcxx.f derrcxx.f zerrcxx.f)
serrcxx.f cerrcxx.f derrcxx.f zerrcxx.f
serrls.f cerrls.f derrls.f zerrls.f)

set(DSLINTST dchkab.f
ddrvab.f ddrvac.f derrab.f derrac.f dget08.f
Expand Down
38 changes: 32 additions & 6 deletions TESTING/LIN/cerrls.f
Original file line number Diff line number Diff line change
Expand Up @@ -66,18 +66,18 @@ SUBROUTINE CERRLS( PATH, NUNIT )
* =====================================================================
*
* .. Parameters ..
INTEGER NMAX
PARAMETER ( NMAX = 2 )
INTEGER NMAX, LW, LIW
PARAMETER ( NMAX = 2, LW = 1000, LIW = 30 )
* ..
* .. Local Scalars ..
CHARACTER*2 C2
INTEGER INFO, IRNK
REAL RCOND
REAL NAN, ONE, RCOND
* ..
* .. Local Arrays ..
INTEGER IP( NMAX )
REAL RW( NMAX ), S( NMAX )
COMPLEX A( NMAX, NMAX ), B( NMAX, NMAX ), W( NMAX )
INTEGER IP( LIW )
REAL RW( LW ), S( NMAX )
COMPLEX A( NMAX, NMAX ), B( NMAX, NMAX ), W( LW )
* ..
* .. External Functions ..
LOGICAL LSAMEN
Expand All @@ -96,6 +96,9 @@ SUBROUTINE CERRLS( PATH, NUNIT )
COMMON / INFOC / INFOT, NOUT, OK, LERR
COMMON / SRNAMC / SRNAMT
* ..
* .. Intrinsic Functions ..
INTRINSIC SQRT
* ..
* .. Executable Statements ..
*
NOUT = NUNIT
Expand Down Expand Up @@ -271,13 +274,36 @@ SUBROUTINE CERRLS( PATH, NUNIT )
CALL CGELSD( 2, 2, 1, A, 2, B, 2, S, RCOND, IRNK, W, 1,
$ RW, IP, INFO )
CALL CHKXER( 'CGELSD', INFOT, NOUT, LERR, OK )
*
* CGELSD must return INFO = 1, without calling XERBLA, when A
* contains a NaN: the NaN norm would otherwise be rejected by
* SLASCL inside CLALSD.
*
ONE = 1.0E+0
NAN = SQRT( -ONE )
A( 2, 2 ) = NAN
B( 1, 1 ) = ( 1.0E+0, 0.0E+0 )
B( 2, 1 ) = ( 1.0E+0, 0.0E+0 )
RCOND = -1.0E+0
SRNAMT = 'CGELSD'
INFOT = 0
LERR = .FALSE.
CALL CGELSD( 2, 2, 1, A, 2, B, 2, S, RCOND, IRNK, W, LW, RW,
$ IP, INFO )
IF( LERR .OR. INFO.NE.1 ) THEN
WRITE( NOUT, FMT = 9999 )INFO
OK = .FALSE.
END IF
END IF
*
* Print a summary line.
*
CALL ALAESM( PATH, OK, NOUT )
*
RETURN
*
9999 FORMAT( ' *** CGELSD on a matrix with a NaN returned INFO = ', I6,
$ ' instead of 1 ***' )
*
* End of CERRLS
*
Expand Down
Loading
Loading