229 $ D, E, HOUS, LHOUS, WORK, LWORK, INFO )
243 CHARACTER STAGE1, UPLO, VECT
244 INTEGER N, KD, LDAB, LHOUS, LWORK, INFO
247 DOUBLE PRECISION D( * ), E( * )
248 COMPLEX*16 AB( LDAB, * ), HOUS( * ), WORK( * )
254 DOUBLE PRECISION RZERO
256 parameter( rzero = 0.0d+0,
257 $ zero = ( 0.0d+0, 0.0d+0 ),
258 $ one = ( 1.0d+0, 0.0d+0 ) )
261 LOGICAL LQUERY, WANTQ, UPPER, AFTERS1
262 INTEGER I, M, K, IB, SWEEPID, MYID, SHIFT, STT, ST,
263 $ ed, stind, edind, blklastind, colpt, thed,
264 $ stepercol, grsiz, thgrsiz, thgrnb, thgrid,
265 $ nbtiles, ttype, tid, nthreads, debug,
266 $ abdpos, abofdpos, dpos, ofdpos, awpos,
267 $ inda, indw, apos, sizea, lda, indv, indtau,
268 $ sizev, sizetau, ldv, lhmin, lwmin
269 DOUBLE PRECISION ABSTMP
276 INTRINSIC min, max, ceiling, dble, real
281 EXTERNAL lsame, ilaenv2stage
290 afters1 = lsame( stage1,
'Y' )
291 wantq = lsame( vect,
'V' )
292 upper = lsame( uplo,
'U' )
293 lquery = ( lwork.EQ.-1 ) .OR. ( lhous.EQ.-1 )
297 ib = ilaenv2stage( 2,
'ZHETRD_HB2ST', vect, n, kd, -1, -1 )
298 lhmin = ilaenv2stage( 3,
'ZHETRD_HB2ST', vect, n, kd, ib, -1 )
299 lwmin = ilaenv2stage( 4,
'ZHETRD_HB2ST', vect, n, kd, ib, -1 )
301 IF( .NOT.afters1 .AND. .NOT.lsame( stage1,
'N' ) )
THEN
303 ELSE IF( .NOT.lsame( vect,
'N' ) )
THEN
305 ELSE IF( .NOT.upper .AND. .NOT.lsame( uplo,
'L' ) )
THEN
307 ELSE IF( n.LT.0 )
THEN
309 ELSE IF( kd.LT.0 )
THEN
311 ELSE IF( ldab.LT.(kd+1) )
THEN
313 ELSE IF( lhous.LT.lhmin .AND. .NOT.lquery )
THEN
315 ELSE IF( lwork.LT.lwmin .AND. .NOT.lquery )
THEN
325 CALL xerbla(
'ZHETRD_HB2ST', -info )
327 ELSE IF( lquery )
THEN
345 indv = indtau + sizetau
362 awpos = inda + kd + 1
378 d( i ) = dble( ab( abdpos, i ) )
401 d( i ) = dble( ab( abdpos, i ) )
408 tmp = ab( abofdpos, i+1 )
410 ab( abofdpos, i+1 ) = abstmp
412 IF( abstmp.NE.rzero )
THEN
418 $ ab( abofdpos, i+2 ) = ab( abofdpos, i+2 )*tmp
425 tmp = ab( abofdpos, i )
427 ab( abofdpos, i ) = abstmp
429 IF( abstmp.NE.rzero )
THEN
435 $ ab( abofdpos, i+1 ) = ab( abofdpos, i+1 )*tmp
453 nbtiles = ceiling( real(n)/real(kd) )
454 stepercol = ceiling( real(shift)/real(grsiz) )
455 thgrnb = ceiling( real(n-1)/real(thgrsiz) )
457 CALL zlacpy(
"A", kd+1, n, ab, ldab, work( apos ), lda )
458 CALL zlaset(
"A", kd, n, zero, zero, work( awpos ), lda )
475 DO 100 thgrid = 1, thgrnb
476 stt = (thgrid-1)*thgrsiz+1
477 thed = min( (stt + thgrsiz -1), (n-1))
481 DO 120 m = 1, stepercol
483 DO 130 sweepid = st, ed
485 myid = (i-sweepid)*(stepercol*grsiz)
487 IF ( myid.EQ.1 )
THEN
490 ttype = mod( myid, 2 ) + 2
493 IF( ttype.EQ.2 )
THEN
494 colpt = (myid/2)*kd + sweepid
499 colpt = ((myid+1)/2)*kd + sweepid
502 IF( ( stind.GE.edind-1 ).AND.
503 $ ( edind.EQ.n ) )
THEN
512#if defined(_OPENMP) && _OPENMP >= 201307
514 IF( ttype.NE.1 )
THEN
518 tid = omp_get_thread_num()
520 $ stind, edind, sweepid, n, kd, ib,
522 $ hous( indv ), hous( indtau ), ldv,
523 $ work( indw + tid*kd ) )
528 tid = omp_get_thread_num()
530 $ stind, edind, sweepid, n, kd, ib,
532 $ hous( indv ), hous( indtau ), ldv,
533 $ work( indw + tid*kd ) )
538 $ stind, edind, sweepid, n, kd, ib,
540 $ hous( indv ), hous( indtau ), ldv,
543 IF ( blklastind.GE.(n-1) )
THEN
562 d( i ) = dble( work( dpos+(i-1)*lda ) )
570 e( i ) = dble( work( ofdpos+i*lda ) )
574 e( i ) = dble( work( ofdpos+(i-1)*lda ) )
subroutine xerbla(srname, info)
subroutine zhb2st_kernels(uplo, wantz, ttype, st, ed, sweep, n, nb, ib, a, lda, v, tau, ldvt, work)
ZHB2ST_KERNELS
subroutine zhetrd_hb2st(stage1, vect, uplo, n, kd, ab, ldab, d, e, hous, lhous, work, lwork, info)
ZHETRD_HB2ST reduces a complex Hermitian band matrix A to real symmetric tridiagonal form T
subroutine zlacpy(uplo, m, n, a, lda, b, ldb)
ZLACPY copies all or part of one two-dimensional array to another.
subroutine zlaset(uplo, m, n, alpha, beta, a, lda)
ZLASET initializes the off-diagonal elements and the diagonal elements of a matrix to given values.