127 SUBROUTINE zhegst( ITYPE, UPLO, N, A, LDA, B, LDB, INFO )
135 INTEGER INFO, ITYPE, LDA, LDB, N
138 COMPLEX*16 A( LDA, * ), B( LDB, * )
145 parameter( one = 1.0d+0 )
146 COMPLEX*16 CONE, HALF
147 parameter( cone = ( 1.0d+0, 0.0d+0 ),
148 $ half = ( 0.5d+0, 0.0d+0 ) )
163 EXTERNAL lsame, ilaenv
170 upper = lsame( uplo,
'U' )
171 IF( itype.LT.1 .OR. itype.GT.3 )
THEN
173 ELSE IF( .NOT.upper .AND. .NOT.lsame( uplo,
'L' ) )
THEN
175 ELSE IF( n.LT.0 )
THEN
177 ELSE IF( lda.LT.max( 1, n ) )
THEN
179 ELSE IF( ldb.LT.max( 1, n ) )
THEN
183 CALL xerbla(
'ZHEGST', -info )
194 nb = ilaenv( 1,
'ZHEGST', uplo, n, -1, -1, -1 )
196 IF( nb.LE.1 .OR. nb.GE.n )
THEN
200 CALL zhegs2( itype, uplo, n, a, lda, b, ldb, info )
205 IF( itype.EQ.1 )
THEN
211 kb = min( n-k+1, nb )
215 CALL zhegs2( itype, uplo, kb, a( k, k ), lda,
216 $ b( k, k ), ldb, info )
218 CALL ztrsm(
'Left', uplo,
'Conjugate transpose',
219 $
'Non-unit', kb, n-k-kb+1, cone,
220 $ b( k, k ), ldb, a( k, k+kb ), lda )
221 CALL zhemm(
'Left', uplo, kb, n-k-kb+1, -half,
222 $ a( k, k ), lda, b( k, k+kb ), ldb,
223 $ cone, a( k, k+kb ), lda )
224 CALL zher2k( uplo,
'Conjugate transpose', n-k-kb+1,
225 $ kb, -cone, a( k, k+kb ), lda,
226 $ b( k, k+kb ), ldb, one,
227 $ a( k+kb, k+kb ), lda )
228 CALL zhemm(
'Left', uplo, kb, n-k-kb+1, -half,
229 $ a( k, k ), lda, b( k, k+kb ), ldb,
230 $ cone, a( k, k+kb ), lda )
231 CALL ztrsm(
'Right', uplo,
'No transpose',
232 $
'Non-unit', kb, n-k-kb+1, cone,
233 $ b( k+kb, k+kb ), ldb, a( k, k+kb ),
242 kb = min( n-k+1, nb )
246 CALL zhegs2( itype, uplo, kb, a( k, k ), lda,
247 $ b( k, k ), ldb, info )
249 CALL ztrsm(
'Right', uplo,
'Conjugate transpose',
250 $
'Non-unit', n-k-kb+1, kb, cone,
251 $ b( k, k ), ldb, a( k+kb, k ), lda )
252 CALL zhemm(
'Right', uplo, n-k-kb+1, kb, -half,
253 $ a( k, k ), lda, b( k+kb, k ), ldb,
254 $ cone, a( k+kb, k ), lda )
255 CALL zher2k( uplo,
'No transpose', n-k-kb+1, kb,
256 $ -cone, a( k+kb, k ), lda,
257 $ b( k+kb, k ), ldb, one,
258 $ a( k+kb, k+kb ), lda )
259 CALL zhemm(
'Right', uplo, n-k-kb+1, kb, -half,
260 $ a( k, k ), lda, b( k+kb, k ), ldb,
261 $ cone, a( k+kb, k ), lda )
262 CALL ztrsm(
'Left', uplo,
'No transpose',
263 $
'Non-unit', n-k-kb+1, kb, cone,
264 $ b( k+kb, k+kb ), ldb, a( k+kb, k ),
275 kb = min( n-k+1, nb )
279 CALL ztrmm(
'Left', uplo,
'No transpose',
'Non-unit',
280 $ k-1, kb, cone, b, ldb, a( 1, k ), lda )
281 CALL zhemm(
'Right', uplo, k-1, kb, half, a( k, k ),
282 $ lda, b( 1, k ), ldb, cone, a( 1, k ),
284 CALL zher2k( uplo,
'No transpose', k-1, kb, cone,
285 $ a( 1, k ), lda, b( 1, k ), ldb, one, a,
287 CALL zhemm(
'Right', uplo, k-1, kb, half, a( k, k ),
288 $ lda, b( 1, k ), ldb, cone, a( 1, k ),
290 CALL ztrmm(
'Right', uplo,
'Conjugate transpose',
291 $
'Non-unit', k-1, kb, cone, b( k, k ), ldb,
293 CALL zhegs2( itype, uplo, kb, a( k, k ), lda,
294 $ b( k, k ), ldb, info )
301 kb = min( n-k+1, nb )
305 CALL ztrmm(
'Right', uplo,
'No transpose',
'Non-unit',
306 $ kb, k-1, cone, b, ldb, a( k, 1 ), lda )
307 CALL zhemm(
'Left', uplo, kb, k-1, half, a( k, k ),
308 $ lda, b( k, 1 ), ldb, cone, a( k, 1 ),
310 CALL zher2k( uplo,
'Conjugate transpose', k-1, kb,
311 $ cone, a( k, 1 ), lda, b( k, 1 ), ldb,
313 CALL zhemm(
'Left', uplo, kb, k-1, half, a( k, k ),
314 $ lda, b( k, 1 ), ldb, cone, a( k, 1 ),
316 CALL ztrmm(
'Left', uplo,
'Conjugate transpose',
317 $
'Non-unit', kb, k-1, cone, b( k, k ), ldb,
319 CALL zhegs2( itype, uplo, kb, a( k, k ), lda,
320 $ b( k, k ), ldb, info )
subroutine xerbla(srname, info)
subroutine zhegs2(itype, uplo, n, a, lda, b, ldb, info)
ZHEGS2 reduces a Hermitian definite generalized eigenproblem to standard form, using the factorizatio...
subroutine zhegst(itype, uplo, n, a, lda, b, ldb, info)
ZHEGST
subroutine zhemm(side, uplo, m, n, alpha, a, lda, b, ldb, beta, c, ldc)
ZHEMM
subroutine zher2k(uplo, trans, n, k, alpha, a, lda, b, ldb, beta, c, ldc)
ZHER2K
subroutine ztrmm(side, uplo, transa, diag, m, n, alpha, a, lda, b, ldb)
ZTRMM
subroutine ztrsm(side, uplo, transa, diag, m, n, alpha, a, lda, b, ldb)
ZTRSM