LAPACK 3.12.0 LAPACK: Linear Algebra PACKage
Searching...
No Matches

## ◆ clatmr()

 subroutine clatmr ( integer m, integer n, character dist, integer, dimension( 4 ) iseed, character sym, complex, dimension( * ) d, integer mode, real cond, complex dmax, character rsign, character grade, complex, dimension( * ) dl, integer model, real condl, complex, dimension( * ) dr, integer moder, real condr, character pivtng, integer, dimension( * ) ipivot, integer kl, integer ku, real sparse, real anorm, character pack, complex, dimension( lda, * ) a, integer lda, integer, dimension( * ) iwork, integer info )

CLATMR

Purpose:
CLATMR generates random matrices of various types for testing
LAPACK programs.

CLATMR operates by applying the following sequence of
operations:

Generate a matrix A with random entries of distribution DIST
which is symmetric if SYM='S', Hermitian if SYM='H', and
nonsymmetric if SYM='N'.

Set the diagonal to D, where D may be input or
computed according to MODE, COND, DMAX and RSIGN
as described below.

Grade the matrix, if desired, from the left and/or right
as specified by GRADE. The inputs DL, MODEL, CONDL, DR,
MODER and CONDR also determine the grading as described
below.

Permute, if desired, the rows and/or columns as specified by
PIVTNG and IPIVOT.

Set random entries to zero, if desired, to get a random sparse
matrix as specified by SPARSE.

Make A a band matrix, if desired, by zeroing out the matrix
outside a band of lower bandwidth KL and upper bandwidth KU.

Scale A, if desired, to have maximum entry ANORM.

Pack the matrix if desired. Options specified by PACK are:
no packing
zero out upper half (if symmetric or Hermitian)
zero out lower half (if symmetric or Hermitian)
store the upper half columnwise (if symmetric or Hermitian
or square upper triangular)
store the lower half columnwise (if symmetric or Hermitian
or square lower triangular)
same as upper half rowwise if symmetric
same as conjugate upper half rowwise if Hermitian
store the lower triangle in banded format
(if symmetric or Hermitian)
store the upper triangle in banded format
(if symmetric or Hermitian)
store the entire matrix in banded format

Note: If two calls to CLATMR differ only in the PACK parameter,
they will generate mathematically equivalent matrices.

If two calls to CLATMR both have full bandwidth (KL = M-1
and KU = N-1), and differ only in the PIVTNG and PACK
parameters, then the matrices generated will differ only
in the order of the rows and/or columns, and otherwise
contain the same data. This consistency cannot be and
is not maintained with less than full bandwidth.
Parameters

Definition at line 486 of file clatmr.f.

