296 SUBROUTINE clatme( N, DIST, ISEED, D, MODE, COND, DMAX,
298 $ UPPER, SIM, DS, MODES, CONDS, KL, KU, ANORM,
307 CHARACTER DIST, RSIGN, SIM, UPPER
308 INTEGER INFO, KL, KU, LDA, MODE, MODES, N
309 REAL ANORM, COND, CONDS
315 COMPLEX A( LDA, * ), D( * ), WORK( * )
322 PARAMETER ( ZERO = 0.0e+0 )
324 PARAMETER ( ONE = 1.0e+0 )
326 parameter( czero = ( 0.0e+0, 0.0e+0 ) )
328 parameter( cone = ( 1.0e+0, 0.0e+0 ) )
332 INTEGER I, IC, ICOLS, IDIST, IINFO, IR, IROWS, IRSIGN,
333 $ ISIM, IUPPER, J, JC, JCR
335 COMPLEX ALPHA, TAU, XNORMS
344 EXTERNAL LSAME, CLANGE, CLARND
352 INTRINSIC abs, conjg, max, mod
368 IF( lsame( dist,
'U' ) )
THEN
370 ELSE IF( lsame( dist,
'S' ) )
THEN
372 ELSE IF( lsame( dist,
'N' ) )
THEN
374 ELSE IF( lsame( dist,
'D' ) )
THEN
382 IF( lsame( rsign,
'T' ) )
THEN
384 ELSE IF( lsame( rsign,
'F' ) )
THEN
392 IF( lsame( upper,
'T' ) )
THEN
394 ELSE IF( lsame( upper,
'F' ) )
THEN
402 IF( lsame( sim,
'T' ) )
THEN
404 ELSE IF( lsame( sim,
'F' ) )
THEN
413 IF( modes.EQ.0 .AND. isim.EQ.1 )
THEN
415 IF( ds( j ).EQ.zero )
424 ELSE IF( idist.EQ.-1 )
THEN
426 ELSE IF( abs( mode ).GT.6 )
THEN
428 ELSE IF( ( mode.NE.0 .AND. abs( mode ).NE.6 ) .AND. cond.LT.one )
431 ELSE IF( irsign.EQ.-1 )
THEN
433 ELSE IF( iupper.EQ.-1 )
THEN
435 ELSE IF( isim.EQ.-1 )
THEN
439 ELSE IF( isim.EQ.1 .AND. abs( modes ).GT.5 )
THEN
441 ELSE IF( isim.EQ.1 .AND. modes.NE.0 .AND. conds.LT.one )
THEN
443 ELSE IF( kl.LT.1 )
THEN
445 ELSE IF( ku.LT.1 .OR. ( ku.LT.n-1 .AND. kl.LT.n-1 ) )
THEN
447 ELSE IF( lda.LT.max( 1, n ) )
THEN
452 CALL xerbla(
'CLATME', -info )
459 iseed( i ) = mod( abs( iseed( i ) ), 4096 )
462 IF( mod( iseed( 4 ), 2 ).NE.1 )
463 $ iseed( 4 ) = iseed( 4 ) + 1
469 CALL clatm1( mode, cond, irsign, idist, iseed, d, n, iinfo )
470 IF( iinfo.NE.0 )
THEN
474 IF( mode.NE.0 .AND. abs( mode ).NE.6 )
THEN
480 temp = max( temp, abs( d( i ) ) )
483 IF( temp.GT.zero )
THEN
490 CALL cscal( n, alpha, d, 1 )
494 CALL claset(
'Full', n, n, czero, czero, a, lda )
495 CALL ccopy( n, d, 1, a, lda+1 )
499 IF( iupper.NE.0 )
THEN
501 CALL clarnv( idist, iseed, jc-1, a( 1, jc ) )
517 CALL slatm1( modes, conds, 0, 0, iseed, ds, n, iinfo )
518 IF( iinfo.NE.0 )
THEN
525 CALL clarge( n, a, lda, iseed, work, iinfo )
526 IF( iinfo.NE.0 )
THEN
534 CALL csscal( n, ds( j ), a( j, 1 ), lda )
535 IF( ds( j ).NE.zero )
THEN
536 CALL csscal( n, one / ds( j ), a( 1, j ), 1 )
545 CALL clarge( n, a, lda, iseed, work, iinfo )
546 IF( iinfo.NE.0 )
THEN
558 DO 60 jcr = kl + 1, n - 1
563 CALL ccopy( irows, a( jcr, ic ), 1, work, 1 )
565 CALL clarfg( irows, xnorms, work( 2 ), 1, tau )
568 alpha = clarnd( 5, iseed )
570 CALL cgemv(
'C', irows, icols, cone, a( jcr, ic+1 ), lda,
571 $ work, 1, czero, work( irows+1 ), 1 )
572 CALL cgerc( irows, icols, -tau, work, 1, work( irows+1 ), 1,
573 $ a( jcr, ic+1 ), lda )
575 CALL cgemv(
'N', n, irows, cone, a( 1, jcr ), lda, work, 1,
576 $ czero, work( irows+1 ), 1 )
577 CALL cgerc( n, irows, -conjg( tau ), work( irows+1 ), 1,
578 $ work, 1, a( 1, jcr ), lda )
580 a( jcr, ic ) = xnorms
581 CALL claset(
'Full', irows-1, 1, czero, czero,
582 $ a( jcr+1, ic ), lda )
584 CALL cscal( icols+1, alpha, a( jcr, ic ), lda )
585 CALL cscal( n, conjg( alpha ), a( 1, jcr ), 1 )
587 ELSE IF( ku.LT.n-1 )
THEN
591 DO 70 jcr = ku + 1, n - 1
596 CALL ccopy( icols, a( ir, jcr ), lda, work, 1 )
598 CALL clarfg( icols, xnorms, work( 2 ), 1, tau )
601 CALL clacgv( icols-1, work( 2 ), 1 )
602 alpha = clarnd( 5, iseed )
604 CALL cgemv(
'N', irows, icols, cone, a( ir+1, jcr ), lda,
605 $ work, 1, czero, work( icols+1 ), 1 )
606 CALL cgerc( irows, icols, -tau, work( icols+1 ), 1, work, 1,
607 $ a( ir+1, jcr ), lda )
609 CALL cgemv(
'C', icols, n, cone, a( jcr, 1 ), lda, work, 1,
610 $ czero, work( icols+1 ), 1 )
611 CALL cgerc( icols, n, -conjg( tau ), work, 1,
612 $ work( icols+1 ), 1, a( jcr, 1 ), lda )
614 a( ir, jcr ) = xnorms
615 CALL claset(
'Full', 1, icols-1, czero, czero,
616 $ a( ir, jcr+1 ), lda )
618 CALL cscal( irows+1, alpha, a( ir, jcr ), 1 )
619 CALL cscal( n, conjg( alpha ), a( jcr, 1 ), lda )
625 IF( anorm.GE.zero )
THEN
626 temp = clange(
'M', n, n, a, lda, tempa )
627 IF( temp.GT.zero )
THEN
628 ralpha = anorm / temp
630 CALL csscal( n, ralpha, a( 1, j ), 1 )
subroutine xerbla(srname, info)
subroutine clarge(n, a, lda, iseed, work, info)
CLARGE
subroutine clatm1(mode, cond, irsign, idist, iseed, d, n, info)
CLATM1
subroutine clatme(n, dist, iseed, d, mode, cond, dmax, rsign, upper, sim, ds, modes, conds, kl, ku, anorm, a, lda, work, info)
CLATME
subroutine ccopy(n, cx, incx, cy, incy)
CCOPY
subroutine cgemv(trans, m, n, alpha, a, lda, x, incx, beta, y, incy)
CGEMV
subroutine cgerc(m, n, alpha, x, incx, y, incy, a, lda)
CGERC
subroutine clacgv(n, x, incx)
CLACGV conjugates a complex vector.
subroutine clarfg(n, alpha, x, incx, tau)
CLARFG generates an elementary reflector (Householder matrix).
subroutine clarnv(idist, iseed, n, x)
CLARNV returns a vector of random numbers from a uniform or normal distribution.
subroutine claset(uplo, m, n, alpha, beta, a, lda)
CLASET initializes the off-diagonal elements and the diagonal elements of a matrix to given values.
subroutine csscal(n, sa, cx, incx)
CSSCAL
subroutine cscal(n, ca, cx, incx)
CSCAL
subroutine slatm1(mode, cond, irsign, idist, iseed, d, n, info)
SLATM1