LAPACK 3.12.1
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 3134 of file zblat3.f.

3136*
3137* Generates values for an M by N matrix A.
3138* Stores the values in the array AA in the data structure required
3139* by the routine, with unwanted elements set to rogue value.
3140*
3141* TYPE is 'GE', 'HE', 'SY' or 'TR'.
3142*
3143* Auxiliary routine for test program for Level 3 Blas.
3144*
3145* -- Written on 8-February-1989.
3146* Jack Dongarra, Argonne National Laboratory.
3147* Iain Duff, AERE Harwell.
3148* Jeremy Du Croz, Numerical Algorithms Group Ltd.
3149* Sven Hammarling, Numerical Algorithms Group Ltd.
3150*
3151* .. Parameters ..
3152 COMPLEX*16 ZERO, ONE
3153 parameter( zero = ( 0.0d0, 0.0d0 ),
3154 $ one = ( 1.0d0, 0.0d0 ) )
3155 COMPLEX*16 ROGUE
3156 parameter( rogue = ( -1.0d10, 1.0d10 ) )
3157 DOUBLE PRECISION RZERO
3158 parameter( rzero = 0.0d0 )
3159 DOUBLE PRECISION RROGUE
3160 parameter( rrogue = -1.0d10 )
3161* .. Scalar Arguments ..
3162 COMPLEX*16 TRANSL
3163 INTEGER LDA, M, N, NMAX
3164 LOGICAL RESET
3165 CHARACTER*1 DIAG, UPLO
3166 CHARACTER*2 TYPE
3167* .. Array Arguments ..
3168 COMPLEX*16 A( NMAX, * ), AA( * )
3169* .. Local Scalars ..
3170 INTEGER I, IBEG, IEND, J, JJ
3171 LOGICAL GEN, HER, LOWER, SYM, TRI, UNIT, UPPER
3172* .. External Functions ..
3173 COMPLEX*16 ZBEG
3174 EXTERNAL zbeg
3175* .. Intrinsic Functions ..
3176 INTRINSIC dcmplx, dconjg, dble
3177* .. Executable Statements ..
3178 gen = type.EQ.'GE'
3179 her = type.EQ.'HE'
3180 sym = type.EQ.'SY'
3181 tri = type.EQ.'TR'
3182 upper = ( her.OR.sym.OR.tri ).AND.uplo.EQ.'U'
3183 lower = ( her.OR.sym.OR.tri ).AND.uplo.EQ.'L'
3184 unit = tri.AND.diag.EQ.'U'
3185*
3186* Generate data in array A.
3187*
3188 DO 20 j = 1, n
3189 DO 10 i = 1, m
3190 IF( gen.OR.( upper.AND.i.LE.j ).OR.( lower.AND.i.GE.j ) )
3191 $ THEN
3192 a( i, j ) = zbeg( reset ) + transl
3193 IF( i.NE.j )THEN
3194* Set some elements to zero
3195 IF( n.GT.3.AND.j.EQ.n/2 )
3196 $ a( i, j ) = zero
3197 IF( her )THEN
3198 a( j, i ) = dconjg( a( i, j ) )
3199 ELSE IF( sym )THEN
3200 a( j, i ) = a( i, j )
3201 ELSE IF( tri )THEN
3202 a( j, i ) = zero
3203 END IF
3204 END IF
3205 END IF
3206 10 CONTINUE
3207 IF( her )
3208 $ a( j, j ) = dcmplx( dble( a( j, j ) ), rzero )
3209 IF( tri )
3210 $ a( j, j ) = a( j, j ) + one
3211 IF( unit )
3212 $ a( j, j ) = one
3213 20 CONTINUE
3214*
3215* Store elements in array AS in data structure required by routine.
3216*
3217 IF( type.EQ.'GE' )THEN
3218 DO 50 j = 1, n
3219 DO 30 i = 1, m
3220 aa( i + ( j - 1 )*lda ) = a( i, j )
3221 30 CONTINUE
3222 DO 40 i = m + 1, lda
3223 aa( i + ( j - 1 )*lda ) = rogue
3224 40 CONTINUE
3225 50 CONTINUE
3226 ELSE IF( type.EQ.'HE'.OR.type.EQ.'SY'.OR.type.EQ.'TR' )THEN
3227 DO 90 j = 1, n
3228 IF( upper )THEN
3229 ibeg = 1
3230 IF( unit )THEN
3231 iend = j - 1
3232 ELSE
3233 iend = j
3234 END IF
3235 ELSE
3236 IF( unit )THEN
3237 ibeg = j + 1
3238 ELSE
3239 ibeg = j
3240 END IF
3241 iend = n
3242 END IF
3243 DO 60 i = 1, ibeg - 1
3244 aa( i + ( j - 1 )*lda ) = rogue
3245 60 CONTINUE
3246 DO 70 i = ibeg, iend
3247 aa( i + ( j - 1 )*lda ) = a( i, j )
3248 70 CONTINUE
3249 DO 80 i = iend + 1, lda
3250 aa( i + ( j - 1 )*lda ) = rogue
3251 80 CONTINUE
3252 IF( her )THEN
3253 jj = j + ( j - 1 )*lda
3254 aa( jj ) = dcmplx( dble( aa( jj ) ), rrogue )
3255 END IF
3256 90 CONTINUE
3257 END IF
3258 RETURN
3259*
3260* End of ZMAKE
3261*
complex *16 function zbeg(reset)
Definition zblat2.f:3164