232 $ D, E, HOUS, LHOUS, WORK, LWORK, INFO )
246 CHARACTER STAGE1, UPLO, VECT
247 INTEGER N, KD, LDAB, LHOUS, LWORK, INFO
250 DOUBLE PRECISION D( * ), E( * )
251 COMPLEX*16 AB( LDAB, * ), HOUS( * ), WORK( * )
257 DOUBLE PRECISION RZERO
259 parameter( rzero = 0.0d+0,
260 $ zero = ( 0.0d+0, 0.0d+0 ),
261 $ one = ( 1.0d+0, 0.0d+0 ) )
264 LOGICAL LQUERY, WANTQ, UPPER, AFTERS1
265 INTEGER I, M, K, IB, SWEEPID, MYID, SHIFT, STT, ST,
266 $ ed, stind, edind, blklastind, colpt, thed,
267 $ stepercol, grsiz, thgrsiz, thgrnb, thgrid,
268 $ nbtiles, ttype, tid, nthreads,
269 $ abdpos, abofdpos, dpos, ofdpos, awpos,
270 $ inda, indw, apos, sizea, lda, indv, indtau,
271 $ sizev, sizetau, ldv, lhmin, lwmin
272 DOUBLE PRECISION ABSTMP
280 INTRINSIC min, max, ceiling, dble, real
285 EXTERNAL lsame, ilaenv2stage
293 afters1 = lsame( stage1,
'Y' )
294 wantq = lsame( vect,
'V' )
295 upper = lsame( uplo,
'U' )
296 lquery = ( lwork.EQ.-1 ) .OR. ( lhous.EQ.-1 )
300 ib = ilaenv2stage( 2,
'ZHETRD_HB2ST', vect, n, kd,
302 IF( n.EQ.0 .OR. kd.LE.1 )
THEN
306 lhmin = ilaenv2stage( 3,
'ZHETRD_HB2ST', vect, n, kd, ib,
308 lwmin = ilaenv2stage( 4,
'ZHETRD_HB2ST', vect, n, kd, ib,
312 IF( .NOT.afters1 .AND. .NOT.lsame( stage1,
'N' ) )
THEN
314 ELSE IF( .NOT.lsame( vect,
'N' ) )
THEN
316 ELSE IF( .NOT.upper .AND. .NOT.lsame( uplo,
'L' ) )
THEN
318 ELSE IF( n.LT.0 )
THEN
320 ELSE IF( kd.LT.0 )
THEN
322 ELSE IF( ldab.LT.(kd+1) )
THEN
324 ELSE IF( lhous.LT.lhmin .AND. .NOT.lquery )
THEN
326 ELSE IF( lwork.LT.lwmin .AND. .NOT.lquery )
THEN
336 CALL xerbla(
'ZHETRD_HB2ST', -info )
338 ELSE IF( lquery )
THEN
356 indv = indtau + sizetau
373 awpos = inda + kd + 1
389 d( i ) = dble( ab( abdpos, i ) )
412 d( i ) = dble( ab( abdpos, i ) )
419 tmp = ab( abofdpos, i+1 )
421 ab( abofdpos, i+1 ) = abstmp
423 IF( abstmp.NE.rzero )
THEN
429 $ ab( abofdpos, i+2 ) = ab( abofdpos, i+2 )*tmp
436 tmp = ab( abofdpos, i )
438 ab( abofdpos, i ) = abstmp
440 IF( abstmp.NE.rzero )
THEN
446 $ ab( abofdpos, i+1 ) = ab( abofdpos, i+1 )*tmp
464 nbtiles = ceiling( real(n)/real(kd) )
465 stepercol = ceiling( real(shift)/real(grsiz) )
466 thgrnb = ceiling( real(n-1)/real(thgrsiz) )
468 CALL zlacpy(
"A", kd+1, n, ab, ldab, work( apos ), lda )
469 CALL zlaset(
"A", kd, n, zero, zero, work( awpos ), lda )
486 DO 100 thgrid = 1, thgrnb
487 stt = (thgrid-1)*thgrsiz+1
488 thed = min( (stt + thgrsiz -1), (n-1))
492 DO 120 m = 1, stepercol
494 DO 130 sweepid = st, ed
496 myid = (i-sweepid)*(stepercol*grsiz)
498 IF ( myid.EQ.1 )
THEN
501 ttype = mod( myid, 2 ) + 2
504 IF( ttype.EQ.2 )
THEN
505 colpt = (myid/2)*kd + sweepid
510 colpt = ((myid+1)/2)*kd + sweepid
513 IF( ( stind.GE.edind-1 ).AND.
514 $ ( edind.EQ.n ) )
THEN
523#if defined(_OPENMP) && _OPENMP >= 201307
525 IF( ttype.NE.1 )
THEN
529 tid = omp_get_thread_num()
531 $ uplo, wantq, ttype,
532 $ stind, edind, sweepid, n, kd, ib,
534 $ hous( indv ), hous( indtau ), ldv,
535 $ work( indw + tid*kd ) )
540 tid = omp_get_thread_num()
542 $ uplo, wantq, ttype,
543 $ stind, edind, sweepid, n, kd, ib,
545 $ hous( indv ), hous( indtau ), ldv,
546 $ work( indw + tid*kd ) )
551 $ uplo, wantq, ttype,
552 $ stind, edind, sweepid, n, kd, ib,
554 $ hous( indv ), hous( indtau ), ldv,
557 IF ( blklastind.GE.(n-1) )
THEN
576 d( i ) = dble( work( dpos+(i-1)*lda ) )
584 e( i ) = dble( work( ofdpos+i*lda ) )
588 e( i ) = dble( work( ofdpos+(i-1)*lda ) )