181 SUBROUTINE chegv( ITYPE, JOBZ, UPLO, N, A, LDA, B, LDB, W, WORK,
182 $ lwork, rwork, info )
191 INTEGER info, itype, lda, ldb, lwork, n
194 REAL rwork( * ), w( * )
195 COMPLEX a( lda, * ), b( ldb, * ), work( * )
202 parameter( one = ( 1.0e+0, 0.0e+0 ) )
205 LOGICAL lquery, upper, wantz
207 INTEGER lwkopt, nb, neig
224 wantz =
lsame( jobz,
'V' )
225 upper =
lsame( uplo,
'U' )
226 lquery = ( lwork.EQ. -1 )
229 IF( itype.LT.1 .OR. itype.GT.3 )
THEN
231 ELSE IF( .NOT.( wantz .OR.
lsame( jobz,
'N' ) ) )
THEN
233 ELSE IF( .NOT.( upper .OR.
lsame( uplo,
'L' ) ) )
THEN
235 ELSE IF( n.LT.0 )
THEN
237 ELSE IF( lda.LT.max( 1, n ) )
THEN
239 ELSE IF( ldb.LT.max( 1, n ) )
THEN
244 nb =
ilaenv( 1,
'CHETRD', uplo, n, -1, -1, -1 )
245 lwkopt = max( 1, ( nb + 1 )*n )
248 IF( lwork.LT.max( 1, 2*n-1 ) .AND. .NOT.lquery )
THEN
254 CALL
xerbla(
'CHEGV ', -info )
256 ELSE IF( lquery )
THEN
267 CALL
cpotrf( uplo, n, b, ldb, info )
275 CALL
chegst( itype, uplo, n, a, lda, b, ldb, info )
276 CALL
cheev( jobz, uplo, n, a, lda, w, work, lwork, rwork, info )
285 IF( itype.EQ.1 .OR. itype.EQ.2 )
THEN
296 CALL
ctrsm(
'Left', uplo, trans,
'Non-unit', n, neig, one,
299 ELSE IF( itype.EQ.3 )
THEN
310 CALL
ctrmm(
'Left', uplo, trans,
'Non-unit', n, neig, one,