3136
3137
3138
3139
3140
3141
3142
3143
3144
3145
3146
3147
3148
3149
3150
3151
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
3162 COMPLEX*16 TRANSL
3163 INTEGER LDA, M, N, NMAX
3164 LOGICAL RESET
3165 CHARACTER*1 DIAG, UPLO
3166 CHARACTER*2 TYPE
3167
3168 COMPLEX*16 A( NMAX, * ), AA( * )
3169
3170 INTEGER I, IBEG, IEND, J, JJ
3171 LOGICAL GEN, HER, LOWER, SYM, TRI, UNIT, UPPER
3172
3173 COMPLEX*16 ZBEG
3175
3176 INTRINSIC dcmplx, dconjg, dble
3177
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
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
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
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
3261
complex *16 function zbeg(reset)