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

◆ zmake()

subroutine zmake ( character*2  type,
character*1  uplo,
character*1  diag,
integer  m,
integer  n,
complex*16, dimension( nmax, * )  a,
integer  nmax,
complex*16, dimension( * )  aa,
integer  lda,
logical  reset,
complex*16  transl 
)

Definition at line 2929 of file zblat3.f.

2931*
2932* Generates values for an M by N matrix A.
2933* Stores the values in the array AA in the data structure required
2934* by the routine, with unwanted elements set to rogue value.
2935*
2936* TYPE is 'GE', 'HE', 'SY' or 'TR'.
2937*
2938* Auxiliary routine for test program for Level 3 Blas.
2939*
2940* -- Written on 8-February-1989.
2941* Jack Dongarra, Argonne National Laboratory.
2942* Iain Duff, AERE Harwell.
2943* Jeremy Du Croz, Numerical Algorithms Group Ltd.
2944* Sven Hammarling, Numerical Algorithms Group Ltd.
2945*
2946* .. Parameters ..
2947 COMPLEX*16 ZERO, ONE
2948 parameter( zero = ( 0.0d0, 0.0d0 ),
2949 $ one = ( 1.0d0, 0.0d0 ) )
2950 COMPLEX*16 ROGUE
2951 parameter( rogue = ( -1.0d10, 1.0d10 ) )
2952 DOUBLE PRECISION RZERO
2953 parameter( rzero = 0.0d0 )
2954 DOUBLE PRECISION RROGUE
2955 parameter( rrogue = -1.0d10 )
2956* .. Scalar Arguments ..
2957 COMPLEX*16 TRANSL
2958 INTEGER LDA, M, N, NMAX
2959 LOGICAL RESET
2960 CHARACTER*1 DIAG, UPLO
2961 CHARACTER*2 TYPE
2962* .. Array Arguments ..
2963 COMPLEX*16 A( NMAX, * ), AA( * )
2964* .. Local Scalars ..
2965 INTEGER I, IBEG, IEND, J, JJ
2966 LOGICAL GEN, HER, LOWER, SYM, TRI, UNIT, UPPER
2967* .. External Functions ..
2968 COMPLEX*16 ZBEG
2969 EXTERNAL zbeg
2970* .. Intrinsic Functions ..
2971 INTRINSIC dcmplx, dconjg, dble
2972* .. Executable Statements ..
2973 gen = type.EQ.'GE'
2974 her = type.EQ.'HE'
2975 sym = type.EQ.'SY'
2976 tri = type.EQ.'TR'
2977 upper = ( her.OR.sym.OR.tri ).AND.uplo.EQ.'U'
2978 lower = ( her.OR.sym.OR.tri ).AND.uplo.EQ.'L'
2979 unit = tri.AND.diag.EQ.'U'
2980*
2981* Generate data in array A.
2982*
2983 DO 20 j = 1, n
2984 DO 10 i = 1, m
2985 IF( gen.OR.( upper.AND.i.LE.j ).OR.( lower.AND.i.GE.j ) )
2986 $ THEN
2987 a( i, j ) = zbeg( reset ) + transl
2988 IF( i.NE.j )THEN
2989* Set some elements to zero
2990 IF( n.GT.3.AND.j.EQ.n/2 )
2991 $ a( i, j ) = zero
2992 IF( her )THEN
2993 a( j, i ) = dconjg( a( i, j ) )
2994 ELSE IF( sym )THEN
2995 a( j, i ) = a( i, j )
2996 ELSE IF( tri )THEN
2997 a( j, i ) = zero
2998 END IF
2999 END IF
3000 END IF
3001 10 CONTINUE
3002 IF( her )
3003 $ a( j, j ) = dcmplx( dble( a( j, j ) ), rzero )
3004 IF( tri )
3005 $ a( j, j ) = a( j, j ) + one
3006 IF( unit )
3007 $ a( j, j ) = one
3008 20 CONTINUE
3009*
3010* Store elements in array AS in data structure required by routine.
3011*
3012 IF( type.EQ.'GE' )THEN
3013 DO 50 j = 1, n
3014 DO 30 i = 1, m
3015 aa( i + ( j - 1 )*lda ) = a( i, j )
3016 30 CONTINUE
3017 DO 40 i = m + 1, lda
3018 aa( i + ( j - 1 )*lda ) = rogue
3019 40 CONTINUE
3020 50 CONTINUE
3021 ELSE IF( type.EQ.'HE'.OR.type.EQ.'SY'.OR.type.EQ.'TR' )THEN
3022 DO 90 j = 1, n
3023 IF( upper )THEN
3024 ibeg = 1
3025 IF( unit )THEN
3026 iend = j - 1
3027 ELSE
3028 iend = j
3029 END IF
3030 ELSE
3031 IF( unit )THEN
3032 ibeg = j + 1
3033 ELSE
3034 ibeg = j
3035 END IF
3036 iend = n
3037 END IF
3038 DO 60 i = 1, ibeg - 1
3039 aa( i + ( j - 1 )*lda ) = rogue
3040 60 CONTINUE
3041 DO 70 i = ibeg, iend
3042 aa( i + ( j - 1 )*lda ) = a( i, j )
3043 70 CONTINUE
3044 DO 80 i = iend + 1, lda
3045 aa( i + ( j - 1 )*lda ) = rogue
3046 80 CONTINUE
3047 IF( her )THEN
3048 jj = j + ( j - 1 )*lda
3049 aa( jj ) = dcmplx( dble( aa( jj ) ), rrogue )
3050 END IF
3051 90 CONTINUE
3052 END IF
3053 RETURN
3054*
3055* End of ZMAKE
3056*
complex *16 function zbeg(reset)
Definition zblat2.f:3164