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

◆ cmake()

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

Definition at line 3125 of file cblat3.f.

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