232 $ D, E, HOUS, LHOUS, WORK, LWORK, INFO )
246 CHARACTER STAGE1, UPLO, VECT
247 INTEGER N, KD, LDAB, LHOUS, LWORK, INFO
251 COMPLEX AB( LDAB, * ), HOUS( * ), WORK( * )
259 parameter( rzero = 0.0e+0,
260 $ zero = ( 0.0e+0, 0.0e+0 ),
261 $ one = ( 1.0e+0, 0.0e+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 $ sicev, sizetau, ldv, lhmin, lwmin
280 INTRINSIC min, max, ceiling, real
286 EXTERNAL lsame, ilaenv2stage, sroundup_lwork
294 afters1 = lsame( stage1,
'Y' )
295 wantq = lsame( vect,
'V' )
296 upper = lsame( uplo,
'U' )
297 lquery = ( lwork.EQ.-1 ) .OR. ( lhous.EQ.-1 )
301 ib = ilaenv2stage( 2,
'CHETRD_HB2ST', vect, n, kd,
303 IF( n.EQ.0 .OR. kd.LE.1 )
THEN
307 lhmin = ilaenv2stage( 3,
'CHETRD_HB2ST', vect, n, kd, ib,
309 lwmin = ilaenv2stage( 4,
'CHETRD_HB2ST', vect, n, kd, ib,
313 IF( .NOT.afters1 .AND. .NOT.lsame( stage1,
'N' ) )
THEN
315 ELSE IF( .NOT.lsame( vect,
'N' ) )
THEN
317 ELSE IF( .NOT.upper .AND. .NOT.lsame( uplo,
'L' ) )
THEN
319 ELSE IF( n.LT.0 )
THEN
321 ELSE IF( kd.LT.0 )
THEN
323 ELSE IF( ldab.LT.(kd+1) )
THEN
325 ELSE IF( lhous.LT.lhmin .AND. .NOT.lquery )
THEN
327 ELSE IF( lwork.LT.lwmin .AND. .NOT.lquery )
THEN
332 hous( 1 ) = sroundup_lwork( lhmin )
333 work( 1 ) = sroundup_lwork( lwmin )
337 CALL xerbla(
'CHETRD_HB2ST', -info )
339 ELSE IF( lquery )
THEN
357 indv = indtau + sizetau
374 awpos = inda + kd + 1
390 d( i ) = real( ab( abdpos, i ) )
413 d( i ) = real( ab( abdpos, i ) )
420 tmp = ab( abofdpos, i+1 )
422 ab( abofdpos, i+1 ) = abstmp
424 IF( abstmp.NE.rzero )
THEN
430 $ ab( abofdpos, i+2 ) = ab( abofdpos, i+2 )*tmp
437 tmp = ab( abofdpos, i )
439 ab( abofdpos, i ) = abstmp
441 IF( abstmp.NE.rzero )
THEN
447 $ ab( abofdpos, i+1 ) = ab( abofdpos, i+1 )*tmp
465 nbtiles = ceiling( real(n)/real(kd) )
466 stepercol = ceiling( real(shift)/real(grsiz) )
467 thgrnb = ceiling( real(n-1)/real(thgrsiz) )
469 CALL clacpy(
"A", kd+1, n, ab, ldab, work( apos ), lda )
470 CALL claset(
"A", kd, n, zero, zero, work( awpos ), lda )
487 DO 100 thgrid = 1, thgrnb
488 stt = (thgrid-1)*thgrsiz+1
489 thed = min( (stt + thgrsiz -1), (n-1))
493 DO 120 m = 1, stepercol
495 DO 130 sweepid = st, ed
497 myid = (i-sweepid)*(stepercol*grsiz)
499 IF ( myid.EQ.1 )
THEN
502 ttype = mod( myid, 2 ) + 2
505 IF( ttype.EQ.2 )
THEN
506 colpt = (myid/2)*kd + sweepid
511 colpt = ((myid+1)/2)*kd + sweepid
514 IF( ( stind.GE.edind-1 ).AND.
515 $ ( edind.EQ.n ) )
THEN
524#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 ) = real( work( dpos+(i-1)*lda ) )
584 e( i ) = real( work( ofdpos+i*lda ) )
588 e( i ) = real( work( ofdpos+(i-1)*lda ) )
592 work( 1 ) = sroundup_lwork( lwmin )