490*
491* -- LAPACK computational routine --
492* -- LAPACK is a software package provided by Univ. of Tennessee, --
493* -- Univ. of California Berkeley, Univ. of Colorado Denver and NAG Ltd..--
494*
495* .. Scalar Arguments ..
496 CHARACTER DIST, GRADE, PACK, PIVTNG, RSIGN, SYM
497 INTEGER INFO, KL, KU, LDA, M, MODE, MODEL, MODER, N
498 REAL ANORM, COND, CONDL, CONDR, SPARSE
499 COMPLEX DMAX
500* ..
501* .. Array Arguments ..
502 INTEGER IPIVOT( * ), ISEED( 4 ), IWORK( * )
503 COMPLEX A( LDA, * ), D( * ), DL( * ), DR( * )
504* ..
505*
506* =====================================================================
507*
508* .. Parameters ..
509 REAL ZERO
510 parameter( zero = 0.0e0 )
511 REAL ONE
512 parameter( one = 1.0e0 )
513 COMPLEX CONE
514 parameter( cone = ( 1.0e0, 0.0e0 ) )
515 COMPLEX CZERO
516 parameter( czero = ( 0.0e0, 0.0e0 ) )
517* ..
518* .. Local Scalars ..
520 INTEGER I, IDIST, IGRADE, IISUB, IPACK, IPVTNG, IRSIGN,
521 \$ ISUB, ISYM, J, JJSUB, JSUB, K, KLL, KUU, MNMIN,
522 \$ MNSUB, MXSUB, NPVTS
523 REAL ONORM, TEMP
524 COMPLEX CALPHA, CTEMP
525* ..
526* .. Local Arrays ..
527 REAL TEMPA( 1 )
528* ..
529* .. External Functions ..
530 LOGICAL LSAME
531 REAL CLANGB, CLANGE, CLANSB, CLANSP, CLANSY
532 COMPLEX CLATM2, CLATM3
533 EXTERNAL lsame, clangb, clange, clansb, clansp, clansy,
534 \$ clatm2, clatm3
535* ..
536* .. External Subroutines ..
537 EXTERNAL clatm1, csscal, xerbla
538* ..
539* .. Intrinsic Functions ..
540 INTRINSIC abs, conjg, max, min, mod, real
541* ..
542* .. Executable Statements ..
543*
544* 1) Decode and Test the input parameters.
545* Initialize flags & seed.
546*
547 info = 0
548*
549* Quick return if possible
550*
551 IF( m.EQ.0 .OR. n.EQ.0 )
552 \$ RETURN
553*
554* Decode DIST
555*
556 IF( lsame( dist, 'U' ) ) THEN
557 idist = 1
558 ELSE IF( lsame( dist, 'S' ) ) THEN
559 idist = 2
560 ELSE IF( lsame( dist, 'N' ) ) THEN
561 idist = 3
562 ELSE IF( lsame( dist, 'D' ) ) THEN
563 idist = 4
564 ELSE
565 idist = -1
566 END IF
567*
568* Decode SYM
569*
570 IF( lsame( sym, 'H' ) ) THEN
571 isym = 0
572 ELSE IF( lsame( sym, 'N' ) ) THEN
573 isym = 1
574 ELSE IF( lsame( sym, 'S' ) ) THEN
575 isym = 2
576 ELSE
577 isym = -1
578 END IF
579*
580* Decode RSIGN
581*
582 IF( lsame( rsign, 'F' ) ) THEN
583 irsign = 0
584 ELSE IF( lsame( rsign, 'T' ) ) THEN
585 irsign = 1
586 ELSE
587 irsign = -1
588 END IF
589*
590* Decode PIVTNG
591*
592 IF( lsame( pivtng, 'N' ) ) THEN
593 ipvtng = 0
594 ELSE IF( lsame( pivtng, ' ' ) ) THEN
595 ipvtng = 0
596 ELSE IF( lsame( pivtng, 'L' ) ) THEN
597 ipvtng = 1
598 npvts = m
599 ELSE IF( lsame( pivtng, 'R' ) ) THEN
600 ipvtng = 2
601 npvts = n
602 ELSE IF( lsame( pivtng, 'B' ) ) THEN
603 ipvtng = 3
604 npvts = min( n, m )
605 ELSE IF( lsame( pivtng, 'F' ) ) THEN
606 ipvtng = 3
607 npvts = min( n, m )
608 ELSE
609 ipvtng = -1
610 END IF
611*
613*
614 IF( lsame( grade, 'N' ) ) THEN
616 ELSE IF( lsame( grade, 'L' ) ) THEN
618 ELSE IF( lsame( grade, 'R' ) ) THEN
620 ELSE IF( lsame( grade, 'B' ) ) THEN
622 ELSE IF( lsame( grade, 'E' ) ) THEN
624 ELSE IF( lsame( grade, 'H' ) ) THEN
626 ELSE IF( lsame( grade, 'S' ) ) THEN
628 ELSE
630 END IF
631*
632* Decode PACK
633*
634 IF( lsame( pack, 'N' ) ) THEN
635 ipack = 0
636 ELSE IF( lsame( pack, 'U' ) ) THEN
637 ipack = 1
638 ELSE IF( lsame( pack, 'L' ) ) THEN
639 ipack = 2
640 ELSE IF( lsame( pack, 'C' ) ) THEN
641 ipack = 3
642 ELSE IF( lsame( pack, 'R' ) ) THEN
643 ipack = 4
644 ELSE IF( lsame( pack, 'B' ) ) THEN
645 ipack = 5
646 ELSE IF( lsame( pack, 'Q' ) ) THEN
647 ipack = 6
648 ELSE IF( lsame( pack, 'Z' ) ) THEN
649 ipack = 7
650 ELSE
651 ipack = -1
652 END IF
653*
654* Set certain internal parameters
655*
656 mnmin = min( m, n )
657 kll = min( kl, m-1 )
658 kuu = min( ku, n-1 )
659*
660* If inv(DL) is used, check to see if DL has a zero entry.
661*
662 dzero = .false.
663 IF( igrade.EQ.4 .AND. model.EQ.0 ) THEN
664 DO 10 i = 1, m
665 IF( dl( i ).EQ.czero )
666 \$ dzero = .true.
667 10 CONTINUE
668 END IF
669*
670* Check values in IPIVOT
671*
673 IF( ipvtng.GT.0 ) THEN
674 DO 20 j = 1, npvts
675 IF( ipivot( j ).LE.0 .OR. ipivot( j ).GT.npvts )
677 20 CONTINUE
678 END IF
679*
680* Set INFO if an error
681*
682 IF( m.LT.0 ) THEN
683 info = -1
684 ELSE IF( m.NE.n .AND. ( isym.EQ.0 .OR. isym.EQ.2 ) ) THEN
685 info = -1
686 ELSE IF( n.LT.0 ) THEN
687 info = -2
688 ELSE IF( idist.EQ.-1 ) THEN
689 info = -3
690 ELSE IF( isym.EQ.-1 ) THEN
691 info = -5
692 ELSE IF( mode.LT.-6 .OR. mode.GT.6 ) THEN
693 info = -7
694 ELSE IF( ( mode.NE.-6 .AND. mode.NE.0 .AND. mode.NE.6 ) .AND.
695 \$ cond.LT.one ) THEN
696 info = -8
697 ELSE IF( ( mode.NE.-6 .AND. mode.NE.0 .AND. mode.NE.6 ) .AND.
698 \$ irsign.EQ.-1 ) THEN
699 info = -10
705 info = -11
706 ELSE IF( igrade.EQ.4 .AND. dzero ) THEN
707 info = -12
710 \$ ( model.LT.-6 .OR. model.GT.6 ) ) THEN
711 info = -13
714 \$ ( model.NE.-6 .AND. model.NE.0 .AND. model.NE.6 ) .AND.
715 \$ condl.LT.one ) THEN
716 info = -14
718 \$ ( moder.LT.-6 .OR. moder.GT.6 ) ) THEN
719 info = -16
721 \$ ( moder.NE.-6 .AND. moder.NE.0 .AND. moder.NE.6 ) .AND.
722 \$ condr.LT.one ) THEN
723 info = -17
724 ELSE IF( ipvtng.EQ.-1 .OR. ( ipvtng.EQ.3 .AND. m.NE.n ) .OR.
725 \$ ( ( ipvtng.EQ.1 .OR. ipvtng.EQ.2 ) .AND. ( isym.EQ.0 .OR.
726 \$ isym.EQ.2 ) ) ) THEN
727 info = -18
728 ELSE IF( ipvtng.NE.0 .AND. badpvt ) THEN
729 info = -19
730 ELSE IF( kl.LT.0 ) THEN
731 info = -20
732 ELSE IF( ku.LT.0 .OR. ( ( isym.EQ.0 .OR. isym.EQ.2 ) .AND. kl.NE.
733 \$ ku ) ) THEN
734 info = -21
735 ELSE IF( sparse.LT.zero .OR. sparse.GT.one ) THEN
736 info = -22
737 ELSE IF( ipack.EQ.-1 .OR. ( ( ipack.EQ.1 .OR. ipack.EQ.2 .OR.
738 \$ ipack.EQ.5 .OR. ipack.EQ.6 ) .AND. isym.EQ.1 ) .OR.
739 \$ ( ipack.EQ.3 .AND. isym.EQ.1 .AND. ( kl.NE.0 .OR. m.NE.
740 \$ n ) ) .OR. ( ipack.EQ.4 .AND. isym.EQ.1 .AND. ( ku.NE.
741 \$ 0 .OR. m.NE.n ) ) ) THEN
742 info = -24
743 ELSE IF( ( ( ipack.EQ.0 .OR. ipack.EQ.1 .OR. ipack.EQ.2 ) .AND.
744 \$ lda.LT.max( 1, m ) ) .OR. ( ( ipack.EQ.3 .OR. ipack.EQ.
745 \$ 4 ) .AND. lda.LT.1 ) .OR. ( ( ipack.EQ.5 .OR. ipack.EQ.
746 \$ 6 ) .AND. lda.LT.kuu+1 ) .OR.
747 \$ ( ipack.EQ.7 .AND. lda.LT.kll+kuu+1 ) ) THEN
748 info = -26
749 END IF
750*
751 IF( info.NE.0 ) THEN
752 CALL xerbla( 'CLATMR', -info )
753 RETURN
754 END IF
755*
756* Decide if we can pivot consistently
757*
758 fulbnd = .false.
759 IF( kuu.EQ.n-1 .AND. kll.EQ.m-1 )
760 \$ fulbnd = .true.
761*
762* Initialize random number generator
763*
764 DO 30 i = 1, 4
765 iseed( i ) = mod( abs( iseed( i ) ), 4096 )
766 30 CONTINUE
767*
768 iseed( 4 ) = 2*( iseed( 4 ) / 2 ) + 1
769*
770* 2) Set up D, DL, and DR, if indicated.
771*
772* Compute D according to COND and MODE
773*
774 CALL clatm1( mode, cond, irsign, idist, iseed, d, mnmin, info )
775 IF( info.NE.0 ) THEN
776 info = 1
777 RETURN
778 END IF
779 IF( mode.NE.0 .AND. mode.NE.-6 .AND. mode.NE.6 ) THEN
780*
781* Scale by DMAX
782*
783 temp = abs( d( 1 ) )
784 DO 40 i = 2, mnmin
785 temp = max( temp, abs( d( i ) ) )
786 40 CONTINUE
787 IF( temp.EQ.zero .AND. dmax.NE.czero ) THEN
788 info = 2
789 RETURN
790 END IF
791 IF( temp.NE.zero ) THEN
792 calpha = dmax / temp
793 ELSE
794 calpha = cone
795 END IF
796 DO 50 i = 1, mnmin
797 d( i ) = calpha*d( i )
798 50 CONTINUE
799*
800 END IF
801*
802* If matrix Hermitian, make D real
803*
804 IF( isym.EQ.0 ) THEN
805 DO 60 i = 1, mnmin
806 d( i ) = real( d( i ) )
807 60 CONTINUE
808 END IF
809*
810* Compute DL if grading set
811*
813 \$ 5 .OR. igrade.EQ.6 ) THEN
814 CALL clatm1( model, condl, 0, idist, iseed, dl, m, info )
815 IF( info.NE.0 ) THEN
816 info = 3
817 RETURN
818 END IF
819 END IF
820*
821* Compute DR if grading set
822*
824 CALL clatm1( moder, condr, 0, idist, iseed, dr, n, info )
825 IF( info.NE.0 ) THEN
826 info = 4
827 RETURN
828 END IF
829 END IF
830*
831* 3) Generate IWORK if pivoting
832*
833 IF( ipvtng.GT.0 ) THEN
834 DO 70 i = 1, npvts
835 iwork( i ) = i
836 70 CONTINUE
837 IF( fulbnd ) THEN
838 DO 80 i = 1, npvts
839 k = ipivot( i )
840 j = iwork( i )
841 iwork( i ) = iwork( k )
842 iwork( k ) = j
843 80 CONTINUE
844 ELSE
845 DO 90 i = npvts, 1, -1
846 k = ipivot( i )
847 j = iwork( i )
848 iwork( i ) = iwork( k )
849 iwork( k ) = j
850 90 CONTINUE
851 END IF
852 END IF
853*
854* 4) Generate matrices for each kind of PACKing
855* Always sweep matrix columnwise (if symmetric, upper
856* half only) so that matrix generated does not depend
857* on PACK
858*
859 IF( fulbnd ) THEN
860*
861* Use CLATM3 so matrices generated with differing PIVOTing only
862* differ only in the order of their rows and/or columns.
863*
864 IF( ipack.EQ.0 ) THEN
865 IF( isym.EQ.0 ) THEN
866 DO 110 j = 1, n
867 DO 100 i = 1, j
868 ctemp = clatm3( m, n, i, j, isub, jsub, kl, ku,
869 \$ idist, iseed, d, igrade, dl, dr, ipvtng,
870 \$ iwork, sparse )
871 a( isub, jsub ) = ctemp
872 a( jsub, isub ) = conjg( ctemp )
873 100 CONTINUE
874 110 CONTINUE
875 ELSE IF( isym.EQ.1 ) THEN
876 DO 130 j = 1, n
877 DO 120 i = 1, m
878 ctemp = clatm3( m, n, i, j, isub, jsub, kl, ku,
879 \$ idist, iseed, d, igrade, dl, dr, ipvtng,
880 \$ iwork, sparse )
881 a( isub, jsub ) = ctemp
882 120 CONTINUE
883 130 CONTINUE
884 ELSE IF( isym.EQ.2 ) THEN
885 DO 150 j = 1, n
886 DO 140 i = 1, j
887 ctemp = clatm3( m, n, i, j, isub, jsub, kl, ku,
888 \$ idist, iseed, d, igrade, dl, dr, ipvtng,
889 \$ iwork, sparse )
890 a( isub, jsub ) = ctemp
891 a( jsub, isub ) = ctemp
892 140 CONTINUE
893 150 CONTINUE
894 END IF
895*
896 ELSE IF( ipack.EQ.1 ) THEN
897*
898 DO 170 j = 1, n
899 DO 160 i = 1, j
900 ctemp = clatm3( m, n, i, j, isub, jsub, kl, ku, idist,
901 \$ iseed, d, igrade, dl, dr, ipvtng, iwork,
902 \$ sparse )
903 mnsub = min( isub, jsub )
904 mxsub = max( isub, jsub )
905 IF( mxsub.EQ.isub .AND. isym.EQ.0 ) THEN
906 a( mnsub, mxsub ) = conjg( ctemp )
907 ELSE
908 a( mnsub, mxsub ) = ctemp
909 END IF
910 IF( mnsub.NE.mxsub )
911 \$ a( mxsub, mnsub ) = czero
912 160 CONTINUE
913 170 CONTINUE
914*
915 ELSE IF( ipack.EQ.2 ) THEN
916*
917 DO 190 j = 1, n
918 DO 180 i = 1, j
919 ctemp = clatm3( m, n, i, j, isub, jsub, kl, ku, idist,
920 \$ iseed, d, igrade, dl, dr, ipvtng, iwork,
921 \$ sparse )
922 mnsub = min( isub, jsub )
923 mxsub = max( isub, jsub )
924 IF( mxsub.EQ.jsub .AND. isym.EQ.0 ) THEN
925 a( mxsub, mnsub ) = conjg( ctemp )
926 ELSE
927 a( mxsub, mnsub ) = ctemp
928 END IF
929 IF( mnsub.NE.mxsub )
930 \$ a( mnsub, mxsub ) = czero
931 180 CONTINUE
932 190 CONTINUE
933*
934 ELSE IF( ipack.EQ.3 ) THEN
935*
936 DO 210 j = 1, n
937 DO 200 i = 1, j
938 ctemp = clatm3( m, n, i, j, isub, jsub, kl, ku, idist,
939 \$ iseed, d, igrade, dl, dr, ipvtng, iwork,
940 \$ sparse )
941*
942* Compute K = location of (ISUB,JSUB) entry in packed
943* array
944*
945 mnsub = min( isub, jsub )
946 mxsub = max( isub, jsub )
947 k = mxsub*( mxsub-1 ) / 2 + mnsub
948*
949* Convert K to (IISUB,JJSUB) location
950*
951 jjsub = ( k-1 ) / lda + 1
952 iisub = k - lda*( jjsub-1 )
953*
954 IF( mxsub.EQ.isub .AND. isym.EQ.0 ) THEN
955 a( iisub, jjsub ) = conjg( ctemp )
956 ELSE
957 a( iisub, jjsub ) = ctemp
958 END IF
959 200 CONTINUE
960 210 CONTINUE
961*
962 ELSE IF( ipack.EQ.4 ) THEN
963*
964 DO 230 j = 1, n
965 DO 220 i = 1, j
966 ctemp = clatm3( m, n, i, j, isub, jsub, kl, ku, idist,
967 \$ iseed, d, igrade, dl, dr, ipvtng, iwork,
968 \$ sparse )
969*
970* Compute K = location of (I,J) entry in packed array
971*
972 mnsub = min( isub, jsub )
973 mxsub = max( isub, jsub )
974 IF( mnsub.EQ.1 ) THEN
975 k = mxsub
976 ELSE
977 k = n*( n+1 ) / 2 - ( n-mnsub+1 )*( n-mnsub+2 ) /
978 \$ 2 + mxsub - mnsub + 1
979 END IF
980*
981* Convert K to (IISUB,JJSUB) location
982*
983 jjsub = ( k-1 ) / lda + 1
984 iisub = k - lda*( jjsub-1 )
985*
986 IF( mxsub.EQ.jsub .AND. isym.EQ.0 ) THEN
987 a( iisub, jjsub ) = conjg( ctemp )
988 ELSE
989 a( iisub, jjsub ) = ctemp
990 END IF
991 220 CONTINUE
992 230 CONTINUE
993*
994 ELSE IF( ipack.EQ.5 ) THEN
995*
996 DO 250 j = 1, n
997 DO 240 i = j - kuu, j
998 IF( i.LT.1 ) THEN
999 a( j-i+1, i+n ) = czero
1000 ELSE
1001 ctemp = clatm3( m, n, i, j, isub, jsub, kl, ku,
1002 \$ idist, iseed, d, igrade, dl, dr, ipvtng,
1003 \$ iwork, sparse )
1004 mnsub = min( isub, jsub )
1005 mxsub = max( isub, jsub )
1006 IF( mxsub.EQ.jsub .AND. isym.EQ.0 ) THEN
1007 a( mxsub-mnsub+1, mnsub ) = conjg( ctemp )
1008 ELSE
1009 a( mxsub-mnsub+1, mnsub ) = ctemp
1010 END IF
1011 END IF
1012 240 CONTINUE
1013 250 CONTINUE
1014*
1015 ELSE IF( ipack.EQ.6 ) THEN
1016*
1017 DO 270 j = 1, n
1018 DO 260 i = j - kuu, j
1019 ctemp = clatm3( m, n, i, j, isub, jsub, kl, ku, idist,
1020 \$ iseed, d, igrade, dl, dr, ipvtng, iwork,
1021 \$ sparse )
1022 mnsub = min( isub, jsub )
1023 mxsub = max( isub, jsub )
1024 IF( mxsub.EQ.isub .AND. isym.EQ.0 ) THEN
1025 a( mnsub-mxsub+kuu+1, mxsub ) = conjg( ctemp )
1026 ELSE
1027 a( mnsub-mxsub+kuu+1, mxsub ) = ctemp
1028 END IF
1029 260 CONTINUE
1030 270 CONTINUE
1031*
1032 ELSE IF( ipack.EQ.7 ) THEN
1033*
1034 IF( isym.NE.1 ) THEN
1035 DO 290 j = 1, n
1036 DO 280 i = j - kuu, j
1037 ctemp = clatm3( m, n, i, j, isub, jsub, kl, ku,
1038 \$ idist, iseed, d, igrade, dl, dr, ipvtng,
1039 \$ iwork, sparse )
1040 mnsub = min( isub, jsub )
1041 mxsub = max( isub, jsub )
1042 IF( i.LT.1 )
1043 \$ a( j-i+1+kuu, i+n ) = czero
1044 IF( mxsub.EQ.isub .AND. isym.EQ.0 ) THEN
1045 a( mnsub-mxsub+kuu+1, mxsub ) = conjg( ctemp )
1046 ELSE
1047 a( mnsub-mxsub+kuu+1, mxsub ) = ctemp
1048 END IF
1049 IF( i.GE.1 .AND. mnsub.NE.mxsub ) THEN
1050 IF( mnsub.EQ.isub .AND. isym.EQ.0 ) THEN
1051 a( mxsub-mnsub+1+kuu,
1052 \$ mnsub ) = conjg( ctemp )
1053 ELSE
1054 a( mxsub-mnsub+1+kuu, mnsub ) = ctemp
1055 END IF
1056 END IF
1057 280 CONTINUE
1058 290 CONTINUE
1059 ELSE IF( isym.EQ.1 ) THEN
1060 DO 310 j = 1, n
1061 DO 300 i = j - kuu, j + kll
1062 ctemp = clatm3( m, n, i, j, isub, jsub, kl, ku,
1063 \$ idist, iseed, d, igrade, dl, dr, ipvtng,
1064 \$ iwork, sparse )
1065 a( isub-jsub+kuu+1, jsub ) = ctemp
1066 300 CONTINUE
1067 310 CONTINUE
1068 END IF
1069*
1070 END IF
1071*
1072 ELSE
1073*
1074* Use CLATM2
1075*
1076 IF( ipack.EQ.0 ) THEN
1077 IF( isym.EQ.0 ) THEN
1078 DO 330 j = 1, n
1079 DO 320 i = 1, j
1080 a( i, j ) = clatm2( m, n, i, j, kl, ku, idist,
1081 \$ iseed, d, igrade, dl, dr, ipvtng,
1082 \$ iwork, sparse )
1083 a( j, i ) = conjg( a( i, j ) )
1084 320 CONTINUE
1085 330 CONTINUE
1086 ELSE IF( isym.EQ.1 ) THEN
1087 DO 350 j = 1, n
1088 DO 340 i = 1, m
1089 a( i, j ) = clatm2( m, n, i, j, kl, ku, idist,
1090 \$ iseed, d, igrade, dl, dr, ipvtng,
1091 \$ iwork, sparse )
1092 340 CONTINUE
1093 350 CONTINUE
1094 ELSE IF( isym.EQ.2 ) THEN
1095 DO 370 j = 1, n
1096 DO 360 i = 1, j
1097 a( i, j ) = clatm2( m, n, i, j, kl, ku, idist,
1098 \$ iseed, d, igrade, dl, dr, ipvtng,
1099 \$ iwork, sparse )
1100 a( j, i ) = a( i, j )
1101 360 CONTINUE
1102 370 CONTINUE
1103 END IF
1104*
1105 ELSE IF( ipack.EQ.1 ) THEN
1106*
1107 DO 390 j = 1, n
1108 DO 380 i = 1, j
1109 a( i, j ) = clatm2( m, n, i, j, kl, ku, idist, iseed,
1110 \$ d, igrade, dl, dr, ipvtng, iwork, sparse )
1111 IF( i.NE.j )
1112 \$ a( j, i ) = czero
1113 380 CONTINUE
1114 390 CONTINUE
1115*
1116 ELSE IF( ipack.EQ.2 ) THEN
1117*
1118 DO 410 j = 1, n
1119 DO 400 i = 1, j
1120 IF( isym.EQ.0 ) THEN
1121 a( j, i ) = conjg( clatm2( m, n, i, j, kl, ku,
1122 \$ idist, iseed, d, igrade, dl, dr,
1123 \$ ipvtng, iwork, sparse ) )
1124 ELSE
1125 a( j, i ) = clatm2( m, n, i, j, kl, ku, idist,
1126 \$ iseed, d, igrade, dl, dr, ipvtng,
1127 \$ iwork, sparse )
1128 END IF
1129 IF( i.NE.j )
1130 \$ a( i, j ) = czero
1131 400 CONTINUE
1132 410 CONTINUE
1133*
1134 ELSE IF( ipack.EQ.3 ) THEN
1135*
1136 isub = 0
1137 jsub = 1
1138 DO 430 j = 1, n
1139 DO 420 i = 1, j
1140 isub = isub + 1
1141 IF( isub.GT.lda ) THEN
1142 isub = 1
1143 jsub = jsub + 1
1144 END IF
1145 a( isub, jsub ) = clatm2( m, n, i, j, kl, ku, idist,
1146 \$ iseed, d, igrade, dl, dr, ipvtng,
1147 \$ iwork, sparse )
1148 420 CONTINUE
1149 430 CONTINUE
1150*
1151 ELSE IF( ipack.EQ.4 ) THEN
1152*
1153 IF( isym.EQ.0 .OR. isym.EQ.2 ) THEN
1154 DO 450 j = 1, n
1155 DO 440 i = 1, j
1156*
1157* Compute K = location of (I,J) entry in packed array
1158*
1159 IF( i.EQ.1 ) THEN
1160 k = j
1161 ELSE
1162 k = n*( n+1 ) / 2 - ( n-i+1 )*( n-i+2 ) / 2 +
1163 \$ j - i + 1
1164 END IF
1165*
1166* Convert K to (ISUB,JSUB) location
1167*
1168 jsub = ( k-1 ) / lda + 1
1169 isub = k - lda*( jsub-1 )
1170*
1171 a( isub, jsub ) = clatm2( m, n, i, j, kl, ku,
1172 \$ idist, iseed, d, igrade, dl, dr,
1173 \$ ipvtng, iwork, sparse )
1174 IF( isym.EQ.0 )
1175 \$ a( isub, jsub ) = conjg( a( isub, jsub ) )
1176 440 CONTINUE
1177 450 CONTINUE
1178 ELSE
1179 isub = 0
1180 jsub = 1
1181 DO 470 j = 1, n
1182 DO 460 i = j, m
1183 isub = isub + 1
1184 IF( isub.GT.lda ) THEN
1185 isub = 1
1186 jsub = jsub + 1
1187 END IF
1188 a( isub, jsub ) = clatm2( m, n, i, j, kl, ku,
1189 \$ idist, iseed, d, igrade, dl, dr,
1190 \$ ipvtng, iwork, sparse )
1191 460 CONTINUE
1192 470 CONTINUE
1193 END IF
1194*
1195 ELSE IF( ipack.EQ.5 ) THEN
1196*
1197 DO 490 j = 1, n
1198 DO 480 i = j - kuu, j
1199 IF( i.LT.1 ) THEN
1200 a( j-i+1, i+n ) = czero
1201 ELSE
1202 IF( isym.EQ.0 ) THEN
1203 a( j-i+1, i ) = conjg( clatm2( m, n, i, j, kl,
1204 \$ ku, idist, iseed, d, igrade, dl,
1205 \$ dr, ipvtng, iwork, sparse ) )
1206 ELSE
1207 a( j-i+1, i ) = clatm2( m, n, i, j, kl, ku,
1208 \$ idist, iseed, d, igrade, dl, dr,
1209 \$ ipvtng, iwork, sparse )
1210 END IF
1211 END IF
1212 480 CONTINUE
1213 490 CONTINUE
1214*
1215 ELSE IF( ipack.EQ.6 ) THEN
1216*
1217 DO 510 j = 1, n
1218 DO 500 i = j - kuu, j
1219 a( i-j+kuu+1, j ) = clatm2( m, n, i, j, kl, ku, idist,
1220 \$ iseed, d, igrade, dl, dr, ipvtng,
1221 \$ iwork, sparse )
1222 500 CONTINUE
1223 510 CONTINUE
1224*
1225 ELSE IF( ipack.EQ.7 ) THEN
1226*
1227 IF( isym.NE.1 ) THEN
1228 DO 530 j = 1, n
1229 DO 520 i = j - kuu, j
1230 a( i-j+kuu+1, j ) = clatm2( m, n, i, j, kl, ku,
1231 \$ idist, iseed, d, igrade, dl,
1232 \$ dr, ipvtng, iwork, sparse )
1233 IF( i.LT.1 )
1234 \$ a( j-i+1+kuu, i+n ) = czero
1235 IF( i.GE.1 .AND. i.NE.j ) THEN
1236 IF( isym.EQ.0 ) THEN
1237 a( j-i+1+kuu, i ) = conjg( a( i-j+kuu+1,
1238 \$ j ) )
1239 ELSE
1240 a( j-i+1+kuu, i ) = a( i-j+kuu+1, j )
1241 END IF
1242 END IF
1243 520 CONTINUE
1244 530 CONTINUE
1245 ELSE IF( isym.EQ.1 ) THEN
1246 DO 550 j = 1, n
1247 DO 540 i = j - kuu, j + kll
1248 a( i-j+kuu+1, j ) = clatm2( m, n, i, j, kl, ku,
1249 \$ idist, iseed, d, igrade, dl,
1250 \$ dr, ipvtng, iwork, sparse )
1251 540 CONTINUE
1252 550 CONTINUE
1253 END IF
1254*
1255 END IF
1256*
1257 END IF
1258*
1259* 5) Scaling the norm
1260*
1261 IF( ipack.EQ.0 ) THEN
1262 onorm = clange( 'M', m, n, a, lda, tempa )
1263 ELSE IF( ipack.EQ.1 ) THEN
1264 onorm = clansy( 'M', 'U', n, a, lda, tempa )
1265 ELSE IF( ipack.EQ.2 ) THEN
1266 onorm = clansy( 'M', 'L', n, a, lda, tempa )
1267 ELSE IF( ipack.EQ.3 ) THEN
1268 onorm = clansp( 'M', 'U', n, a, tempa )
1269 ELSE IF( ipack.EQ.4 ) THEN
1270 onorm = clansp( 'M', 'L', n, a, tempa )
1271 ELSE IF( ipack.EQ.5 ) THEN
1272 onorm = clansb( 'M', 'L', n, kll, a, lda, tempa )
1273 ELSE IF( ipack.EQ.6 ) THEN
1274 onorm = clansb( 'M', 'U', n, kuu, a, lda, tempa )
1275 ELSE IF( ipack.EQ.7 ) THEN
1276 onorm = clangb( 'M', n, kll, kuu, a, lda, tempa )
1277 END IF
1278*
1279 IF( anorm.GE.zero ) THEN
1280*
1281 IF( anorm.GT.zero .AND. onorm.EQ.zero ) THEN
1282*
1283* Desired scaling impossible
1284*
1285 info = 5
1286 RETURN
1287*
1288 ELSE IF( ( anorm.GT.one .AND. onorm.LT.one ) .OR.
1289 \$ ( anorm.LT.one .AND. onorm.GT.one ) ) THEN
1290*
1291* Scale carefully to avoid over / underflow
1292*
1293 IF( ipack.LE.2 ) THEN
1294 DO 560 j = 1, n
1295 CALL csscal( m, one / onorm, a( 1, j ), 1 )
1296 CALL csscal( m, anorm, a( 1, j ), 1 )
1297 560 CONTINUE
1298*
1299 ELSE IF( ipack.EQ.3 .OR. ipack.EQ.4 ) THEN
1300*
1301 CALL csscal( n*( n+1 ) / 2, one / onorm, a, 1 )
1302 CALL csscal( n*( n+1 ) / 2, anorm, a, 1 )
1303*
1304 ELSE IF( ipack.GE.5 ) THEN
1305*
1306 DO 570 j = 1, n
1307 CALL csscal( kll+kuu+1, one / onorm, a( 1, j ), 1 )
1308 CALL csscal( kll+kuu+1, anorm, a( 1, j ), 1 )
1309 570 CONTINUE
1310*
1311 END IF
1312*
1313 ELSE
1314*
1315* Scale straightforwardly
1316*
1317 IF( ipack.LE.2 ) THEN
1318 DO 580 j = 1, n
1319 CALL csscal( m, anorm / onorm, a( 1, j ), 1 )
1320 580 CONTINUE
1321*
1322 ELSE IF( ipack.EQ.3 .OR. ipack.EQ.4 ) THEN
1323*
1324 CALL csscal( n*( n+1 ) / 2, anorm / onorm, a, 1 )
1325*
1326 ELSE IF( ipack.GE.5 ) THEN
1327*
1328 DO 590 j = 1, n
1329 CALL csscal( kll+kuu+1, anorm / onorm, a( 1, j ), 1 )
1330 590 CONTINUE
1331 END IF
1332*
1333 END IF
1334*
1335 END IF
1336*
1337* End of CLATMR
1338*
subroutine xerbla(srname, info)
Definition cblat2.f:3285
subroutine clatm1(mode, cond, irsign, idist, iseed, d, n, info)
CLATM1
Definition clatm1.f:137
complex function clatm2(m, n, i, j, kl, ku, idist, iseed, d, igrade, dl, dr, ipvtng, iwork, sparse)
CLATM2
Definition clatm2.f:212
complex function clatm3(m, n, i, j, isub, jsub, kl, ku, idist, iseed, d, igrade, dl, dr, ipvtng, iwork, sparse)
CLATM3
Definition clatm3.f:229
real function clangb(norm, n, kl, ku, ab, ldab, work)
CLANGB returns the value of the 1-norm, Frobenius norm, infinity-norm, or the largest absolute value ...
Definition clangb.f:125
real function clange(norm, m, n, a, lda, work)
CLANGE returns the value of the 1-norm, Frobenius norm, infinity-norm, or the largest absolute value ...
Definition clange.f:115
real function clansb(norm, uplo, n, k, ab, ldab, work)
CLANSB returns the value of the 1-norm, or the Frobenius norm, or the infinity norm,...
Definition clansb.f:130
real function clansy(norm, uplo, n, a, lda, work)
CLANSY returns the value of the 1-norm, or the Frobenius norm, or the infinity norm,...
Definition clansy.f:123
real function clansp(norm, uplo, n, ap, work)
CLANSP returns the value of the 1-norm, or the Frobenius norm, or the infinity norm,...
Definition clansp.f:115
logical function lsame(ca, cb)
LSAME
Definition lsame.f:48
subroutine csscal(n, sa, cx, incx)
CSSCAL
Definition csscal.f:78
Here is the call graph for this function:
Here is the caller graph for this function: