171 SUBROUTINE clatm4( ITYPE, N, NZ1, NZ2, RSIGN, AMAGN, RCOND,
172 $ triang, idist, iseed, a, lda )
181 INTEGER idist, itype, lda, n, nz1, nz2
182 REAL amagn, rcond, triang
193 parameter( zero = 0.0e+0, one = 1.0e+0 )
195 parameter( czero = ( 0.0e+0, 0.0e+0 ),
196 $ cone = ( 1.0e+0, 0.0e+0 ) )
199 INTEGER i, isdb, isde, jc, jd, jr, k, kbeg, kend, klen
212 INTRINSIC abs, cmplx, exp, log, max, min, mod, real
218 CALL
claset(
'Full', n, n, czero, czero, a, lda )
222 IF( mod( iseed( 4 ), 2 ).NE.1 )
223 $ iseed( 4 ) = iseed( 4 ) + 1
228 IF( itype.NE.0 )
THEN
229 IF( abs( itype ).GE.4 )
THEN
230 kbeg = max( 1, min( n, nz1+1 ) )
231 kend = max( kbeg, min( n, n-nz2 ) )
232 klen = kend + 1 - kbeg
240 go to( 10, 30, 50, 80, 100, 120, 140, 160,
241 $ 180, 200 )abs( itype )
271 DO 70 jd = k + 2, 2*k + 1
279 DO 90 jd = kbeg, kend
280 a( jd, jd ) = cmplx( jd-nz1 )
287 DO 110 jd = kbeg + 1, kend
288 a( jd, jd ) = cmplx( rcond )
290 a( kbeg, kbeg ) = cone
296 DO 130 jd = kbeg, kend - 1
299 a( kend, kend ) = cmplx( rcond )
305 a( kbeg, kbeg ) = cone
307 alpha = rcond**( one /
REAL( KLEN-1 ) )
309 a( nz1+i, nz1+i ) = cmplx( alpha**
REAL( I-1 ) )
317 a( kbeg, kbeg ) = cone
319 alpha = ( one-rcond ) /
REAL( klen-1 )
321 a( nz1+i, nz1+i ) = cmplx(
REAL( klen-i )*alpha+rcond )
330 DO 190 jd = kbeg, kend
331 a( jd, jd ) = exp( alpha*
slaran( iseed ) )
338 DO 210 jd = kbeg, kend
339 a( jd, jd ) =
clarnd( idist, iseed )
346 DO 230 jd = kbeg, kend
347 a( jd, jd ) = amagn*
REAL( A( JD, JD ) )
349 DO 240 jd = isdb, isde
350 a( jd+1, jd ) = amagn*
REAL( A( JD+1, JD ) )
357 DO 250 jd = kbeg, kend
358 IF(
REAL( A( JD, JD ) ).NE.zero ) then
359 ctemp =
clarnd( 3, iseed )
360 ctemp = ctemp / abs( ctemp )
361 a( jd, jd ) = ctemp*
REAL( A( JD, JD ) )
364 DO 260 jd = isdb, isde
365 IF(
REAL( A( JD+1, JD ) ).NE.zero ) then
366 ctemp =
clarnd( 3, iseed )
367 ctemp = ctemp / abs( ctemp )
368 a( jd+1, jd ) = ctemp*
REAL( A( JD+1, JD ) )
375 IF( itype.LT.0 )
THEN
376 DO 270 jd = kbeg, ( kbeg+kend-1 ) / 2
378 a( jd, jd ) = a( kbeg+kend-jd, kbeg+kend-jd )
379 a( kbeg+kend-jd, kbeg+kend-jd ) = ctemp
381 DO 280 jd = 1, ( n-1 ) / 2
382 ctemp = a( jd+1, jd )
383 a( jd+1, jd ) = a( n+1-jd, n-jd )
384 a( n+1-jd, n-jd ) = ctemp
392 IF( triang.NE.zero )
THEN
394 DO 290 jr = 1, jc - 1
395 a( jr, jc ) = triang*
clarnd( idist, iseed )