124 SUBROUTINE ssygst( ITYPE, UPLO, N, A, LDA, B, LDB, INFO )
132 INTEGER INFO, ITYPE, LDA, LDB, N
135 REAL A( LDA, * ), B( LDB, * )
142 parameter( one = 1.0, half = 0.5 )
158 EXTERNAL lsame, ilaenv
165 upper = lsame( uplo,
'U' )
166 IF( itype.LT.1 .OR. itype.GT.3 )
THEN
168 ELSE IF( .NOT.upper .AND. .NOT.lsame( uplo,
'L' ) )
THEN
170 ELSE IF( n.LT.0 )
THEN
172 ELSE IF( lda.LT.max( 1, n ) )
THEN
174 ELSE IF( ldb.LT.max( 1, n ) )
THEN
178 CALL xerbla(
'SSYGST', -info )
189 nb = ilaenv( 1,
'SSYGST', uplo, n, -1, -1, -1 )
191 IF( nb.LE.1 .OR. nb.GE.n )
THEN
195 CALL ssygs2( itype, uplo, n, a, lda, b, ldb, info )
200 IF( itype.EQ.1 )
THEN
206 kb = min( n-k+1, nb )
210 CALL ssygs2( itype, uplo, kb, a( k, k ), lda,
211 $ b( k, k ), ldb, info )
213 CALL strsm(
'Left', uplo,
'Transpose',
215 $ kb, n-k-kb+1, one, b( k, k ), ldb,
216 $ a( k, k+kb ), lda )
217 CALL ssymm(
'Left', uplo, kb, n-k-kb+1, -half,
218 $ a( k, k ), lda, b( k, k+kb ), ldb, one,
219 $ a( k, k+kb ), lda )
220 CALL ssyr2k( uplo,
'Transpose', n-k-kb+1, kb,
222 $ a( k, k+kb ), lda, b( k, k+kb ), ldb,
223 $ one, a( k+kb, k+kb ), lda )
224 CALL ssymm(
'Left', uplo, kb, n-k-kb+1, -half,
225 $ a( k, k ), lda, b( k, k+kb ), ldb, one,
226 $ a( k, k+kb ), lda )
227 CALL strsm(
'Right', uplo,
'No transpose',
228 $
'Non-unit', kb, n-k-kb+1, one,
229 $ b( k+kb, k+kb ), ldb, a( k, k+kb ),
238 kb = min( n-k+1, nb )
242 CALL ssygs2( itype, uplo, kb, a( k, k ), lda,
243 $ b( k, k ), ldb, info )
245 CALL strsm(
'Right', uplo,
'Transpose',
247 $ n-k-kb+1, kb, one, b( k, k ), ldb,
248 $ a( k+kb, k ), lda )
249 CALL ssymm(
'Right', uplo, n-k-kb+1, kb, -half,
250 $ a( k, k ), lda, b( k+kb, k ), ldb, one,
251 $ a( k+kb, k ), lda )
252 CALL ssyr2k( uplo,
'No transpose', n-k-kb+1, kb,
253 $ -one, a( k+kb, k ), lda, b( k+kb, k ),
254 $ ldb, one, a( k+kb, k+kb ), lda )
255 CALL ssymm(
'Right', uplo, n-k-kb+1, kb, -half,
256 $ a( k, k ), lda, b( k+kb, k ), ldb, one,
257 $ a( k+kb, k ), lda )
258 CALL strsm(
'Left', uplo,
'No transpose',
259 $
'Non-unit', n-k-kb+1, kb, one,
260 $ b( k+kb, k+kb ), ldb, a( k+kb, k ),
271 kb = min( n-k+1, nb )
275 CALL strmm(
'Left', uplo,
'No transpose',
277 $ k-1, kb, one, b, ldb, a( 1, k ), lda )
278 CALL ssymm(
'Right', uplo, k-1, kb, half, a( k,
280 $ lda, b( 1, k ), ldb, one, a( 1, k ), lda )
281 CALL ssyr2k( uplo,
'No transpose', k-1, kb, one,
282 $ a( 1, k ), lda, b( 1, k ), ldb, one, a,
284 CALL ssymm(
'Right', uplo, k-1, kb, half, a( k,
286 $ lda, b( 1, k ), ldb, one, a( 1, k ), lda )
287 CALL strmm(
'Right', uplo,
'Transpose',
'Non-unit',
288 $ k-1, kb, one, b( k, k ), ldb, a( 1, k ),
290 CALL ssygs2( itype, uplo, kb, a( k, k ), lda,
291 $ b( k, k ), ldb, info )
298 kb = min( n-k+1, nb )
302 CALL strmm(
'Right', uplo,
'No transpose',
304 $ kb, k-1, one, b, ldb, a( k, 1 ), lda )
305 CALL ssymm(
'Left', uplo, kb, k-1, half, a( k, k ),
306 $ lda, b( k, 1 ), ldb, one, a( k, 1 ), lda )
307 CALL ssyr2k( uplo,
'Transpose', k-1, kb, one,
308 $ a( k, 1 ), lda, b( k, 1 ), ldb, one, a,
310 CALL ssymm(
'Left', uplo, kb, k-1, half, a( k, k ),
311 $ lda, b( k, 1 ), ldb, one, a( k, 1 ), lda )
312 CALL strmm(
'Left', uplo,
'Transpose',
'Non-unit',
314 $ k-1, one, b( k, k ), ldb, a( k, 1 ), lda )
315 CALL ssygs2( itype, uplo, kb, a( k, k ), lda,
316 $ b( k, k ), ldb, info )