327 SUBROUTINE slatme( N, DIST, ISEED, D, MODE, COND, DMAX, EI,
329 $ UPPER, SIM, DS, MODES, CONDS, KL, KU, ANORM,
338 CHARACTER DIST, RSIGN, SIM, UPPER
339 INTEGER INFO, KL, KU, LDA, MODE, MODES, N
340 REAL ANORM, COND, CONDS, DMAX
345 REAL A( LDA, * ), D( * ), DS( * ), WORK( * )
352 PARAMETER ( ZERO = 0.0e0 )
354 PARAMETER ( ONE = 1.0e0 )
356 parameter( half = 1.0e0 / 2.0e0 )
359 LOGICAL BADEI, BADS, USEEI
360 INTEGER I, IC, ICOLS, IDIST, IINFO, IR, IROWS, IRSIGN,
361 $ ISIM, IUPPER, J, JC, JCR, JR
362 REAL ALPHA, TAU, TEMP, XNORMS
370 EXTERNAL LSAME, SLANGE, SLARAN
377 INTRINSIC abs, max, mod
393 IF( lsame( dist,
'U' ) )
THEN
395 ELSE IF( lsame( dist,
'S' ) )
THEN
397 ELSE IF( lsame( dist,
'N' ) )
THEN
407 IF( lsame( ei( 1 ),
' ' ) .OR. mode.NE.0 )
THEN
410 IF( lsame( ei( 1 ),
'R' ) )
THEN
412 IF( lsame( ei( j ),
'I' ) )
THEN
413 IF( lsame( ei( j-1 ),
'I' ) )
416 IF( .NOT.lsame( ei( j ),
'R' ) )
427 IF( lsame( rsign,
'T' ) )
THEN
429 ELSE IF( lsame( rsign,
'F' ) )
THEN
437 IF( lsame( upper,
'T' ) )
THEN
439 ELSE IF( lsame( upper,
'F' ) )
THEN
447 IF( lsame( sim,
'T' ) )
THEN
449 ELSE IF( lsame( sim,
'F' ) )
THEN
458 IF( modes.EQ.0 .AND. isim.EQ.1 )
THEN
460 IF( ds( j ).EQ.zero )
469 ELSE IF( idist.EQ.-1 )
THEN
471 ELSE IF( abs( mode ).GT.6 )
THEN
473 ELSE IF( ( mode.NE.0 .AND. abs( mode ).NE.6 ) .AND. cond.LT.one )
476 ELSE IF( badei )
THEN
478 ELSE IF( irsign.EQ.-1 )
THEN
480 ELSE IF( iupper.EQ.-1 )
THEN
482 ELSE IF( isim.EQ.-1 )
THEN
486 ELSE IF( isim.EQ.1 .AND. abs( modes ).GT.5 )
THEN
488 ELSE IF( isim.EQ.1 .AND. modes.NE.0 .AND. conds.LT.one )
THEN
490 ELSE IF( kl.LT.1 )
THEN
492 ELSE IF( ku.LT.1 .OR. ( ku.LT.n-1 .AND. kl.LT.n-1 ) )
THEN
494 ELSE IF( lda.LT.max( 1, n ) )
THEN
499 CALL xerbla(
'SLATME', -info )
506 iseed( i ) = mod( abs( iseed( i ) ), 4096 )
509 IF( mod( iseed( 4 ), 2 ).NE.1 )
510 $ iseed( 4 ) = iseed( 4 ) + 1
516 CALL slatm1( mode, cond, irsign, idist, iseed, d, n, iinfo )
517 IF( iinfo.NE.0 )
THEN
521 IF( mode.NE.0 .AND. abs( mode ).NE.6 )
THEN
527 temp = max( temp, abs( d( i ) ) )
530 IF( temp.GT.zero )
THEN
532 ELSE IF( dmax.NE.zero )
THEN
539 CALL sscal( n, alpha, d, 1 )
543 CALL slaset(
'Full', n, n, zero, zero, a, lda )
544 CALL scopy( n, d, 1, a, lda+1 )
551 IF( lsame( ei( j ),
'I' ) )
THEN
552 a( j-1, j ) = a( j, j )
553 a( j, j-1 ) = -a( j, j )
554 a( j, j ) = a( j-1, j-1 )
559 ELSE IF( abs( mode ).EQ.5 )
THEN
562 IF( slaran( iseed ).GT.half )
THEN
563 a( j-1, j ) = a( j, j )
564 a( j, j-1 ) = -a( j, j )
565 a( j, j ) = a( j-1, j-1 )
573 IF( iupper.NE.0 )
THEN
575 IF( a( jc-1, jc ).NE.zero )
THEN
580 CALL slarnv( idist, iseed, jr, a( 1, jc ) )
596 CALL slatm1( modes, conds, 0, 0, iseed, ds, n, iinfo )
597 IF( iinfo.NE.0 )
THEN
604 CALL slarge( n, a, lda, iseed, work, iinfo )
605 IF( iinfo.NE.0 )
THEN
613 CALL sscal( n, ds( j ), a( j, 1 ), lda )
614 IF( ds( j ).NE.zero )
THEN
615 CALL sscal( n, one / ds( j ), a( 1, j ), 1 )
624 CALL slarge( n, a, lda, iseed, work, iinfo )
625 IF( iinfo.NE.0 )
THEN
637 DO 90 jcr = kl + 1, n - 1
642 CALL scopy( irows, a( jcr, ic ), 1, work, 1 )
644 CALL slarfg( irows, xnorms, work( 2 ), 1, tau )
647 CALL sgemv(
'T', irows, icols, one, a( jcr, ic+1 ), lda,
648 $ work, 1, zero, work( irows+1 ), 1 )
649 CALL sger( irows, icols, -tau, work, 1, work( irows+1 ), 1,
650 $ a( jcr, ic+1 ), lda )
652 CALL sgemv(
'N', n, irows, one, a( 1, jcr ), lda, work, 1,
653 $ zero, work( irows+1 ), 1 )
654 CALL sger( n, irows, -tau, work( irows+1 ), 1, work, 1,
657 a( jcr, ic ) = xnorms
658 CALL slaset(
'Full', irows-1, 1, zero, zero, a( jcr+1, ic ),
661 ELSE IF( ku.LT.n-1 )
THEN
665 DO 100 jcr = ku + 1, n - 1
670 CALL scopy( icols, a( ir, jcr ), lda, work, 1 )
672 CALL slarfg( icols, xnorms, work( 2 ), 1, tau )
675 CALL sgemv(
'N', irows, icols, one, a( ir+1, jcr ), lda,
676 $ work, 1, zero, work( icols+1 ), 1 )
677 CALL sger( irows, icols, -tau, work( icols+1 ), 1, work, 1,
678 $ a( ir+1, jcr ), lda )
680 CALL sgemv(
'C', icols, n, one, a( jcr, 1 ), lda, work, 1,
681 $ zero, work( icols+1 ), 1 )
682 CALL sger( icols, n, -tau, work, 1, work( icols+1 ), 1,
685 a( ir, jcr ) = xnorms
686 CALL slaset(
'Full', 1, icols-1, zero, zero, a( ir, jcr+1 ),
693 IF( anorm.GE.zero )
THEN
694 temp = slange(
'M', n, n, a, lda, tempa )
695 IF( temp.GT.zero )
THEN
698 CALL sscal( n, alpha, a( 1, j ), 1 )