127 SUBROUTINE chegs2( ITYPE, UPLO, N, A, LDA, B, LDB, INFO )
135 INTEGER INFO, ITYPE, LDA, LDB, N
138 COMPLEX A( LDA, * ), B( LDB, * )
145 parameter( one = 1.0e+0, half = 0.5e+0 )
147 parameter( cone = ( 1.0e+0, 0.0e+0 ) )
171 upper = lsame( uplo,
'U' )
172 IF( itype.LT.1 .OR. itype.GT.3 )
THEN
174 ELSE IF( .NOT.upper .AND. .NOT.lsame( uplo,
'L' ) )
THEN
176 ELSE IF( n.LT.0 )
THEN
178 ELSE IF( lda.LT.max( 1, n ) )
THEN
180 ELSE IF( ldb.LT.max( 1, n ) )
THEN
184 CALL xerbla(
'CHEGS2', -info )
188 IF( itype.EQ.1 )
THEN
197 akk = real( a( k, k ) )
198 bkk = real( b( k, k ) )
202 CALL csscal( n-k, one / bkk, a( k, k+1 ), lda )
204 CALL clacgv( n-k, a( k, k+1 ), lda )
205 CALL clacgv( n-k, b( k, k+1 ), ldb )
206 CALL caxpy( n-k, ct, b( k, k+1 ), ldb, a( k, k+1 ),
208 CALL cher2( uplo, n-k, -cone, a( k, k+1 ), lda,
209 $ b( k, k+1 ), ldb, a( k+1, k+1 ), lda )
210 CALL caxpy( n-k, ct, b( k, k+1 ), ldb, a( k, k+1 ),
212 CALL clacgv( n-k, b( k, k+1 ), ldb )
213 CALL ctrsv( uplo,
'Conjugate transpose',
'Non-unit',
214 $ n-k, b( k+1, k+1 ), ldb, a( k, k+1 ),
216 CALL clacgv( n-k, a( k, k+1 ), lda )
227 akk = real( a( k, k ) )
228 bkk = real( b( k, k ) )
232 CALL csscal( n-k, one / bkk, a( k+1, k ), 1 )
234 CALL caxpy( n-k, ct, b( k+1, k ), 1, a( k+1, k ), 1 )
235 CALL cher2( uplo, n-k, -cone, a( k+1, k ), 1,
236 $ b( k+1, k ), 1, a( k+1, k+1 ), lda )
237 CALL caxpy( n-k, ct, b( k+1, k ), 1, a( k+1, k ), 1 )
238 CALL ctrsv( uplo,
'No transpose',
'Non-unit', n-k,
239 $ b( k+1, k+1 ), ldb, a( k+1, k ), 1 )
252 akk = real( a( k, k ) )
253 bkk = real( b( k, k ) )
254 CALL ctrmv( uplo,
'No transpose',
'Non-unit', k-1, b,
255 $ ldb, a( 1, k ), 1 )
257 CALL caxpy( k-1, ct, b( 1, k ), 1, a( 1, k ), 1 )
258 CALL cher2( uplo, k-1, cone, a( 1, k ), 1, b( 1, k ), 1,
260 CALL caxpy( k-1, ct, b( 1, k ), 1, a( 1, k ), 1 )
261 CALL csscal( k-1, bkk, a( 1, k ), 1 )
262 a( k, k ) = akk*bkk**2
272 akk = real( a( k, k ) )
273 bkk = real( b( k, k ) )
274 CALL clacgv( k-1, a( k, 1 ), lda )
275 CALL ctrmv( uplo,
'Conjugate transpose',
'Non-unit', k-1,
276 $ b, ldb, a( k, 1 ), lda )
278 CALL clacgv( k-1, b( k, 1 ), ldb )
279 CALL caxpy( k-1, ct, b( k, 1 ), ldb, a( k, 1 ), lda )
280 CALL cher2( uplo, k-1, cone, a( k, 1 ), lda, b( k, 1 ),
282 CALL caxpy( k-1, ct, b( k, 1 ), ldb, a( k, 1 ), lda )
283 CALL clacgv( k-1, b( k, 1 ), ldb )
284 CALL csscal( k-1, bkk, a( k, 1 ), lda )
285 CALL clacgv( k-1, a( k, 1 ), lda )
286 a( k, k ) = akk*bkk**2
subroutine xerbla(srname, info)
subroutine caxpy(n, ca, cx, incx, cy, incy)
CAXPY
subroutine chegs2(itype, uplo, n, a, lda, b, ldb, info)
CHEGS2 reduces a Hermitian definite generalized eigenproblem to standard form, using the factorizatio...
subroutine cher2(uplo, n, alpha, x, incx, y, incy, a, lda)
CHER2
subroutine clacgv(n, x, incx)
CLACGV conjugates a complex vector.
subroutine csscal(n, sa, cx, incx)
CSSCAL
subroutine ctrmv(uplo, trans, diag, n, a, lda, x, incx)
CTRMV
subroutine ctrsv(uplo, trans, diag, n, a, lda, x, incx)
CTRSV