241 SUBROUTINE chegvd( ITYPE, JOBZ, UPLO, N, A, LDA, B, LDB, W, WORK,
242 $ LWORK, RWORK, LRWORK, IWORK, LIWORK, INFO )
250 INTEGER INFO, ITYPE, LDA, LDB, LIWORK, LRWORK, LWORK, N
254 REAL RWORK( * ), W( * )
255 COMPLEX A( LDA, * ), B( LDB, * ), WORK( * )
262 parameter( cone = ( 1.0e+0, 0.0e+0 ) )
265 LOGICAL LQUERY, UPPER, WANTZ
267 INTEGER LIOPT, LIWMIN, LOPT, LROPT, LRWMIN, LWMIN
272 EXTERNAL lsame, sroundup_lwork
284 wantz = lsame( jobz,
'V' )
285 upper = lsame( uplo,
'U' )
286 lquery = ( lwork.EQ.-1 .OR. lrwork.EQ.-1 .OR. liwork.EQ.-1 )
293 ELSE IF( wantz )
THEN
295 lrwmin = 1 + 5*n + 2*n*n
305 IF( itype.LT.1 .OR. itype.GT.3 )
THEN
307 ELSE IF( .NOT.( wantz .OR. lsame( jobz,
'N' ) ) )
THEN
309 ELSE IF( .NOT.( upper .OR. lsame( uplo,
'L' ) ) )
THEN
311 ELSE IF( n.LT.0 )
THEN
313 ELSE IF( lda.LT.max( 1, n ) )
THEN
315 ELSE IF( ldb.LT.max( 1, n ) )
THEN
320 work( 1 ) = sroundup_lwork(lopt)
324 IF( lwork.LT.lwmin .AND. .NOT.lquery )
THEN
326 ELSE IF( lrwork.LT.lrwmin .AND. .NOT.lquery )
THEN
328 ELSE IF( liwork.LT.liwmin .AND. .NOT.lquery )
THEN
334 CALL xerbla(
'CHEGVD', -info )
336 ELSE IF( lquery )
THEN
347 CALL cpotrf( uplo, n, b, ldb, info )
355 CALL chegst( itype, uplo, n, a, lda, b, ldb, info )
356 CALL cheevd( jobz, uplo, n, a, lda, w, work, lwork, rwork, lrwork,
357 $ iwork, liwork, info )
358 lopt = int( max( real( lopt ), real( work( 1 ) ) ) )
359 lropt = int( max( real( lropt ), real( rwork( 1 ) ) ) )
360 liopt = int( max( real( liopt ), real( iwork( 1 ) ) ) )
362 IF( wantz .AND. info.EQ.0 )
THEN
366 IF( itype.EQ.1 .OR. itype.EQ.2 )
THEN
377 CALL ctrsm(
'Left', uplo, trans,
'Non-unit', n, n, cone,
380 ELSE IF( itype.EQ.3 )
THEN
391 CALL ctrmm(
'Left', uplo, trans,
'Non-unit', n, n, cone,
396 work( 1 ) = sroundup_lwork(lopt)
subroutine xerbla(srname, info)
subroutine cheevd(jobz, uplo, n, a, lda, w, work, lwork, rwork, lrwork, iwork, liwork, info)
CHEEVD 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 chegvd(itype, jobz, uplo, n, a, lda, b, ldb, w, work, lwork, rwork, lrwork, iwork, liwork, info)
CHEGVD
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