125 SUBROUTINE zhegst( ITYPE, UPLO, N, A, LDA, B, LDB, INFO )
133 INTEGER INFO, ITYPE, LDA, LDB, N
136 COMPLEX*16 A( LDA, * ), B( LDB, * )
143 parameter( one = 1.0d+0 )
144 COMPLEX*16 CONE, HALF
145 parameter( cone = ( 1.0d+0, 0.0d+0 ),
146 $ half = ( 0.5d+0, 0.0d+0 ) )
162 EXTERNAL lsame, ilaenv
169 upper = lsame( uplo,
'U' )
170 IF( itype.LT.1 .OR. itype.GT.3 )
THEN
172 ELSE IF( .NOT.upper .AND. .NOT.lsame( uplo,
'L' ) )
THEN
174 ELSE IF( n.LT.0 )
THEN
176 ELSE IF( lda.LT.max( 1, n ) )
THEN
178 ELSE IF( ldb.LT.max( 1, n ) )
THEN
182 CALL xerbla(
'ZHEGST', -info )
193 nb = ilaenv( 1,
'ZHEGST', uplo, n, -1, -1, -1 )
195 IF( nb.LE.1 .OR. nb.GE.n )
THEN
199 CALL zhegs2( itype, uplo, n, a, lda, b, ldb, info )
204 IF( itype.EQ.1 )
THEN
210 kb = min( n-k+1, nb )
214 CALL zhegs2( itype, uplo, kb, a( k, k ), lda,
215 $ b( k, k ), ldb, info )
217 CALL ztrsm(
'Left', uplo,
'Conjugate transpose',
218 $
'Non-unit', kb, n-k-kb+1, cone,
219 $ b( k, k ), ldb, a( k, k+kb ), lda )
220 CALL zhemm(
'Left', uplo, kb, n-k-kb+1, -half,
221 $ a( k, k ), lda, b( k, k+kb ), ldb,
222 $ cone, a( k, k+kb ), lda )
223 CALL zher2k( uplo,
'Conjugate transpose',
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,
250 $
'Conjugate transpose',
251 $
'Non-unit', n-k-kb+1, kb, cone,
252 $ b( k, k ), ldb, a( k+kb, k ), lda )
253 CALL zhemm(
'Right', uplo, n-k-kb+1, kb, -half,
254 $ a( k, k ), lda, b( k+kb, k ), ldb,
255 $ cone, a( k+kb, k ), lda )
256 CALL zher2k( uplo,
'No transpose', n-k-kb+1, kb,
257 $ -cone, a( k+kb, k ), lda,
258 $ b( k+kb, k ), ldb, one,
259 $ a( k+kb, k+kb ), lda )
260 CALL zhemm(
'Right', uplo, n-k-kb+1, kb, -half,
261 $ a( k, k ), lda, b( k+kb, k ), ldb,
262 $ cone, a( k+kb, k ), lda )
263 CALL ztrsm(
'Left', uplo,
'No transpose',
264 $
'Non-unit', n-k-kb+1, kb, cone,
265 $ b( k+kb, k+kb ), ldb, a( k+kb, k ),
276 kb = min( n-k+1, nb )
280 CALL ztrmm(
'Left', uplo,
'No transpose',
282 $ k-1, kb, cone, b, ldb, a( 1, k ), lda )
283 CALL zhemm(
'Right', uplo, k-1, kb, half, a( k,
285 $ lda, b( 1, k ), ldb, cone, a( 1, k ),
287 CALL zher2k( uplo,
'No transpose', k-1, kb, cone,
288 $ a( 1, k ), lda, b( 1, k ), ldb, one, a,
290 CALL zhemm(
'Right', uplo, k-1, kb, half, a( k,
292 $ lda, b( 1, k ), ldb, cone, a( 1, k ),
294 CALL ztrmm(
'Right', uplo,
'Conjugate transpose',
295 $
'Non-unit', k-1, kb, cone, b( k, k ), ldb,
297 CALL zhegs2( itype, uplo, kb, a( k, k ), lda,
298 $ b( k, k ), ldb, info )
305 kb = min( n-k+1, nb )
309 CALL ztrmm(
'Right', uplo,
'No transpose',
311 $ kb, k-1, cone, b, ldb, a( k, 1 ), lda )
312 CALL zhemm(
'Left', uplo, kb, k-1, half, a( k, k ),
313 $ lda, b( k, 1 ), ldb, cone, a( k, 1 ),
315 CALL zher2k( uplo,
'Conjugate transpose', k-1, kb,
316 $ cone, a( k, 1 ), lda, b( k, 1 ), ldb,
318 CALL zhemm(
'Left', uplo, kb, k-1, half, a( k, k ),
319 $ lda, b( k, 1 ), ldb, cone, a( k, 1 ),
321 CALL ztrmm(
'Left', uplo,
'Conjugate transpose',
322 $
'Non-unit', kb, k-1, cone, b( k, k ), ldb,
324 CALL zhegs2( itype, uplo, kb, a( k, k ), lda,
325 $ b( k, k ), ldb, info )