169 SUBROUTINE clatm4( ITYPE, N, NZ1, NZ2, RSIGN, AMAGN, RCOND,
170 $ TRIANG, IDIST, ISEED, A, LDA )
178 INTEGER IDIST, ITYPE, LDA, N, NZ1, NZ2
179 REAL AMAGN, RCOND, TRIANG
190 parameter( zero = 0.0e+0, one = 1.0e+0 )
192 parameter( czero = ( 0.0e+0, 0.0e+0 ),
193 $ cone = ( 1.0e+0, 0.0e+0 ) )
196 INTEGER I, ISDB, ISDE, JC, JD, JR, K, KBEG, KEND, KLEN
203 EXTERNAL slaran, clarnd
209 INTRINSIC abs, cmplx, exp, log, max, min, mod, real
215 CALL claset(
'Full', n, n, czero, czero, a, lda )
219 IF( mod( iseed( 4 ), 2 ).NE.1 )
220 $ iseed( 4 ) = iseed( 4 ) + 1
225 IF( itype.NE.0 )
THEN
226 IF( abs( itype ).GE.4 )
THEN
227 kbeg = max( 1, min( n, nz1+1 ) )
228 kend = max( kbeg, min( n, n-nz2 ) )
229 klen = kend + 1 - kbeg
237 GO TO ( 10, 30, 50, 80, 100, 120, 140, 160,
238 $ 180, 200 )abs( itype )
268 DO 70 jd = k + 2, 2*k + 1
276 DO 90 jd = kbeg, kend
277 a( jd, jd ) = cmplx( jd-nz1 )
284 DO 110 jd = kbeg + 1, kend
285 a( jd, jd ) = cmplx( rcond )
287 a( kbeg, kbeg ) = cone
293 DO 130 jd = kbeg, kend - 1
296 a( kend, kend ) = cmplx( rcond )
302 a( kbeg, kbeg ) = cone
304 alpha = rcond**( one / real( klen-1 ) )
306 a( nz1+i, nz1+i ) = cmplx( alpha**real( i-1 ) )
314 a( kbeg, kbeg ) = cone
316 alpha = ( one-rcond ) / real( klen-1 )
318 a( nz1+i, nz1+i ) = cmplx( real( klen-i )*alpha+rcond )
327 DO 190 jd = kbeg, kend
328 a( jd, jd ) = exp( alpha*slaran( iseed ) )
335 DO 210 jd = kbeg, kend
336 a( jd, jd ) = clarnd( idist, iseed )
343 DO 230 jd = kbeg, kend
344 a( jd, jd ) = amagn*real( a( jd, jd ) )
346 DO 240 jd = isdb, isde
347 a( jd+1, jd ) = amagn*real( a( jd+1, jd ) )
354 DO 250 jd = kbeg, kend
355 IF( real( a( jd, jd ) ).NE.zero )
THEN
356 ctemp = clarnd( 3, iseed )
357 ctemp = ctemp / abs( ctemp )
358 a( jd, jd ) = ctemp*real( a( jd, jd ) )
361 DO 260 jd = isdb, isde
362 IF( real( a( jd+1, jd ) ).NE.zero )
THEN
363 ctemp = clarnd( 3, iseed )
364 ctemp = ctemp / abs( ctemp )
365 a( jd+1, jd ) = ctemp*real( a( jd+1, jd ) )
372 IF( itype.LT.0 )
THEN
373 DO 270 jd = kbeg, ( kbeg+kend-1 ) / 2
375 a( jd, jd ) = a( kbeg+kend-jd, kbeg+kend-jd )
376 a( kbeg+kend-jd, kbeg+kend-jd ) = ctemp
378 DO 280 jd = 1, ( n-1 ) / 2
379 ctemp = a( jd+1, jd )
380 a( jd+1, jd ) = a( n+1-jd, n-jd )
381 a( n+1-jd, n-jd ) = ctemp
389 IF( triang.NE.zero )
THEN
391 DO 290 jr = 1, jc - 1
392 a( jr, jc ) = triang*clarnd( idist, iseed )
subroutine clatm4(itype, n, nz1, nz2, rsign, amagn, rcond, triang, idist, iseed, a, lda)
CLATM4
subroutine claset(uplo, m, n, alpha, beta, a, lda)
CLASET initializes the off-diagonal elements and the diagonal elements of a matrix to given values.