297 SUBROUTINE chegvx( ITYPE, JOBZ, RANGE, UPLO, N, A, LDA, B, LDB,
298 $ vl, vu, il, iu, abstol, m, w, z, ldz, work,
299 $ lwork, rwork, iwork, ifail, info )
307 CHARACTER jobz, range, uplo
308 INTEGER il, info, itype, iu, lda, ldb, ldz, lwork, m, n
312 INTEGER ifail( * ), iwork( * )
313 REAL rwork( * ), w( * )
314 COMPLEX a( lda, * ), b( ldb, * ), work( * ),
322 parameter( cone = ( 1.0e+0, 0.0e+0 ) )
325 LOGICAL alleig, indeig, lquery, upper, valeig, wantz
344 wantz =
lsame( jobz,
'V' )
345 upper =
lsame( uplo,
'U' )
346 alleig =
lsame( range,
'A' )
347 valeig =
lsame( range,
'V' )
348 indeig =
lsame( range,
'I' )
349 lquery = ( lwork.EQ.-1 )
352 IF( itype.LT.1 .OR. itype.GT.3 )
THEN
354 ELSE IF( .NOT.( wantz .OR.
lsame( jobz,
'N' ) ) )
THEN
356 ELSE IF( .NOT.( alleig .OR. valeig .OR. indeig ) )
THEN
358 ELSE IF( .NOT.( upper .OR.
lsame( uplo,
'L' ) ) )
THEN
360 ELSE IF( n.LT.0 )
THEN
362 ELSE IF( lda.LT.max( 1, n ) )
THEN
364 ELSE IF( ldb.LT.max( 1, n ) )
THEN
368 IF( n.GT.0 .AND. vu.LE.vl )
370 ELSE IF( indeig )
THEN
371 IF( il.LT.1 .OR. il.GT.max( 1, n ) )
THEN
373 ELSE IF( iu.LT.min( n, il ) .OR. iu.GT.n )
THEN
379 IF (ldz.LT.1 .OR. (wantz .AND. ldz.LT.n))
THEN
385 nb =
ilaenv( 1,
'CHETRD', uplo, n, -1, -1, -1 )
386 lwkopt = max( 1, ( nb + 1 )*n )
389 IF( lwork.LT.max( 1, 2*n ) .AND. .NOT.lquery )
THEN
395 CALL
xerbla(
'CHEGVX', -info )
397 ELSE IF( lquery )
THEN
410 CALL
cpotrf( uplo, n, b, ldb, info )
418 CALL
chegst( itype, uplo, n, a, lda, b, ldb, info )
419 CALL
cheevx( jobz, range, uplo, n, a, lda, vl, vu, il, iu, abstol,
420 $ m, w, z, ldz, work, lwork, rwork, iwork, ifail,
429 IF( itype.EQ.1 .OR. itype.EQ.2 )
THEN
440 CALL
ctrsm(
'Left', uplo, trans,
'Non-unit', n, m, cone, b,
443 ELSE IF( itype.EQ.3 )
THEN
454 CALL
ctrmm(
'Left', uplo, trans,
'Non-unit', n, m, cone, b,