110 SUBROUTINE zhpgst( ITYPE, UPLO, N, AP, BP, INFO )
118 INTEGER INFO, ITYPE, N
121 COMPLEX*16 AP( * ), BP( * )
127 DOUBLE PRECISION ONE, HALF
128 parameter( one = 1.0d+0, half = 0.5d+0 )
130 parameter( cone = ( 1.0d+0, 0.0d+0 ) )
134 INTEGER J, J1, J1J1, JJ, K, K1, K1K1, KK
135 DOUBLE PRECISION AJJ, AKK, BJJ, BKK
149 EXTERNAL lsame, zdotc
156 upper = lsame( uplo,
'U' )
157 IF( itype.LT.1 .OR. itype.GT.3 )
THEN
159 ELSE IF( .NOT.upper .AND. .NOT.lsame( uplo,
'L' ) )
THEN
161 ELSE IF( n.LT.0 )
THEN
165 CALL xerbla(
'ZHPGST', -info )
169 IF( itype.EQ.1 )
THEN
183 ap( jj ) = dble( ap( jj ) )
184 bjj = dble( bp( jj ) )
185 CALL ztpsv( uplo,
'Conjugate transpose',
'Non-unit',
188 CALL zhpmv( uplo, j-1, -cone, ap, bp( j1 ), 1, cone,
190 CALL zdscal( j-1, one / bjj, ap( j1 ), 1 )
191 ap( jj ) = ( ap( jj )-zdotc( j-1, ap( j1 ), 1,
203 k1k1 = kk + n - k + 1
207 akk = dble( ap( kk ) )
208 bkk = dble( bp( kk ) )
212 CALL zdscal( n-k, one / bkk, ap( kk+1 ), 1 )
214 CALL zaxpy( n-k, ct, bp( kk+1 ), 1, ap( kk+1 ), 1 )
215 CALL zhpr2( uplo, n-k, -cone, ap( kk+1 ), 1,
216 $ bp( kk+1 ), 1, ap( k1k1 ) )
217 CALL zaxpy( n-k, ct, bp( kk+1 ), 1, ap( kk+1 ), 1 )
218 CALL ztpsv( uplo,
'No transpose',
'Non-unit', n-k,
219 $ bp( k1k1 ), ap( kk+1 ), 1 )
238 akk = dble( ap( kk ) )
239 bkk = dble( bp( kk ) )
240 CALL ztpmv( uplo,
'No transpose',
'Non-unit', k-1, bp,
243 CALL zaxpy( k-1, ct, bp( k1 ), 1, ap( k1 ), 1 )
244 CALL zhpr2( uplo, k-1, cone, ap( k1 ), 1, bp( k1 ), 1,
246 CALL zaxpy( k-1, ct, bp( k1 ), 1, ap( k1 ), 1 )
247 CALL zdscal( k-1, bkk, ap( k1 ), 1 )
248 ap( kk ) = akk*bkk**2
258 j1j1 = jj + n - j + 1
262 ajj = dble( ap( jj ) )
263 bjj = dble( bp( jj ) )
264 ap( jj ) = ajj*bjj + zdotc( n-j, ap( jj+1 ), 1,
266 CALL zdscal( n-j, bjj, ap( jj+1 ), 1 )
267 CALL zhpmv( uplo, n-j, cone, ap( j1j1 ), bp( jj+1 ),
269 $ cone, ap( jj+1 ), 1 )
270 CALL ztpmv( uplo,
'Conjugate transpose',
'Non-unit',
271 $ n-j+1, bp( jj ), ap( jj ), 1 )