179 SUBROUTINE chegv( ITYPE, JOBZ, UPLO, N, A, LDA, B, LDB, W, WORK,
180 $ LWORK, RWORK, INFO )
188 INTEGER INFO, ITYPE, LDA, LDB, LWORK, N
191 REAL RWORK( * ), W( * )
192 COMPLEX A( LDA, * ), B( LDB, * ), WORK( * )
199 parameter( one = ( 1.0e+0, 0.0e+0 ) )
202 LOGICAL LQUERY, UPPER, WANTZ
204 INTEGER LWKOPT, NB, NEIG
210 EXTERNAL ilaenv, lsame, sroundup_lwork
222 wantz = lsame( jobz,
'V' )
223 upper = lsame( uplo,
'U' )
224 lquery = ( lwork.EQ. -1 )
227 IF( itype.LT.1 .OR. itype.GT.3 )
THEN
229 ELSE IF( .NOT.( wantz .OR. lsame( jobz,
'N' ) ) )
THEN
231 ELSE IF( .NOT.( upper .OR. lsame( uplo,
'L' ) ) )
THEN
233 ELSE IF( n.LT.0 )
THEN
235 ELSE IF( lda.LT.max( 1, n ) )
THEN
237 ELSE IF( ldb.LT.max( 1, n ) )
THEN
242 nb = ilaenv( 1,
'CHETRD', uplo, n, -1, -1, -1 )
243 lwkopt = max( 1, ( nb + 1 )*n )
244 work( 1 ) = sroundup_lwork(lwkopt)
246 IF( lwork.LT.max( 1, 2*n-1 ) .AND. .NOT.lquery )
THEN
252 CALL xerbla(
'CHEGV ', -info )
254 ELSE IF( lquery )
THEN
265 CALL cpotrf( uplo, n, b, ldb, info )
273 CALL chegst( itype, uplo, n, a, lda, b, ldb, info )
274 CALL cheev( jobz, uplo, n, a, lda, w, work, lwork, rwork, info )
283 IF( itype.EQ.1 .OR. itype.EQ.2 )
THEN
294 CALL ctrsm(
'Left', uplo, trans,
'Non-unit', n, neig, one,
297 ELSE IF( itype.EQ.3 )
THEN
308 CALL ctrmm(
'Left', uplo, trans,
'Non-unit', n, neig, one,
313 work( 1 ) = sroundup_lwork(lwkopt)
subroutine xerbla(srname, info)
subroutine cheev(jobz, uplo, n, a, lda, w, work, lwork, rwork, info)
CHEEV computes the eigenvalues and, optionally, the left and/or right eigenvectors for HE matrices
subroutine chegst(itype, uplo, n, a, lda, b, ldb, info)
CHEGST
subroutine chegv(itype, jobz, uplo, n, a, lda, b, ldb, w, work, lwork, rwork, info)
CHEGV
subroutine cpotrf(uplo, n, a, lda, info)
CPOTRF
subroutine ctrmm(side, uplo, transa, diag, m, n, alpha, a, lda, b, ldb)
CTRMM
subroutine ctrsm(side, uplo, transa, diag, m, n, alpha, a, lda, b, ldb)
CTRSM