112 SUBROUTINE chpgst( ITYPE, UPLO, N, AP, BP, INFO )
120 INTEGER INFO, ITYPE, N
123 COMPLEX AP( * ), BP( * )
130 parameter( one = 1.0e+0, half = 0.5e+0 )
132 parameter( cone = ( 1.0e+0, 0.0e+0 ) )
136 INTEGER J, J1, J1J1, JJ, K, K1, K1K1, KK
137 REAL AJJ, AKK, BJJ, BKK
150 EXTERNAL lsame, cdotc
157 upper = lsame( uplo,
'U' )
158 IF( itype.LT.1 .OR. itype.GT.3 )
THEN
160 ELSE IF( .NOT.upper .AND. .NOT.lsame( uplo,
'L' ) )
THEN
162 ELSE IF( n.LT.0 )
THEN
166 CALL xerbla(
'CHPGST', -info )
170 IF( itype.EQ.1 )
THEN
184 ap( jj ) = real( ap( jj ) )
185 bjj = real( bp( jj ) )
186 CALL ctpsv( uplo,
'Conjugate transpose',
'Non-unit', j,
188 CALL chpmv( uplo, j-1, -cone, ap, bp( j1 ), 1, cone,
190 CALL csscal( j-1, one / bjj, ap( j1 ), 1 )
191 ap( jj ) = ( ap( jj )-cdotc( j-1, ap( j1 ), 1, bp( j1 ),
202 k1k1 = kk + n - k + 1
206 akk = real( ap( kk ) )
207 bkk = real( bp( kk ) )
211 CALL csscal( n-k, one / bkk, ap( kk+1 ), 1 )
213 CALL caxpy( n-k, ct, bp( kk+1 ), 1, ap( kk+1 ), 1 )
214 CALL chpr2( uplo, n-k, -cone, ap( kk+1 ), 1,
215 $ bp( kk+1 ), 1, ap( k1k1 ) )
216 CALL caxpy( n-k, ct, bp( kk+1 ), 1, ap( kk+1 ), 1 )
217 CALL ctpsv( uplo,
'No transpose',
'Non-unit', n-k,
218 $ bp( k1k1 ), ap( kk+1 ), 1 )
237 akk = real( ap( kk ) )
238 bkk = real( bp( kk ) )
239 CALL ctpmv( uplo,
'No transpose',
'Non-unit', k-1, bp,
242 CALL caxpy( k-1, ct, bp( k1 ), 1, ap( k1 ), 1 )
243 CALL chpr2( uplo, k-1, cone, ap( k1 ), 1, bp( k1 ), 1,
245 CALL caxpy( k-1, ct, bp( k1 ), 1, ap( k1 ), 1 )
246 CALL csscal( k-1, bkk, ap( k1 ), 1 )
247 ap( kk ) = akk*bkk**2
257 j1j1 = jj + n - j + 1
261 ajj = real( ap( jj ) )
262 bjj = real( bp( jj ) )
263 ap( jj ) = ajj*bjj + cdotc( n-j, ap( jj+1 ), 1,
265 CALL csscal( n-j, bjj, ap( jj+1 ), 1 )
266 CALL chpmv( uplo, n-j, cone, ap( j1j1 ), bp( jj+1 ), 1,
267 $ cone, ap( jj+1 ), 1 )
268 CALL ctpmv( uplo,
'Conjugate transpose',
'Non-unit',
269 $ n-j+1, bp( jj ), ap( jj ), 1 )
subroutine xerbla(srname, info)
subroutine caxpy(n, ca, cx, incx, cy, incy)
CAXPY
subroutine chpgst(itype, uplo, n, ap, bp, info)
CHPGST
subroutine chpmv(uplo, n, alpha, ap, x, incx, beta, y, incy)
CHPMV
subroutine chpr2(uplo, n, alpha, x, incx, y, incy, ap)
CHPR2
subroutine csscal(n, sa, cx, incx)
CSSCAL
subroutine ctpmv(uplo, trans, diag, n, ap, x, incx)
CTPMV
subroutine ctpsv(uplo, trans, diag, n, ap, x, incx)
CTPSV