242 $ WORK, LWORK, INFO )
252 INTEGER INFO, LDA, LDAB, LWORK, N, KD
255 DOUBLE PRECISION A( LDA, * ), AB( LDAB, * ),
256 $ tau( * ), work( * )
262 DOUBLE PRECISION RONE
263 DOUBLE PRECISION ZERO, ONE, HALF
264 parameter( rone = 1.0d+0,
270 LOGICAL LQUERY, UPPER
271 INTEGER I, J, IINFO, LWMIN, PN, PK, LK,
272 $ ldt, ldw, lds2, lds1,
274 $ tpos, wpos, s2pos, s1pos
286 EXTERNAL lsame, ilaenv2stage
294 upper = lsame( uplo,
'U' )
295 lquery = ( lwork.EQ.-1 )
296 lwmin = ilaenv2stage( 4,
'DSYTRD_SY2SB',
' ', n, kd, -1, -1 )
298 IF( .NOT.upper .AND. .NOT.lsame( uplo,
'L' ) )
THEN
300 ELSE IF( n.LT.0 )
THEN
302 ELSE IF( kd.LT.0 )
THEN
304 ELSE IF( lda.LT.max( 1, n ) )
THEN
306 ELSE IF( ldab.LT.max( 1, kd+1 ) )
THEN
308 ELSE IF( lwork.LT.lwmin .AND. .NOT.lquery )
THEN
313 CALL xerbla(
'DSYTRD_SY2SB', -info )
315 ELSE IF( lquery )
THEN
327 CALL dcopy( lk, a( i-lk+1, i ), 1,
328 $ ab( kd+1-lk+1, i ), 1 )
332 lk = min( kd+1, n-i+1 )
333 CALL dcopy( lk, a( i, i ), 1, ab( 1, i ), 1 )
347 ls2 = lwmin - lt - lw - ls1
365 CALL dlaset(
"A", ldt, kd, zero, zero, work( tpos ), ldt )
368 DO 10 i = 1, n - kd, kd
370 pk = min( n-i-kd+1, kd )
374 CALL dgelqf( kd, pn, a( i, i+kd ), lda,
375 $ tau( i ), work( s2pos ), ls2, iinfo )
380 lk = min( kd, n-j ) + 1
381 CALL dcopy( lk, a( j, j ), lda, ab( kd+1, j ), ldab-1 )
384 CALL dlaset(
'Lower', pk, pk, zero, one,
385 $ a( i, i+kd ), lda )
389 CALL dlarft(
'Forward',
'Rowwise', pn, pk,
390 $ a( i, i+kd ), lda, tau( i ),
391 $ work( tpos ), ldt )
395 CALL dgemm(
'Conjugate',
'No transpose', pk, pn, pk,
396 $ one, work( tpos ), ldt,
398 $ zero, work( s2pos ), lds2 )
400 CALL dsymm(
'Right', uplo, pk, pn,
401 $ one, a( i+kd, i+kd ), lda,
402 $ work( s2pos ), lds2,
403 $ zero, work( wpos ), ldw )
405 CALL dgemm(
'No transpose',
'Conjugate', pk, pk, pn,
406 $ one, work( wpos ), ldw,
407 $ work( s2pos ), lds2,
408 $ zero, work( s1pos ), lds1 )
410 CALL dgemm(
'No transpose',
'No transpose', pk, pn, pk,
411 $ -half, work( s1pos ), lds1,
413 $ one, work( wpos ), ldw )
419 CALL dsyr2k( uplo,
'Conjugate', pn, pk,
420 $ -one, a( i, i+kd ), lda,
422 $ rone, a( i+kd, i+kd ), lda )
428 lk = min(kd, n-j) + 1
429 CALL dcopy( lk, a( j, j ), lda, ab( kd+1, j ), ldab-1 )
436 DO 40 i = 1, n - kd, kd
438 pk = min( n-i-kd+1, kd )
442 CALL dgeqrf( pn, kd, a( i+kd, i ), lda,
443 $ tau( i ), work( s2pos ), ls2, iinfo )
448 lk = min( kd, n-j ) + 1
449 CALL dcopy( lk, a( j, j ), 1, ab( 1, j ), 1 )
452 CALL dlaset(
'Upper', pk, pk, zero, one,
453 $ a( i+kd, i ), lda )
457 CALL dlarft(
'Forward',
'Columnwise', pn, pk,
458 $ a( i+kd, i ), lda, tau( i ),
459 $ work( tpos ), ldt )
463 CALL dgemm(
'No transpose',
'No transpose', pn, pk, pk,
464 $ one, a( i+kd, i ), lda,
466 $ zero, work( s2pos ), lds2 )
468 CALL dsymm(
'Left', uplo, pn, pk,
469 $ one, a( i+kd, i+kd ), lda,
470 $ work( s2pos ), lds2,
471 $ zero, work( wpos ), ldw )
473 CALL dgemm(
'Conjugate',
'No transpose', pk, pk, pn,
474 $ one, work( s2pos ), lds2,
476 $ zero, work( s1pos ), lds1 )
478 CALL dgemm(
'No transpose',
'No transpose', pn, pk, pk,
479 $ -half, a( i+kd, i ), lda,
480 $ work( s1pos ), lds1,
481 $ one, work( wpos ), ldw )
487 CALL dsyr2k( uplo,
'No transpose', pn, pk,
488 $ -one, a( i+kd, i ), lda,
490 $ rone, a( i+kd, i+kd ), lda )
503 lk = min(kd, n-j) + 1
504 CALL dcopy( lk, a( j, j ), 1, ab( 1, j ), 1 )
subroutine xerbla(srname, info)
subroutine dcopy(n, dx, incx, dy, incy)
DCOPY
subroutine dgelqf(m, n, a, lda, tau, work, lwork, info)
DGELQF
subroutine dgemm(transa, transb, m, n, k, alpha, a, lda, b, ldb, beta, c, ldc)
DGEMM
subroutine dgeqrf(m, n, a, lda, tau, work, lwork, info)
DGEQRF
subroutine dsymm(side, uplo, m, n, alpha, a, lda, b, ldb, beta, c, ldc)
DSYMM
subroutine dsyr2k(uplo, trans, n, k, alpha, a, lda, b, ldb, beta, c, ldc)
DSYR2K
subroutine dsytrd_sy2sb(uplo, n, kd, a, lda, ab, ldab, tau, work, lwork, info)
DSYTRD_SY2SB
subroutine dlarft(direct, storev, n, k, v, ldv, tau, t, ldt)
DLARFT forms the triangular factor T of a block reflector H = I - vtvH
subroutine dlaset(uplo, m, n, alpha, beta, a, lda)
DLASET initializes the off-diagonal elements and the diagonal elements of a matrix to given values.