329 SUBROUTINE slatmt( M, N, DIST, ISEED, SYM, D, MODE, COND, DMAX,
330 $ RANK, KL, KU, PACK, A, LDA, WORK, INFO )
338 INTEGER INFO, KL, KU, LDA, M, MODE, N, RANK
339 CHARACTER DIST, PACK, SYM
342 REAL A( LDA, * ), D( * ), WORK( * )
350 parameter( zero = 0.0e0 )
352 parameter( one = 1.0e0 )
354 parameter( twopi = 6.28318530717958647692528676655900576839e+0 )
357 REAL ALPHA, ANGLE, C, DUMMY, EXTRA, S, TEMP
358 INTEGER I, IC, ICOL, IDIST, IENDCH, IINFO, IL, ILDA,
359 $ ioffg, ioffst, ipack, ipackg, ir, ir1, ir2,
360 $ irow, irsign, iskew, isym, isympk, j, jc, jch,
361 $ jkl, jku, jr, k, llb, minlda, mnmin, mr, nc,
363 LOGICAL GIVENS, ILEXTR, ILTEMP, TOPDWN
368 EXTERNAL slarnd, lsame
375 INTRINSIC abs, cos, max, min, mod, real, sin
386 IF( m.EQ.0 .OR. n.EQ.0 )
391 IF( lsame( dist,
'U' ) )
THEN
393 ELSE IF( lsame( dist,
'S' ) )
THEN
395 ELSE IF( lsame( dist,
'N' ) )
THEN
403 IF( lsame( sym,
'N' ) )
THEN
406 ELSE IF( lsame( sym,
'P' ) )
THEN
409 ELSE IF( lsame( sym,
'S' ) )
THEN
412 ELSE IF( lsame( sym,
'H' ) )
THEN
422 IF( lsame( pack,
'N' ) )
THEN
424 ELSE IF( lsame( pack,
'U' ) )
THEN
427 ELSE IF( lsame( pack,
'L' ) )
THEN
430 ELSE IF( lsame( pack,
'C' ) )
THEN
433 ELSE IF( lsame( pack,
'R' ) )
THEN
436 ELSE IF( lsame( pack,
'B' ) )
THEN
439 ELSE IF( lsame( pack,
'Q' ) )
THEN
442 ELSE IF( lsame( pack,
'Z' ) )
THEN
456 IF( ipack.EQ.5 .OR. ipack.EQ.6 )
THEN
458 ELSE IF( ipack.EQ.7 )
THEN
459 minlda = llb + uub + 1
469 IF( real( llb+uub ).LT.0.3*real( max( 1, mr+nc ) ) )
475 IF( lda.LT.m .AND. lda.GE.minlda )
482 ELSE IF( m.NE.n .AND. isym.NE.1 )
THEN
484 ELSE IF( n.LT.0 )
THEN
486 ELSE IF( idist.EQ.-1 )
THEN
488 ELSE IF( isym.EQ.-1 )
THEN
490 ELSE IF( abs( mode ).GT.6 )
THEN
492 ELSE IF( ( mode.NE.0 .AND. abs( mode ).NE.6 ) .AND. cond.LT.one )
495 ELSE IF( kl.LT.0 )
THEN
497 ELSE IF( ku.LT.0 .OR. ( isym.NE.1 .AND. kl.NE.ku ) )
THEN
499 ELSE IF( ipack.EQ.-1 .OR. ( isympk.EQ.1 .AND. isym.EQ.1 ) .OR.
500 $ ( isympk.EQ.2 .AND. isym.EQ.1 .AND. kl.GT.0 ) .OR.
501 $ ( isympk.EQ.3 .AND. isym.EQ.1 .AND. ku.GT.0 ) .OR.
502 $ ( isympk.NE.0 .AND. m.NE.n ) )
THEN
504 ELSE IF( lda.LT.max( 1, minlda ) )
THEN
509 CALL xerbla(
'SLATMT', -info )
516 iseed( i ) = mod( abs( iseed( i ) ), 4096 )
519 IF( mod( iseed( 4 ), 2 ).NE.1 )
520 $ iseed( 4 ) = iseed( 4 ) + 1
526 CALL slatm7( mode, cond, irsign, idist, iseed, d, mnmin, rank,
528 IF( iinfo.NE.0 )
THEN
536 IF( abs( d( 1 ) ).LE.abs( d( rank ) ) )
THEN
542 IF( mode.NE.0 .AND. abs( mode ).NE.6 )
THEN
548 temp = max( temp, abs( d( i ) ) )
551 IF( temp.GT.zero )
THEN
558 CALL sscal( rank, alpha, d, 1 )
571 IF( ipack.GT.4 )
THEN
574 IF( ipack.GT.5 )
THEN
590 CALL slaset(
'Full', lda, n, zero, zero, a, lda )
595 IF( llb.EQ.0 .AND. uub.EQ.0 )
THEN
596 CALL scopy( mnmin, d, 1, a( 1-iskew+ioffst, 1 ), ilda+1 )
597 IF( ipack.LE.2 .OR. ipack.GE.5 )
600 ELSE IF( givens )
THEN
609 IF( ipack.GT.4 )
THEN
615 CALL scopy( mnmin, d, 1, a( 1-iskew+ioffst, 1 ), ilda+1 )
626 DO 130 jr = 1, min( m+jku, n ) + jkl - 1
628 angle = twopi*slarnd( 1, iseed )
631 icol = max( 1, jr-jkl )
633 il = min( n, jr+jku ) + 1 - icol
634 CALL slarot( .true., jr.GT.jkl, .false., il, c,
635 $ s, a( jr-iskew*icol+ioffst, icol ),
636 $ ilda, extra, dummy )
643 DO 120 jch = jr - jkl, 1, -jkl - jku
645 CALL slartg( a( ir+1-iskew*( ic+1 )+ioffst,
646 $ ic+1 ), extra, c, s, dummy )
648 irow = max( 1, jch-jku )
652 CALL slarot( .false., iltemp, .true., il, c, -s,
653 $ a( irow-iskew*ic+ioffst, ic ),
654 $ ilda, temp, extra )
656 CALL slartg( a( irow+1-iskew*( ic+1 )+ioffst,
657 $ ic+1 ), temp, c, s, dummy )
658 icol = max( 1, jch-jku-jkl )
661 CALL slarot( .true., jch.GT.jku+jkl, .true.,
662 $ il, c, -s, a( irow-iskew*icol+
663 $ ioffst, icol ), ilda, extra,
677 DO 160 jc = 1, min( n+jkl, m ) + jku - 1
679 angle = twopi*slarnd( 1, iseed )
682 irow = max( 1, jc-jku )
684 il = min( m, jc+jkl ) + 1 - irow
685 CALL slarot( .false., jc.GT.jku, .false., il, c,
686 $ s, a( irow-iskew*jc+ioffst, jc ),
687 $ ilda, extra, dummy )
694 DO 150 jch = jc - jku, 1, -jkl - jku
696 CALL slartg( a( ir+1-iskew*( ic+1 )+ioffst,
697 $ ic+1 ), extra, c, s, dummy )
699 icol = max( 1, jch-jkl )
703 CALL slarot( .true., iltemp, .true., il, c, -s,
704 $ a( ir-iskew*icol+ioffst, icol ),
705 $ ilda, temp, extra )
707 CALL slartg( a( ir+1-iskew*( icol+1 )+ioffst,
708 $ icol+1 ), temp, c, s, dummy )
709 irow = max( 1, jch-jkl-jku )
712 CALL slarot( .false., jch.GT.jkl+jku, .true.,
713 $ il, c, -s, a( irow-iskew*icol+
714 $ ioffst, icol ), ilda, extra,
735 iendch = min( m, n+jkl ) - 1
736 DO 190 jc = min( m+jku, n ) - 1, 1 - jkl, -1
738 angle = twopi*slarnd( 1, iseed )
741 irow = max( 1, jc-jku+1 )
743 il = min( m, jc+jkl+1 ) + 1 - irow
744 CALL slarot( .false., .false., jc+jkl.LT.m, il,
745 $ c, s, a( irow-iskew*jc+ioffst,
746 $ jc ), ilda, dummy, extra )
752 DO 180 jch = jc + jkl, iendch, jkl + jku
755 CALL slartg( a( jch-iskew*ic+ioffst, ic ),
756 $ extra, c, s, dummy )
759 icol = min( n-1, jch+jku )
760 iltemp = jch + jku.LT.n
762 CALL slarot( .true., ilextr, iltemp, icol+2-ic,
763 $ c, s, a( jch-iskew*ic+ioffst, ic ),
764 $ ilda, extra, temp )
766 CALL slartg( a( jch-iskew*icol+ioffst,
767 $ icol ), temp, c, s, dummy )
768 il = min( iendch, jch+jkl+jku ) + 2 - jch
770 CALL slarot( .false., .true.,
771 $ jch+jkl+jku.LE.iendch, il, c, s,
772 $ a( jch-iskew*icol+ioffst,
773 $ icol ), ilda, temp, extra )
788 iendch = min( n, m+jku ) - 1
789 DO 220 jr = min( n+jkl, m ) - 1, 1 - jku, -1
791 angle = twopi*slarnd( 1, iseed )
794 icol = max( 1, jr-jkl+1 )
796 il = min( n, jr+jku+1 ) + 1 - icol
797 CALL slarot( .true., .false., jr+jku.LT.n, il,
798 $ c, s, a( jr-iskew*icol+ioffst,
799 $ icol ), ilda, dummy, extra )
805 DO 210 jch = jr + jku, iendch, jkl + jku
808 CALL slartg( a( ir-iskew*jch+ioffst, jch ),
809 $ extra, c, s, dummy )
812 irow = min( m-1, jch+jkl )
813 iltemp = jch + jkl.LT.m
815 CALL slarot( .false., ilextr, iltemp, irow+2-ir,
816 $ c, s, a( ir-iskew*jch+ioffst,
817 $ jch ), ilda, extra, temp )
819 CALL slartg( a( irow-iskew*jch+ioffst, jch ),
820 $ temp, c, s, dummy )
821 il = min( iendch, jch+jkl+jku ) + 2 - jch
823 CALL slarot( .true., .true.,
824 $ jch+jkl+jku.LE.iendch, il, c, s,
825 $ a( irow-iskew*jch+ioffst, jch ),
826 $ ilda, temp, extra )
845 IF( ipack.GE.5 )
THEN
851 CALL scopy( mnmin, d, 1, a( 1-iskew+ioffg, 1 ), ilda+1 )
855 irow = max( 1, jc-k )
856 il = min( jc+1, k+2 )
858 temp = a( jc-iskew*( jc+1 )+ioffg, jc+1 )
859 angle = twopi*slarnd( 1, iseed )
862 CALL slarot( .false., jc.GT.k, .true., il, c, s,
863 $ a( irow-iskew*jc+ioffg, jc ), ilda,
865 CALL slarot( .true., .true., .false.,
866 $ min( k, n-jc )+1, c, s,
867 $ a( ( 1-iskew )*jc+ioffg, jc ), ilda,
873 DO 240 jch = jc - k, 1, -k
874 CALL slartg( a( jch+1-iskew*( icol+1 )+ioffg,
875 $ icol+1 ), extra, c, s, dummy )
876 temp = a( jch-iskew*( jch+1 )+ioffg, jch+1 )
877 CALL slarot( .true., .true., .true., k+2, c, -s,
878 $ a( ( 1-iskew )*jch+ioffg, jch ),
879 $ ilda, temp, extra )
880 irow = max( 1, jch-k )
881 il = min( jch+1, k+2 )
883 CALL slarot( .false., jch.GT.k, .true., il, c,
884 $ -s, a( irow-iskew*jch+ioffg, jch ),
885 $ ilda, extra, temp )
894 IF( ipack.NE.ipackg .AND. ipack.NE.3 )
THEN
896 irow = ioffst - iskew*jc
897 DO 270 jr = jc, min( n, jc+uub )
898 a( jr+irow, jc ) = a( jc-iskew*jr+ioffg, jr )
901 IF( ipack.EQ.5 )
THEN
902 DO 300 jc = n - uub + 1, n
903 DO 290 jr = n + 2 - jc, uub + 1
908 IF( ipackg.EQ.6 )
THEN
918 IF( ipack.GE.5 )
THEN
925 CALL scopy( mnmin, d, 1, a( 1-iskew+ioffg, 1 ), ilda+1 )
928 DO 320 jc = n - 1, 1, -1
929 il = min( n+1-jc, k+2 )
931 temp = a( 1+( 1-iskew )*jc+ioffg, jc )
932 angle = twopi*slarnd( 1, iseed )
935 CALL slarot( .false., .true., n-jc.GT.k, il, c, s,
936 $ a( ( 1-iskew )*jc+ioffg, jc ), ilda,
938 icol = max( 1, jc-k+1 )
939 CALL slarot( .true., .false., .true., jc+2-icol, c,
940 $ s, a( jc-iskew*icol+ioffg, icol ),
941 $ ilda, dummy, temp )
946 DO 310 jch = jc + k, n - 1, k
947 CALL slartg( a( jch-iskew*icol+ioffg, icol ),
948 $ extra, c, s, dummy )
949 temp = a( 1+( 1-iskew )*jch+ioffg, jch )
950 CALL slarot( .true., .true., .true., k+2, c, s,
951 $ a( jch-iskew*icol+ioffg, icol ),
952 $ ilda, extra, temp )
953 il = min( n+1-jch, k+2 )
955 CALL slarot( .false., .true., n-jch.GT.k, il, c,
956 $ s, a( ( 1-iskew )*jch+ioffg, jch ),
957 $ ilda, temp, extra )
966 IF( ipack.NE.ipackg .AND. ipack.NE.4 )
THEN
968 irow = ioffst - iskew*jc
969 DO 340 jr = jc, max( 1, jc-uub ), -1
970 a( jr+irow, jc ) = a( jc-iskew*jr+ioffg, jr )
973 IF( ipack.EQ.6 )
THEN
975 DO 360 jr = 1, uub + 1 - jc
980 IF( ipackg.EQ.5 )
THEN
1002 CALL slagge( mr, nc, llb, uub, d, a, lda, iseed, work,
1008 CALL slagsy( m, llb, d, a, lda, iseed, work, iinfo )
1011 IF( iinfo.NE.0 )
THEN
1019 IF( ipack.NE.ipackg )
THEN
1020 IF( ipack.EQ.1 )
THEN
1030 ELSE IF( ipack.EQ.2 )
THEN
1040 ELSE IF( ipack.EQ.3 )
THEN
1049 IF( irow.GT.lda )
THEN
1053 a( irow, icol ) = a( i, j )
1057 ELSE IF( ipack.EQ.4 )
THEN
1066 IF( irow.GT.lda )
THEN
1070 a( irow, icol ) = a( i, j )
1074 ELSE IF( ipack.GE.5 )
THEN
1086 DO 460 i = min( j+llb, m ), 1, -1
1087 a( i-j+uub+1, j ) = a( i, j )
1091 DO 490 j = uub + 2, n
1092 DO 480 i = j - uub, min( j+llb, m )
1093 a( i-j+uub+1, j ) = a( i, j )
1103 IF( ipack.EQ.3 .OR. ipack.EQ.4 )
THEN
1105 DO 500 jr = irow + 1, lda
1111 ELSE IF( ipack.GE.5 )
THEN
1122 DO 520 jr = 1, uub + 1 - jc
1125 DO 530 jr = max( 1, min( ir1, ir2-jc ) ), lda
subroutine xerbla(srname, info)
subroutine scopy(n, sx, incx, sy, incy)
SCOPY
subroutine slartg(f, g, c, s, r)
SLARTG generates a plane rotation with real cosine and real sine.
subroutine slaset(uplo, m, n, alpha, beta, a, lda)
SLASET initializes the off-diagonal elements and the diagonal elements of a matrix to given values.
subroutine sscal(n, sa, sx, incx)
SSCAL
subroutine slagge(m, n, kl, ku, d, a, lda, iseed, work, info)
SLAGGE
subroutine slagsy(n, k, d, a, lda, iseed, work, info)
SLAGSY
subroutine slarot(lrows, lleft, lright, nl, c, s, a, lda, xleft, xright)
SLAROT
subroutine slatm7(mode, cond, irsign, idist, iseed, d, n, rank, info)
SLATM7
subroutine slatmt(m, n, dist, iseed, sym, d, mode, cond, dmax, rank, kl, ku, pack, a, lda, work, info)
SLATMT