242 $ WORK, LWORK, INFO )
252 INTEGER INFO, LDA, LDAB, LWORK, N, KD
255 REAL A( LDA, * ), AB( LDAB, * ),
256 $ tau( * ), work( * )
264 parameter( rone = 1.0e+0,
270 LOGICAL LQUERY, UPPER
271 INTEGER I, J, IINFO, LWMIN, PN, PK, LK,
272 $ ldt, ldw, lds2, lds1,
274 $ tpos, wpos, s2pos, s1pos
287 EXTERNAL lsame, ilaenv2stage, sroundup_lwork
295 upper = lsame( uplo,
'U' )
296 lquery = ( lwork.EQ.-1 )
297 lwmin = ilaenv2stage( 4,
'SSYTRD_SY2SB',
'', n, kd, -1, -1 )
299 IF( .NOT.upper .AND. .NOT.lsame( uplo,
'L' ) )
THEN
301 ELSE IF( n.LT.0 )
THEN
303 ELSE IF( kd.LT.0 )
THEN
305 ELSE IF( lda.LT.max( 1, n ) )
THEN
307 ELSE IF( ldab.LT.max( 1, kd+1 ) )
THEN
309 ELSE IF( lwork.LT.lwmin .AND. .NOT.lquery )
THEN
314 CALL xerbla(
'SSYTRD_SY2SB', -info )
316 ELSE IF( lquery )
THEN
317 work( 1 ) = sroundup_lwork(lwmin)
328 CALL scopy( lk, a( i-lk+1, i ), 1,
329 $ ab( kd+1-lk+1, i ), 1 )
333 lk = min( kd+1, n-i+1 )
334 CALL scopy( lk, a( i, i ), 1, ab( 1, i ), 1 )
348 ls2 = lwmin - lt - lw - ls1
366 CALL slaset(
"A", ldt, kd, zero, zero, work( tpos ), ldt )
369 DO 10 i = 1, n - kd, kd
371 pk = min( n-i-kd+1, kd )
375 CALL sgelqf( kd, pn, a( i, i+kd ), lda,
376 $ tau( i ), work( s2pos ), ls2, iinfo )
381 lk = min( kd, n-j ) + 1
382 CALL scopy( lk, a( j, j ), lda, ab( kd+1, j ), ldab-1 )
385 CALL slaset(
'Lower', pk, pk, zero, one,
386 $ a( i, i+kd ), lda )
390 CALL slarft(
'Forward',
'Rowwise', pn, pk,
391 $ a( i, i+kd ), lda, tau( i ),
392 $ work( tpos ), ldt )
396 CALL sgemm(
'Conjugate',
'No transpose', pk, pn, pk,
397 $ one, work( tpos ), ldt,
399 $ zero, work( s2pos ), lds2 )
401 CALL ssymm(
'Right', uplo, pk, pn,
402 $ one, a( i+kd, i+kd ), lda,
403 $ work( s2pos ), lds2,
404 $ zero, work( wpos ), ldw )
406 CALL sgemm(
'No transpose',
'Conjugate', pk, pk, pn,
407 $ one, work( wpos ), ldw,
408 $ work( s2pos ), lds2,
409 $ zero, work( s1pos ), lds1 )
411 CALL sgemm(
'No transpose',
'No transpose', pk, pn, pk,
412 $ -half, work( s1pos ), lds1,
414 $ one, work( wpos ), ldw )
420 CALL ssyr2k( uplo,
'Conjugate', pn, pk,
421 $ -one, a( i, i+kd ), lda,
423 $ rone, a( i+kd, i+kd ), lda )
429 lk = min(kd, n-j) + 1
430 CALL scopy( lk, a( j, j ), lda, ab( kd+1, j ), ldab-1 )
437 DO 40 i = 1, n - kd, kd
439 pk = min( n-i-kd+1, kd )
443 CALL sgeqrf( pn, kd, a( i+kd, i ), lda,
444 $ tau( i ), work( s2pos ), ls2, iinfo )
449 lk = min( kd, n-j ) + 1
450 CALL scopy( lk, a( j, j ), 1, ab( 1, j ), 1 )
453 CALL slaset(
'Upper', pk, pk, zero, one,
454 $ a( i+kd, i ), lda )
458 CALL slarft(
'Forward',
'Columnwise', pn, pk,
459 $ a( i+kd, i ), lda, tau( i ),
460 $ work( tpos ), ldt )
464 CALL sgemm(
'No transpose',
'No transpose', pn, pk, pk,
465 $ one, a( i+kd, i ), lda,
467 $ zero, work( s2pos ), lds2 )
469 CALL ssymm(
'Left', uplo, pn, pk,
470 $ one, a( i+kd, i+kd ), lda,
471 $ work( s2pos ), lds2,
472 $ zero, work( wpos ), ldw )
474 CALL sgemm(
'Conjugate',
'No transpose', pk, pk, pn,
475 $ one, work( s2pos ), lds2,
477 $ zero, work( s1pos ), lds1 )
479 CALL sgemm(
'No transpose',
'No transpose', pn, pk, pk,
480 $ -half, a( i+kd, i ), lda,
481 $ work( s1pos ), lds1,
482 $ one, work( wpos ), ldw )
488 CALL ssyr2k( uplo,
'No transpose', pn, pk,
489 $ -one, a( i+kd, i ), lda,
491 $ rone, a( i+kd, i+kd ), lda )
504 lk = min(kd, n-j) + 1
505 CALL scopy( lk, a( j, j ), 1, ab( 1, j ), 1 )
510 work( 1 ) = sroundup_lwork(lwmin)
subroutine xerbla(srname, info)
subroutine scopy(n, sx, incx, sy, incy)
SCOPY
subroutine sgelqf(m, n, a, lda, tau, work, lwork, info)
SGELQF
subroutine sgemm(transa, transb, m, n, k, alpha, a, lda, b, ldb, beta, c, ldc)
SGEMM
subroutine sgeqrf(m, n, a, lda, tau, work, lwork, info)
SGEQRF
subroutine ssymm(side, uplo, m, n, alpha, a, lda, b, ldb, beta, c, ldc)
SSYMM
subroutine ssyr2k(uplo, trans, n, k, alpha, a, lda, b, ldb, beta, c, ldc)
SSYR2K
subroutine ssytrd_sy2sb(uplo, n, kd, a, lda, ab, ldab, tau, work, lwork, info)
SSYTRD_SY2SB
subroutine slarft(direct, storev, n, k, v, ldv, tau, t, ldt)
SLARFT forms the triangular factor T of a block reflector H = I - vtvH
subroutine slaset(uplo, m, n, alpha, beta, a, lda)
SLASET initializes the off-diagonal elements and the diagonal elements of a matrix to given values.