Merge pull request #1585 from martin-frbg/lapack-253

Fixes from Lapack-Reference PR 253
This commit is contained in:
Martin Kroeker 2018-06-01 18:59:33 +02:00 committed by GitHub
commit 401adddb2b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
53 changed files with 178 additions and 124 deletions

View File

@ -41,7 +41,7 @@ lapack_int LAPACKE_chetrf_aa_work( int matrix_layout, char uplo, lapack_int n,
lapack_int info = 0;
if( matrix_layout == LAPACK_COL_MAJOR ) {
/* Call LAPACK function and adjust info */
LAPACK_chetrf( &uplo, &n, a, &lda, ipiv, work, &lwork, &info );
LAPACK_chetrf_aa( &uplo, &n, a, &lda, ipiv, work, &lwork, &info );
if( info < 0 ) {
info = info - 1;
}
@ -56,7 +56,7 @@ lapack_int LAPACKE_chetrf_aa_work( int matrix_layout, char uplo, lapack_int n,
}
/* Query optimal working array(s) size if requested */
if( lwork == -1 ) {
LAPACK_chetrf( &uplo, &n, a, &lda_t, ipiv, work, &lwork, &info );
LAPACK_chetrf_aa( &uplo, &n, a, &lda_t, ipiv, work, &lwork, &info );
return (info < 0) ? (info - 1) : info;
}
/* Allocate memory for temporary array(s) */
@ -69,7 +69,7 @@ lapack_int LAPACKE_chetrf_aa_work( int matrix_layout, char uplo, lapack_int n,
/* Transpose input matrices */
LAPACKE_che_trans( matrix_layout, uplo, n, a, lda, a_t, lda_t );
/* Call LAPACK function and adjust info */
LAPACK_chetrf( &uplo, &n, a_t, &lda_t, ipiv, work, &lwork, &info );
LAPACK_chetrf_aa( &uplo, &n, a_t, &lda_t, ipiv, work, &lwork, &info );
if( info < 0 ) {
info = info - 1;
}

View File

@ -41,7 +41,7 @@ lapack_int LAPACKE_csytrf_aa_work( int matrix_layout, char uplo, lapack_int n,
lapack_int info = 0;
if( matrix_layout == LAPACK_COL_MAJOR ) {
/* Call LAPACK function and adjust info */
LAPACK_csytrf( &uplo, &n, a, &lda, ipiv, work, &lwork, &info );
LAPACK_csytrf_aa( &uplo, &n, a, &lda, ipiv, work, &lwork, &info );
if( info < 0 ) {
info = info - 1;
}
@ -56,7 +56,7 @@ lapack_int LAPACKE_csytrf_aa_work( int matrix_layout, char uplo, lapack_int n,
}
/* Query optimal working array(s) size if requested */
if( lwork == -1 ) {
LAPACK_csytrf( &uplo, &n, a, &lda_t, ipiv, work, &lwork, &info );
LAPACK_csytrf_aa( &uplo, &n, a, &lda_t, ipiv, work, &lwork, &info );
return (info < 0) ? (info - 1) : info;
}
/* Allocate memory for temporary array(s) */
@ -69,7 +69,7 @@ lapack_int LAPACKE_csytrf_aa_work( int matrix_layout, char uplo, lapack_int n,
/* Transpose input matrices */
LAPACKE_csy_trans( matrix_layout, uplo, n, a, lda, a_t, lda_t );
/* Call LAPACK function and adjust info */
LAPACK_csytrf( &uplo, &n, a_t, &lda_t, ipiv, work, &lwork, &info );
LAPACK_csytrf_aa( &uplo, &n, a_t, &lda_t, ipiv, work, &lwork, &info );
if( info < 0 ) {
info = info - 1;
}

View File

@ -40,7 +40,7 @@ lapack_int LAPACKE_dsytrf_aa_work( int matrix_layout, char uplo, lapack_int n,
lapack_int info = 0;
if( matrix_layout == LAPACK_COL_MAJOR ) {
/* Call LAPACK function and adjust info */
LAPACK_dsytrf( &uplo, &n, a, &lda, ipiv, work, &lwork, &info );
LAPACK_dsytrf_aa( &uplo, &n, a, &lda, ipiv, work, &lwork, &info );
if( info < 0 ) {
info = info - 1;
}
@ -55,7 +55,7 @@ lapack_int LAPACKE_dsytrf_aa_work( int matrix_layout, char uplo, lapack_int n,
}
/* Query optimal working array(s) size if requested */
if( lwork == -1 ) {
LAPACK_dsytrf( &uplo, &n, a, &lda_t, ipiv, work, &lwork, &info );
LAPACK_dsytrf_aa( &uplo, &n, a, &lda_t, ipiv, work, &lwork, &info );
return (info < 0) ? (info - 1) : info;
}
/* Allocate memory for temporary array(s) */
@ -67,7 +67,7 @@ lapack_int LAPACKE_dsytrf_aa_work( int matrix_layout, char uplo, lapack_int n,
/* Transpose input matrices */
LAPACKE_dsy_trans( matrix_layout, uplo, n, a, lda, a_t, lda_t );
/* Call LAPACK function and adjust info */
LAPACK_dsytrf( &uplo, &n, a_t, &lda_t, ipiv, work, &lwork, &info );
LAPACK_dsytrf_aa( &uplo, &n, a_t, &lda_t, ipiv, work, &lwork, &info );
if( info < 0 ) {
info = info - 1;
}

View File

@ -40,7 +40,7 @@ lapack_int LAPACKE_ssytrf_aa_work( int matrix_layout, char uplo, lapack_int n,
lapack_int info = 0;
if( matrix_layout == LAPACK_COL_MAJOR ) {
/* Call LAPACK function and adjust info */
LAPACK_ssytrf( &uplo, &n, a, &lda, ipiv, work, &lwork, &info );
LAPACK_ssytrf_aa( &uplo, &n, a, &lda, ipiv, work, &lwork, &info );
if( info < 0 ) {
info = info - 1;
}
@ -55,7 +55,7 @@ lapack_int LAPACKE_ssytrf_aa_work( int matrix_layout, char uplo, lapack_int n,
}
/* Query optimal working array(s) size if requested */
if( lwork == -1 ) {
LAPACK_ssytrf( &uplo, &n, a, &lda_t, ipiv, work, &lwork, &info );
LAPACK_ssytrf_aa( &uplo, &n, a, &lda_t, ipiv, work, &lwork, &info );
return (info < 0) ? (info - 1) : info;
}
/* Allocate memory for temporary array(s) */
@ -67,7 +67,7 @@ lapack_int LAPACKE_ssytrf_aa_work( int matrix_layout, char uplo, lapack_int n,
/* Transpose input matrices */
LAPACKE_ssy_trans( matrix_layout, uplo, n, a, lda, a_t, lda_t );
/* Call LAPACK function and adjust info */
LAPACK_ssytrf( &uplo, &n, a_t, &lda_t, ipiv, work, &lwork, &info );
LAPACK_ssytrf_aa( &uplo, &n, a_t, &lda_t, ipiv, work, &lwork, &info );
if( info < 0 ) {
info = info - 1;
}

View File

@ -41,7 +41,7 @@ lapack_int LAPACKE_zhetrf_aa_work( int matrix_layout, char uplo, lapack_int n,
lapack_int info = 0;
if( matrix_layout == LAPACK_COL_MAJOR ) {
/* Call LAPACK function and adjust info */
LAPACK_zhetrf( &uplo, &n, a, &lda, ipiv, work, &lwork, &info );
LAPACK_zhetrf_aa( &uplo, &n, a, &lda, ipiv, work, &lwork, &info );
if( info < 0 ) {
info = info - 1;
}
@ -56,7 +56,7 @@ lapack_int LAPACKE_zhetrf_aa_work( int matrix_layout, char uplo, lapack_int n,
}
/* Query optimal working array(s) size if requested */
if( lwork == -1 ) {
LAPACK_zhetrf( &uplo, &n, a, &lda_t, ipiv, work, &lwork, &info );
LAPACK_zhetrf_aa( &uplo, &n, a, &lda_t, ipiv, work, &lwork, &info );
return (info < 0) ? (info - 1) : info;
}
/* Allocate memory for temporary array(s) */
@ -69,7 +69,7 @@ lapack_int LAPACKE_zhetrf_aa_work( int matrix_layout, char uplo, lapack_int n,
/* Transpose input matrices */
LAPACKE_zhe_trans( matrix_layout, uplo, n, a, lda, a_t, lda_t );
/* Call LAPACK function and adjust info */
LAPACK_zhetrf( &uplo, &n, a_t, &lda_t, ipiv, work, &lwork, &info );
LAPACK_zhetrf_aa( &uplo, &n, a_t, &lda_t, ipiv, work, &lwork, &info );
if( info < 0 ) {
info = info - 1;
}

View File

@ -41,7 +41,7 @@ lapack_int LAPACKE_zsytrf_aa_work( int matrix_layout, char uplo, lapack_int n,
lapack_int info = 0;
if( matrix_layout == LAPACK_COL_MAJOR ) {
/* Call LAPACK function and adjust info */
LAPACK_zsytrf( &uplo, &n, a, &lda, ipiv, work, &lwork, &info );
LAPACK_zsytrf_aa( &uplo, &n, a, &lda, ipiv, work, &lwork, &info );
if( info < 0 ) {
info = info - 1;
}
@ -56,7 +56,7 @@ lapack_int LAPACKE_zsytrf_aa_work( int matrix_layout, char uplo, lapack_int n,
}
/* Query optimal working array(s) size if requested */
if( lwork == -1 ) {
LAPACK_zsytrf( &uplo, &n, a, &lda_t, ipiv, work, &lwork, &info );
LAPACK_zsytrf_aa( &uplo, &n, a, &lda_t, ipiv, work, &lwork, &info );
return (info < 0) ? (info - 1) : info;
}
/* Allocate memory for temporary array(s) */
@ -69,7 +69,7 @@ lapack_int LAPACKE_zsytrf_aa_work( int matrix_layout, char uplo, lapack_int n,
/* Transpose input matrices */
LAPACKE_zsy_trans( matrix_layout, uplo, n, a, lda, a_t, lda_t );
/* Call LAPACK function and adjust info */
LAPACK_zsytrf( &uplo, &n, a_t, &lda_t, ipiv, work, &lwork, &info );
LAPACK_zsytrf_aa( &uplo, &n, a_t, &lda_t, ipiv, work, &lwork, &info );
if( info < 0 ) {
info = info - 1;
}

View File

@ -701,7 +701,7 @@
LWSVDJ = MAX( 2 * N, 1 )
LWSVDJV = MAX( 2 * N, 1 )
* .. minimal REAL workspace length for CGEQP3, CPOCON, CGESVJ
LRWQP3 = N
LRWQP3 = 2 * N
LRWCON = N
LRWSVDJ = N
IF ( LQUERY ) THEN
@ -939,7 +939,7 @@
END IF
END IF
MINWRK = MAX( 2, MINWRK )
OPTWRK = MAX( 2, OPTWRK )
OPTWRK = MAX( OPTWRK, MINWRK )
IF ( LWORK .LT. MINWRK .AND. (.NOT.LQUERY) ) INFO = - 17
IF ( LRWORK .LT. MINRWRK .AND. (.NOT.LQUERY) ) INFO = - 19
END IF

View File

@ -209,6 +209,8 @@
INFO = -5
ELSE IF( LDB.LT.MAX( 1, N ) ) THEN
INFO = -8
ELSE IF( LWORK.LT.MAX( 2*N, 3*N-2 ) .AND. .NOT.LQUERY ) THEN
INFO = -10
END IF
*
IF( INFO.EQ.0 ) THEN
@ -219,9 +221,6 @@
LWKOPT_HETRS = INT( WORK(1) )
LWKOPT = MAX( LWKOPT_HETRF, LWKOPT_HETRS )
WORK( 1 ) = LWKOPT
IF( LWORK.LT.LWKOPT .AND. .NOT.LQUERY ) THEN
INFO = -10
END IF
END IF
*
IF( INFO.NE.0 ) THEN

View File

@ -105,6 +105,7 @@
*>
*> \param[in] LTB
*> \verbatim
*> LTB is INTEGER
*> The size of the array TB. LTB >= 4*N, internally
*> used to select NB such that LTB >= (3*NB+1)*N.
*>
@ -124,7 +125,7 @@
*>
*> \param[out] IPIV2
*> \verbatim
*> IPIV is INTEGER array, dimension (N)
*> IPIV2 is INTEGER array, dimension (N)
*> On exit, it contains the details of the interchanges, i.e.,
*> the row and column k of T were interchanged with the
*> row and column IPIV(k).
@ -150,6 +151,7 @@
*>
*> \param[in] LWORK
*> \verbatim
*> LWORK is INTEGER
*> The size of WORK. LWORK >= N, internally used to select NB
*> such that LWORK >= N*NB.
*>
@ -233,19 +235,18 @@
INFO = -3
ELSE IF( LDA.LT.MAX( 1, N ) ) THEN
INFO = -5
ELSE IF( LTB.LT.( 4*N ) .AND. .NOT.TQUERY ) THEN
INFO = -7
ELSE IF( LDB.LT.MAX( 1, N ) ) THEN
INFO = -11
ELSE IF( LWORK.LT.N .AND. .NOT.WQUERY ) THEN
INFO = -13
END IF
*
IF( INFO.EQ.0 ) THEN
CALL CHETRF_AA_2STAGE( UPLO, N, A, LDA, TB, -1, IPIV,
$ IPIV2, WORK, -1, INFO )
LWKOPT = INT( WORK(1) )
IF( LTB.LT.INT( TB(1) ) .AND. .NOT.TQUERY ) THEN
INFO = -7
ELSE IF( LWORK.LT.LWKOPT .AND. .NOT.WQUERY ) THEN
INFO = -13
END IF
END IF
*
IF( INFO.NE.0 ) THEN
@ -270,6 +271,8 @@
END IF
*
WORK( 1 ) = LWKOPT
*
RETURN
*
* End of CHESV_AA_2STAGE
*

View File

@ -93,6 +93,7 @@
*>
*> \param[in] LTB
*> \verbatim
*> LTB is INTEGER
*> The size of the array TB. LTB >= 4*N, internally
*> used to select NB such that LTB >= (3*NB+1)*N.
*>
@ -112,7 +113,7 @@
*>
*> \param[out] IPIV2
*> \verbatim
*> IPIV is INTEGER array, dimension (N)
*> IPIV2 is INTEGER array, dimension (N)
*> On exit, it contains the details of the interchanges, i.e.,
*> the row and column k of T were interchanged with the
*> row and column IPIV(k).
@ -125,6 +126,7 @@
*>
*> \param[in] LWORK
*> \verbatim
*> LWORK is INTEGER
*> The size of WORK. LWORK >= N, internally used to select NB
*> such that LWORK >= N*NB.
*>
@ -658,6 +660,8 @@ c $ (J+1)*NB+1, (J+1)*NB+KB, IPIV, 1 )
*
* Factor the band matrix
CALL CGBTRF( N, N, NB, NB, TB, LDTB, IPIV2, INFO )
*
RETURN
*
* End of CHETRF_AA_2STAGE
*

View File

@ -87,6 +87,7 @@
*>
*> \param[in] LTB
*> \verbatim
*> LTB is INTEGER
*> The size of the array TB. LTB >= 4*N.
*> \endverbatim
*>

View File

@ -241,7 +241,7 @@
INFO = 10
END IF
IF( INFO.NE.0 )THEN
CALL XERBLA( 'SSYMV ', INFO )
CALL XERBLA( 'CLA_SYAMV', INFO )
RETURN
END IF
*

View File

@ -142,6 +142,13 @@
CABS1( CDUM ) = ABS( REAL( CDUM ) ) + ABS( AIMAG( CDUM ) )
* ..
* .. Executable Statements ..
*
* Quick return if possible
*
IF( N.NE.2 .AND. N.NE.3 ) THEN
RETURN
END IF
*
IF( N.EQ.2 ) THEN
S = CABS1( H( 1, 1 )-S2 ) + CABS1( H( 2, 1 ) )
IF( S.EQ.RZERO ) THEN

View File

@ -221,9 +221,6 @@
LWKOPT_SYTRS = INT( WORK(1) )
LWKOPT = MAX( LWKOPT_SYTRF, LWKOPT_SYTRS )
WORK( 1 ) = LWKOPT
IF( LWORK.LT.LWKOPT .AND. .NOT.LQUERY ) THEN
INFO = -10
END IF
END IF
*
IF( INFO.NE.0 ) THEN

View File

@ -105,6 +105,7 @@
*>
*> \param[in] LTB
*> \verbatim
*> LTB is INTEGER
*> The size of the array TB. LTB >= 4*N, internally
*> used to select NB such that LTB >= (3*NB+1)*N.
*>
@ -124,7 +125,7 @@
*>
*> \param[out] IPIV2
*> \verbatim
*> IPIV is INTEGER array, dimension (N)
*> IPIV2 is INTEGER array, dimension (N)
*> On exit, it contains the details of the interchanges, i.e.,
*> the row and column k of T were interchanged with the
*> row and column IPIV(k).
@ -150,6 +151,7 @@
*>
*> \param[in] LWORK
*> \verbatim
*> LWORK is INTEGER
*> The size of WORK. LWORK >= N, internally used to select NB
*> such that LWORK >= N*NB.
*>
@ -233,19 +235,18 @@
INFO = -3
ELSE IF( LDA.LT.MAX( 1, N ) ) THEN
INFO = -5
ELSE IF( LTB.LT.( 4*N ) .AND. .NOT.TQUERY ) THEN
INFO = -7
ELSE IF( LDB.LT.MAX( 1, N ) ) THEN
INFO = -11
ELSE IF( LWORK.LT.N .AND. .NOT.WQUERY ) THEN
INFO = -13
END IF
*
IF( INFO.EQ.0 ) THEN
CALL CSYTRF_AA_2STAGE( UPLO, N, A, LDA, TB, -1, IPIV,
$ IPIV2, WORK, -1, INFO )
LWKOPT = INT( WORK(1) )
IF( LTB.LT.INT( TB(1) ) .AND. .NOT.TQUERY ) THEN
INFO = -7
ELSE IF( LWORK.LT.LWKOPT .AND. .NOT.WQUERY ) THEN
INFO = -13
END IF
END IF
*
IF( INFO.NE.0 ) THEN
@ -270,6 +271,8 @@
END IF
*
WORK( 1 ) = LWKOPT
*
RETURN
*
* End of CSYSV_AA_2STAGE
*

View File

@ -93,6 +93,7 @@
*>
*> \param[in] LTB
*> \verbatim
*> LTB is INTEGER
*> The size of the array TB. LTB >= 4*N, internally
*> used to select NB such that LTB >= (3*NB+1)*N.
*>
@ -112,7 +113,7 @@
*>
*> \param[out] IPIV2
*> \verbatim
*> IPIV is INTEGER array, dimension (N)
*> IPIV2 is INTEGER array, dimension (N)
*> On exit, it contains the details of the interchanges, i.e.,
*> the row and column k of T were interchanged with the
*> row and column IPIV(k).
@ -125,6 +126,7 @@
*>
*> \param[in] LWORK
*> \verbatim
*> LWORK is INTEGER
*> The size of WORK. LWORK >= N, internally used to select NB
*> such that LWORK >= N*NB.
*>
@ -662,6 +664,8 @@ c $ (J+1)*NB+1, (J+1)*NB+KB, IPIV, 1 )
*
* Factor the band matrix
CALL CGBTRF( N, N, NB, NB, TB, LDTB, IPIV2, INFO )
*
RETURN
*
* End of CSYTRF_AA_2STAGE
*

View File

@ -96,11 +96,11 @@
*> LWORK is INTEGER
*> The dimension of the array WORK.
*> WORK is size >= (N+NB+1)*(NB+3)
*> If LDWORK = -1, then a workspace query is assumed; the routine
*> If LWORK = -1, then a workspace query is assumed; the routine
*> calculates:
*> - the optimal size of the WORK array, returns
*> this value as the first entry of the WORK array,
*> - and no error message related to LDWORK is issued by XERBLA.
*> - and no error message related to LWORK is issued by XERBLA.
*> \endverbatim
*>
*> \param[out] INFO
@ -163,7 +163,7 @@
UPPER = LSAME( UPLO, 'U' )
LQUERY = ( LWORK.EQ.-1 )
* Get blocksize
NBMAX = ILAENV( 1, 'CSYTRF', UPLO, N, -1, -1, -1 )
NBMAX = ILAENV( 1, 'CSYTRI2', UPLO, N, -1, -1, -1 )
IF ( NBMAX .GE. N ) THEN
MINSIZE = N
ELSE

View File

@ -85,6 +85,7 @@
*>
*> \param[in] LTB
*> \verbatim
*> LTB is INTEGER
*> The size of the array TB. LTB >= 4*N.
*> \endverbatim
*>

View File

@ -27,8 +27,8 @@
* ..
* .. Array Arguments ..
* LOGICAL SELECT( * )
* REAL RWORK( * )
* COMPLEX T( LDT, * ), VL( LDVL, * ), VR( LDVR, * ),
* REAL RWORK( * )
* COMPLEX T( LDT, * ), VL( LDVL, * ), VR( LDVR, * ),
* $ WORK( * )
* ..
*
@ -258,17 +258,17 @@
* ..
* .. Array Arguments ..
LOGICAL SELECT( * )
REAL RWORK( * )
COMPLEX T( LDT, * ), VL( LDVL, * ), VR( LDVR, * ),
REAL RWORK( * )
COMPLEX T( LDT, * ), VL( LDVL, * ), VR( LDVR, * ),
$ WORK( * )
* ..
*
* =====================================================================
*
* .. Parameters ..
REAL ZERO, ONE
REAL ZERO, ONE
PARAMETER ( ZERO = 0.0E+0, ONE = 1.0E+0 )
COMPLEX CZERO, CONE
COMPLEX CZERO, CONE
PARAMETER ( CZERO = ( 0.0E+0, 0.0E+0 ),
$ CONE = ( 1.0E+0, 0.0E+0 ) )
INTEGER NBMIN, NBMAX
@ -277,13 +277,13 @@
* .. Local Scalars ..
LOGICAL ALLV, BOTHV, LEFTV, LQUERY, OVER, RIGHTV, SOMEV
INTEGER I, II, IS, J, K, KI, IV, MAXWRK, NB
REAL OVFL, REMAX, SCALE, SMIN, SMLNUM, ULP, UNFL
COMPLEX CDUM
REAL OVFL, REMAX, SCALE, SMIN, SMLNUM, ULP, UNFL
COMPLEX CDUM
* ..
* .. External Functions ..
LOGICAL LSAME
INTEGER ILAENV, ICAMAX
REAL SLAMCH, SCASUM
REAL SLAMCH, SCASUM
EXTERNAL LSAME, ILAENV, ICAMAX, SLAMCH, SCASUM
* ..
* .. External Subroutines ..

View File

@ -158,7 +158,7 @@
INTEGER I, IB, IINFO, K
* ..
* .. External Subroutines ..
EXTERNAL DGEQRT2, DGELQT3, DGEQRT3, DLARFB, XERBLA
EXTERNAL DGELQT3, DLARFB, XERBLA
* ..
* .. Executable Statements ..
*

View File

@ -230,7 +230,7 @@
INFO = 10
END IF
IF( INFO.NE.0 )THEN
CALL XERBLA( 'DSYMV ', INFO )
CALL XERBLA( 'DLA_SYAMV', INFO )
RETURN
END IF
*

View File

@ -147,6 +147,13 @@
INTRINSIC ABS
* ..
* .. Executable Statements ..
*
* Quick return if possible
*
IF( N.NE.2 .AND. N.NE.3 ) THEN
RETURN
END IF
*
IF( N.EQ.2 ) THEN
S = ABS( H( 1, 1 )-SR2 ) + ABS( SI2 ) + ABS( H( 2, 1 ) )
IF( S.EQ.ZERO ) THEN

View File

@ -221,9 +221,6 @@
LWKOPT_SYTRS = INT( WORK(1) )
LWKOPT = MAX( LWKOPT_SYTRF, LWKOPT_SYTRS )
WORK( 1 ) = LWKOPT
IF( LWORK.LT.LWKOPT .AND. .NOT.LQUERY ) THEN
INFO = -10
END IF
END IF
*
IF( INFO.NE.0 ) THEN

View File

@ -107,6 +107,7 @@
*>
*> \param[in] LTB
*> \verbatim
*> LTB is INTEGER
*> The size of the array TB. LTB >= 4*N, internally
*> used to select NB such that LTB >= (3*NB+1)*N.
*>
@ -126,7 +127,7 @@
*>
*> \param[out] IPIV2
*> \verbatim
*> IPIV is INTEGER array, dimension (N)
*> IPIV2 is INTEGER array, dimension (N)
*> On exit, it contains the details of the interchanges, i.e.,
*> the row and column k of T were interchanged with the
*> row and column IPIV(k).
@ -152,6 +153,7 @@
*>
*> \param[in] LWORK
*> \verbatim
*> LWORK is INTEGER
*> The size of WORK. LWORK >= N, internally used to select NB
*> such that LWORK >= N*NB.
*>
@ -235,19 +237,18 @@
INFO = -3
ELSE IF( LDA.LT.MAX( 1, N ) ) THEN
INFO = -5
ELSE IF( LTB.LT.( 4*N ) .AND. .NOT.TQUERY ) THEN
INFO = -7
ELSE IF( LDB.LT.MAX( 1, N ) ) THEN
INFO = -11
ELSE IF( LWORK.LT.N .AND. .NOT.WQUERY ) THEN
INFO = -13
END IF
*
IF( INFO.EQ.0 ) THEN
CALL DSYTRF_AA_2STAGE( UPLO, N, A, LDA, TB, -1, IPIV,
$ IPIV2, WORK, -1, INFO )
LWKOPT = INT( WORK(1) )
IF( LTB.LT.INT( TB(1) ) .AND. .NOT.TQUERY ) THEN
INFO = -7
ELSE IF( LWORK.LT.LWKOPT .AND. .NOT.WQUERY ) THEN
INFO = -13
END IF
END IF
*
IF( INFO.NE.0 ) THEN

View File

@ -93,6 +93,7 @@
*>
*> \param[in] LTB
*> \verbatim
*> LTB is INTEGER
*> The size of the array TB. LTB >= 4*N, internally
*> used to select NB such that LTB >= (3*NB+1)*N.
*>
@ -109,6 +110,7 @@
*>
*> \param[in] LWORK
*> \verbatim
*> LWORK is INTEGER
*> The size of WORK. LWORK >= N, internally used to select NB
*> such that LWORK >= N*NB.
*>
@ -128,10 +130,10 @@
*>
*> \param[out] IPIV2
*> \verbatim
*> IPIV is INTEGER array, dimension (N)
*> IPIV2 is INTEGER array, dimension (N)
*> On exit, it contains the details of the interchanges, i.e.,
*> the row and column k of T were interchanged with the
*> row and column IPIV(k).
*> row and column IPIV2(k).
*> \endverbatim
*>
*> \param[out] INFO
@ -641,6 +643,8 @@ c $ (J+1)*NB+1, (J+1)*NB+KB, IPIV, 1 )
*
* Factor the band matrix
CALL DGBTRF( N, N, NB, NB, TB, LDTB, IPIV2, INFO )
*
RETURN
*
* End of DSYTRF_AA_2STAGE
*

View File

@ -96,11 +96,11 @@
*> LWORK is INTEGER
*> The dimension of the array WORK.
*> WORK is size >= (N+NB+1)*(NB+3)
*> If LDWORK = -1, then a workspace query is assumed; the routine
*> If LWORK = -1, then a workspace query is assumed; the routine
*> calculates:
*> - the optimal size of the WORK array, returns
*> this value as the first entry of the WORK array,
*> - and no error message related to LDWORK is issued by XERBLA.
*> - and no error message related to LWORK is issued by XERBLA.
*> \endverbatim
*>
*> \param[out] INFO
@ -163,7 +163,7 @@
UPPER = LSAME( UPLO, 'U' )
LQUERY = ( LWORK.EQ.-1 )
* Get blocksize
NBMAX = ILAENV( 1, 'DSYTRF', UPLO, N, -1, -1, -1 )
NBMAX = ILAENV( 1, 'DSYTRI2', UPLO, N, -1, -1, -1 )
IF ( NBMAX .GE. N ) THEN
MINSIZE = N
ELSE

View File

@ -85,6 +85,7 @@
*>
*> \param[in] LTB
*> \verbatim
*> LTB is INTEGER
*> The size of the array TB. LTB >= 4*N.
*> \endverbatim
*>

View File

@ -45,9 +45,9 @@
*> The right eigenvector x and the left eigenvector y of T corresponding
*> to an eigenvalue w are defined by:
*>
*> T*x = w*x, (y**H)*T = w*(y**H)
*> T*x = w*x, (y**T)*T = w*(y**T)
*>
*> where y**H denotes the conjugate transpose of y.
*> where y**T denotes the transpose of the vector y.
*> The eigenvalues are not input to this routine, but are read directly
*> from the diagonal blocks of T.
*>

View File

@ -104,13 +104,13 @@
*>
*> \param[in] NAME
*> \verbatim
*> NAME is character string
*> NAME is CHARACTER string
*> Name of the calling subroutine
*> \endverbatim
*>
*> \param[in] OPTS
*> \verbatim
*> OPTS is character string
*> OPTS is CHARACTER string
*> This is a concatenation of the string arguments to
*> TTQRE.
*> \endverbatim

View File

@ -230,7 +230,7 @@
INFO = 10
END IF
IF( INFO.NE.0 )THEN
CALL XERBLA( 'SSYMV ', INFO )
CALL XERBLA( 'SLA_SYAMV', INFO )
RETURN
END IF
*

View File

@ -147,6 +147,13 @@
INTRINSIC ABS
* ..
* .. Executable Statements ..
*
* Quick return if possible
*
IF( N.NE.2 .AND. N.NE.3 ) THEN
RETURN
END IF
*
IF( N.EQ.2 ) THEN
S = ABS( H( 1, 1 )-SR2 ) + ABS( SI2 ) + ABS( H( 2, 1 ) )
IF( S.EQ.ZERO ) THEN

View File

@ -220,9 +220,6 @@
LWKOPT_SYTRS = INT( WORK(1) )
LWKOPT = MAX( LWKOPT_SYTRF, LWKOPT_SYTRS )
WORK( 1 ) = LWKOPT
IF( LWORK.LT.LWKOPT .AND. .NOT.LQUERY ) THEN
INFO = -10
END IF
END IF
*
IF( INFO.NE.0 ) THEN

View File

@ -106,6 +106,7 @@
*>
*> \param[in] LTB
*> \verbatim
*> LTB is INTEGER
*> The size of the array TB. LTB >= 4*N, internally
*> used to select NB such that LTB >= (3*NB+1)*N.
*>
@ -125,7 +126,7 @@
*>
*> \param[out] IPIV2
*> \verbatim
*> IPIV is INTEGER array, dimension (N)
*> IPIV2 is INTEGER array, dimension (N)
*> On exit, it contains the details of the interchanges, i.e.,
*> the row and column k of T were interchanged with the
*> row and column IPIV(k).
@ -151,6 +152,7 @@
*>
*> \param[in] LWORK
*> \verbatim
*> LWORK is INTEGER
*> The size of WORK. LWORK >= N, internally used to select NB
*> such that LWORK >= N*NB.
*>
@ -234,19 +236,18 @@
INFO = -3
ELSE IF( LDA.LT.MAX( 1, N ) ) THEN
INFO = -5
ELSE IF( LTB.LT.( 4*N ) .AND. .NOT.TQUERY ) THEN
INFO = -7
ELSE IF( LDB.LT.MAX( 1, N ) ) THEN
INFO = -11
ELSE IF( LWORK.LT.N .AND. .NOT.WQUERY ) THEN
INFO = -13
END IF
*
IF( INFO.EQ.0 ) THEN
CALL SSYTRF_AA_2STAGE( UPLO, N, A, LDA, TB, -1, IPIV,
$ IPIV2, WORK, -1, INFO )
LWKOPT = INT( WORK(1) )
IF( LTB.LT.INT( TB(1) ) .AND. .NOT.TQUERY ) THEN
INFO = -7
ELSE IF( LWORK.LT.LWKOPT .AND. .NOT.WQUERY ) THEN
INFO = -13
END IF
END IF
*
IF( INFO.NE.0 ) THEN

View File

@ -93,6 +93,7 @@
*>
*> \param[in] LTB
*> \verbatim
*> LTB is INTEGER
*> The size of the array TB. LTB >= 4*N, internally
*> used to select NB such that LTB >= (3*NB+1)*N.
*>
@ -112,7 +113,7 @@
*>
*> \param[out] IPIV2
*> \verbatim
*> IPIV is INTEGER array, dimension (N)
*> IPIV2 is INTEGER array, dimension (N)
*> On exit, it contains the details of the interchanges, i.e.,
*> the row and column k of T were interchanged with the
*> row and column IPIV(k).
@ -125,6 +126,7 @@
*>
*> \param[in] LWORK
*> \verbatim
*> LWORK is INTEGER
*> The size of WORK. LWORK >= N, internally used to select NB
*> such that LWORK >= N*NB.
*>
@ -641,6 +643,8 @@ c $ (J+1)*NB+1, (J+1)*NB+KB, IPIV, 1 )
*
* Factor the band matrix
CALL SGBTRF( N, N, NB, NB, TB, LDTB, IPIV2, INFO )
*
RETURN
*
* End of SSYTRF_AA_2STAGE
*

View File

@ -96,11 +96,11 @@
*> LWORK is INTEGER
*> The dimension of the array WORK.
*> WORK is size >= (N+NB+1)*(NB+3)
*> If LDWORK = -1, then a workspace query is assumed; the routine
*> If LWORK = -1, then a workspace query is assumed; the routine
*> calculates:
*> - the optimal size of the WORK array, returns
*> this value as the first entry of the WORK array,
*> - and no error message related to LDWORK is issued by XERBLA.
*> - and no error message related to LWORK is issued by XERBLA.
*> \endverbatim
*>
*> \param[out] INFO

View File

@ -85,6 +85,7 @@
*>
*> \param[in] LTB
*> \verbatim
*> LTB is INTEGER
*> The size of the array TB. LTB >= 4*N.
*> \endverbatim
*>

View File

@ -27,7 +27,7 @@
* ..
* .. Array Arguments ..
* LOGICAL SELECT( * )
* REAL T( LDT, * ), VL( LDVL, * ), VR( LDVR, * ),
* REAL T( LDT, * ), VL( LDVL, * ), VR( LDVR, * ),
* $ WORK( * )
* ..
*
@ -45,9 +45,9 @@
*> The right eigenvector x and the left eigenvector y of T corresponding
*> to an eigenvalue w are defined by:
*>
*> T*x = w*x, (y**H)*T = w*(y**H)
*> T*x = w*x, (y**T)*T = w*(y**T)
*>
*> where y**H denotes the conjugate transpose of y.
*> where y**T denotes the transpose of the vector y.
*> The eigenvalues are not input to this routine, but are read directly
*> from the diagonal blocks of T.
*>
@ -251,14 +251,14 @@
* ..
* .. Array Arguments ..
LOGICAL SELECT( * )
REAL T( LDT, * ), VL( LDVL, * ), VR( LDVR, * ),
REAL T( LDT, * ), VL( LDVL, * ), VR( LDVR, * ),
$ WORK( * )
* ..
*
* =====================================================================
*
* .. Parameters ..
REAL ZERO, ONE
REAL ZERO, ONE
PARAMETER ( ZERO = 0.0E+0, ONE = 1.0E+0 )
INTEGER NBMIN, NBMAX
PARAMETER ( NBMIN = 8, NBMAX = 128 )
@ -268,7 +268,7 @@
$ RIGHTV, SOMEV
INTEGER I, IERR, II, IP, IS, J, J1, J2, JNXT, K, KI,
$ IV, MAXWRK, NB, KI2
REAL BETA, BIGNUM, EMAX, OVFL, REC, REMAX, SCALE,
REAL BETA, BIGNUM, EMAX, OVFL, REC, REMAX, SCALE,
$ SMIN, SMLNUM, ULP, UNFL, VCRIT, VMAX, WI, WR,
$ XNORM
* ..

View File

@ -704,7 +704,7 @@
LWSVDJ = MAX( 2 * N, 1 )
LWSVDJV = MAX( 2 * N, 1 )
* .. minimal REAL workspace length for ZGEQP3, ZPOCON, ZGESVJ
LRWQP3 = N
LRWQP3 = 2 * N
LRWCON = N
LRWSVDJ = N
IF ( LQUERY ) THEN
@ -942,7 +942,7 @@
END IF
END IF
MINWRK = MAX( 2, MINWRK )
OPTWRK = MAX( 2, OPTWRK )
OPTWRK = MAX( MINWRK, OPTWRK )
IF ( LWORK .LT. MINWRK .AND. (.NOT.LQUERY) ) INFO = - 17
IF ( LRWORK .LT. MINRWRK .AND. (.NOT.LQUERY) ) INFO = - 19
END IF

View File

@ -209,6 +209,8 @@
INFO = -5
ELSE IF( LDB.LT.MAX( 1, N ) ) THEN
INFO = -8
ELSE IF( LWORK.LT.MAX(2*N, 3*N-2) .AND. .NOT.LQUERY ) THEN
INFO = -10
END IF
*
IF( INFO.EQ.0 ) THEN
@ -219,9 +221,6 @@
LWKOPT_HETRS = INT( WORK(1) )
LWKOPT = MAX( LWKOPT_HETRF, LWKOPT_HETRS )
WORK( 1 ) = LWKOPT
IF( LWORK.LT.LWKOPT .AND. .NOT.LQUERY ) THEN
INFO = -10
END IF
END IF
*
IF( INFO.NE.0 ) THEN

View File

@ -106,6 +106,7 @@
*>
*> \param[in] LTB
*> \verbatim
*> LTB is INTEGER
*> The size of the array TB. LTB >= 4*N, internally
*> used to select NB such that LTB >= (3*NB+1)*N.
*>
@ -125,7 +126,7 @@
*>
*> \param[out] IPIV2
*> \verbatim
*> IPIV is INTEGER array, dimension (N)
*> IPIV2 is INTEGER array, dimension (N)
*> On exit, it contains the details of the interchanges, i.e.,
*> the row and column k of T were interchanged with the
*> row and column IPIV(k).
@ -151,6 +152,7 @@
*>
*> \param[in] LWORK
*> \verbatim
*> LWORK is INTEGER
*> The size of WORK. LWORK >= N, internally used to select NB
*> such that LWORK >= N*NB.
*>
@ -240,19 +242,18 @@
INFO = -3
ELSE IF( LDA.LT.MAX( 1, N ) ) THEN
INFO = -5
ELSE IF( LTB.LT.( 4*N ) .AND. .NOT.TQUERY ) THEN
INFO = -7
ELSE IF( LDB.LT.MAX( 1, N ) ) THEN
INFO = -11
ELSE IF( LWORK.LT.N .AND. .NOT.WQUERY ) THEN
INFO = -13
END IF
*
IF( INFO.EQ.0 ) THEN
CALL ZHETRF_AA_2STAGE( UPLO, N, A, LDA, TB, -1, IPIV,
$ IPIV2, WORK, -1, INFO )
LWKOPT = INT( WORK(1) )
IF( LTB.LT.INT( TB(1) ) .AND. .NOT.TQUERY ) THEN
INFO = -7
ELSE IF( LWORK.LT.LWKOPT .AND. .NOT.WQUERY ) THEN
INFO = -13
END IF
END IF
*
IF( INFO.NE.0 ) THEN

View File

@ -93,6 +93,7 @@
*>
*> \param[in] LTB
*> \verbatim
*> LTB is INTEGER
*> The size of the array TB. LTB >= 4*N, internally
*> used to select NB such that LTB >= (3*NB+1)*N.
*>
@ -112,7 +113,7 @@
*>
*> \param[out] IPIV2
*> \verbatim
*> IPIV is INTEGER array, dimension (N)
*> IPIV2 is INTEGER array, dimension (N)
*> On exit, it contains the details of the interchanges, i.e.,
*> the row and column k of T were interchanged with the
*> row and column IPIV(k).
@ -125,6 +126,7 @@
*>
*> \param[in] LWORK
*> \verbatim
*> LWORK is INTEGER
*> The size of WORK. LWORK >= N, internally used to select NB
*> such that LWORK >= N*NB.
*>
@ -657,6 +659,8 @@ c $ (J+1)*NB+1, (J+1)*NB+KB, IPIV, 1 )
*
* Factor the band matrix
CALL ZGBTRF( N, N, NB, NB, TB, LDTB, IPIV2, INFO )
*
RETURN
*
* End of ZHETRF_AA_2STAGE
*

View File

@ -69,7 +69,7 @@
*>
*> \param[in] A
*> \verbatim
*> A is COMPLEX*16array, dimension (LDA,N)
*> A is COMPLEX*16 array, dimension (LDA,N)
*> Details of factors computed by ZHETRF_AA_2STAGE.
*> \endverbatim
*>
@ -81,12 +81,13 @@
*>
*> \param[out] TB
*> \verbatim
*> TB is COMPLEX*16array, dimension (LTB)
*> TB is COMPLEX*16 array, dimension (LTB)
*> Details of factors computed by ZHETRF_AA_2STAGE.
*> \endverbatim
*>
*> \param[in] LTB
*> \verbatim
*> LTB is INTEGER
*> The size of the array TB. LTB >= 4*N.
*> \endverbatim
*>
@ -106,7 +107,7 @@
*>
*> \param[in,out] B
*> \verbatim
*> B is COMPLEX*16array, dimension (LDB,NRHS)
*> B is COMPLEX*16 array, dimension (LDB,NRHS)
*> On entry, the right hand side matrix B.
*> On exit, the solution matrix X.
*> \endverbatim

View File

@ -241,7 +241,7 @@
INFO = 10
END IF
IF( INFO.NE.0 )THEN
CALL XERBLA( 'DSYMV ', INFO )
CALL XERBLA( 'ZLA_SYAMV', INFO )
RETURN
END IF
*

View File

@ -142,6 +142,13 @@
CABS1( CDUM ) = ABS( DBLE( CDUM ) ) + ABS( DIMAG( CDUM ) )
* ..
* .. Executable Statements ..
*
* Quick return if possible
*
IF( N.NE.2 .AND. N.NE.3 ) THEN
RETURN
END IF
*
IF( N.EQ.2 ) THEN
S = CABS1( H( 1, 1 )-S2 ) + CABS1( H( 2, 1 ) )
IF( S.EQ.RZERO ) THEN

View File

@ -221,9 +221,6 @@
LWKOPT_SYTRS = INT( WORK(1) )
LWKOPT = MAX( LWKOPT_SYTRF, LWKOPT_SYTRS )
WORK( 1 ) = LWKOPT
IF( LWORK.LT.LWKOPT .AND. .NOT.LQUERY ) THEN
INFO = -10
END IF
END IF
*
IF( INFO.NE.0 ) THEN

View File

@ -105,6 +105,7 @@
*>
*> \param[in] LTB
*> \verbatim
*> LTB is INTEGER
*> The size of the array TB. LTB >= 4*N, internally
*> used to select NB such that LTB >= (3*NB+1)*N.
*>
@ -124,7 +125,7 @@
*>
*> \param[out] IPIV2
*> \verbatim
*> IPIV is INTEGER array, dimension (N)
*> IPIV2 is INTEGER array, dimension (N)
*> On exit, it contains the details of the interchanges, i.e.,
*> the row and column k of T were interchanged with the
*> row and column IPIV(k).
@ -150,6 +151,7 @@
*>
*> \param[in] LWORK
*> \verbatim
*> LWORK is INTEGER
*> The size of WORK. LWORK >= N, internally used to select NB
*> such that LWORK >= N*NB.
*>
@ -233,19 +235,18 @@
INFO = -3
ELSE IF( LDA.LT.MAX( 1, N ) ) THEN
INFO = -5
ELSE IF( LTB.LT.( 4*N ) .AND. .NOT.TQUERY ) THEN
INFO = -7
ELSE IF( LDB.LT.MAX( 1, N ) ) THEN
INFO = -11
ELSE IF( LWORK.LT.N .AND. .NOT.WQUERY ) THEN
INFO = -13
END IF
*
IF( INFO.EQ.0 ) THEN
CALL ZSYTRF_AA_2STAGE( UPLO, N, A, LDA, TB, -1, IPIV,
$ IPIV2, WORK, -1, INFO )
LWKOPT = INT( WORK(1) )
IF( LTB.LT.INT( TB(1) ) .AND. .NOT.TQUERY ) THEN
INFO = -7
ELSE IF( LWORK.LT.LWKOPT .AND. .NOT.WQUERY ) THEN
INFO = -13
END IF
END IF
*
IF( INFO.NE.0 ) THEN

View File

@ -93,6 +93,7 @@
*>
*> \param[in] LTB
*> \verbatim
*> LTB is INTEGER
*> The size of the array TB. LTB >= 4*N, internally
*> used to select NB such that LTB >= (3*NB+1)*N.
*>
@ -112,7 +113,7 @@
*>
*> \param[out] IPIV2
*> \verbatim
*> IPIV is INTEGER array, dimension (N)
*> IPIV2 is INTEGER array, dimension (N)
*> On exit, it contains the details of the interchanges, i.e.,
*> the row and column k of T were interchanged with the
*> row and column IPIV(k).
@ -125,6 +126,7 @@
*>
*> \param[in] LWORK
*> \verbatim
*> LWORK is INTEGER
*> The size of WORK. LWORK >= N, internally used to select NB
*> such that LWORK >= N*NB.
*>
@ -662,6 +664,8 @@ c $ (J+1)*NB+1, (J+1)*NB+KB, IPIV, 1 )
*
* Factor the band matrix
CALL ZGBTRF( N, N, NB, NB, TB, LDTB, IPIV2, INFO )
*
RETURN
*
* End of ZSYTRF_AA_2STAGE
*

View File

@ -163,7 +163,7 @@
UPPER = LSAME( UPLO, 'U' )
LQUERY = ( LWORK.EQ.-1 )
* Get blocksize
NBMAX = ILAENV( 1, 'ZSYTRF', UPLO, N, -1, -1, -1 )
NBMAX = ILAENV( 1, 'ZSYTRI2', UPLO, N, -1, -1, -1 )
IF ( NBMAX .GE. N ) THEN
MINSIZE = N
ELSE

View File

@ -85,6 +85,7 @@
*>
*> \param[in] LTB
*> \verbatim
*> LTB is INTEGER
*> The size of the array TB. LTB >= 4*N.
*> \endverbatim
*>

View File

@ -218,7 +218,7 @@
* ..
* .. External Subroutines ..
EXTERNAL ALAERH, ALAHD, ALASUM, DERRSY, DLACPY, DLARHS,
$ DLATB4, DLATMS, DPOT02, DSYTRF_AA_2STAGE
$ DLATB4, DLATMS, DPOT02, DSYTRF_AA_2STAGE,
$ DSYTRS_AA_2STAGE, XLAENV
* ..
* .. Intrinsic Functions ..

View File

@ -204,7 +204,7 @@
* .. External Subroutines ..
EXTERNAL ALADHD, ALAERH, ALASVM, XLAENV, DERRVX,
$ DGET04, DLACPY, DLARHS, DLATB4, DLATMS,
$ DSYSV_AA_2STAGE, CHET01_AA, DPOT02,
$ DSYSV_AA_2STAGE, DPOT02,
$ DSYTRF_AA_2STAGE
* ..
* .. Scalars in Common ..

View File

@ -203,7 +203,7 @@
* ..
* .. External Subroutines ..
EXTERNAL ALADHD, ALAERH, ALASVM, XLAENV, SERRVX,
$ CGET04, SLACPY, SLARHS, SLATB4, SLATMS,
$ SLACPY, SLARHS, SLATB4, SLATMS,
$ SSYSV_AA_2STAGE, SSYT01_AA, SPOT02,
$ SSYTRF_AA_2STAGE
* ..

View File

@ -217,8 +217,8 @@
DOUBLE PRECISION RESULT( NTESTS )
* ..
* .. External Subroutines ..
EXTERNAL ALAERH, ALAHD, ALASUM, CERRSY, ZLACPY, ZLARHS,
$ CLATB4, ZLATMS, ZSYT02, ZSYT01,
EXTERNAL ALAERH, ALAHD, ALASUM, ZERRSY, ZLACPY, ZLARHS,
$ ZLATB4, ZLATMS, ZSYT02, ZSYT01,
$ ZSYTRF_AA_2STAGE, ZSYTRS_AA_2STAGE,
$ XLAENV
* ..