171 SUBROUTINE zlatm4( ITYPE, N, NZ1, NZ2, RSIGN, AMAGN, RCOND,
172 $ triang, idist, iseed, a, lda )
181 INTEGER idist, itype, lda, n, nz1, nz2
182 DOUBLE PRECISION amagn, rcond, triang
186 COMPLEX*16 a( lda, * )
192 DOUBLE PRECISION zero, one
193 parameter( zero = 0.0d+0, one = 1.0d+0 )
194 COMPLEX*16 czero, cone
195 parameter( czero = ( 0.0d+0, 0.0d+0 ),
196 $ cone = ( 1.0d+0, 0.0d+0 ) )
199 INTEGER i, isdb, isde, jc, jd, jr, k, kbeg, kend, klen
200 DOUBLE PRECISION alpha
212 INTRINSIC abs, dble, dcmplx, exp, log, max, min, mod
218 CALL
zlaset(
'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 ) = dcmplx( jd-nz1 )
287 DO 110 jd = kbeg + 1, kend
288 a( jd, jd ) = dcmplx( rcond )
290 a( kbeg, kbeg ) = cone
296 DO 130 jd = kbeg, kend - 1
299 a( kend, kend ) = dcmplx( rcond )
305 a( kbeg, kbeg ) = cone
307 alpha = rcond**( one / dble( klen-1 ) )
309 a( nz1+i, nz1+i ) = dcmplx( alpha**dble( i-1 ) )
317 a( kbeg, kbeg ) = cone
319 alpha = ( one-rcond ) / dble( klen-1 )
321 a( nz1+i, nz1+i ) = dcmplx( dble( klen-i )*alpha+rcond )
330 DO 190 jd = kbeg, kend
331 a( jd, jd ) = exp( alpha*
dlaran( iseed ) )
338 DO 210 jd = kbeg, kend
339 a( jd, jd ) =
zlarnd( idist, iseed )
346 DO 230 jd = kbeg, kend
347 a( jd, jd ) = amagn*dble( a( jd, jd ) )
349 DO 240 jd = isdb, isde
350 a( jd+1, jd ) = amagn*dble( a( jd+1, jd ) )
357 DO 250 jd = kbeg, kend
358 IF( dble( a( jd, jd ) ).NE.zero )
THEN
359 ctemp =
zlarnd( 3, iseed )
360 ctemp = ctemp / abs( ctemp )
361 a( jd, jd ) = ctemp*dble( a( jd, jd ) )
364 DO 260 jd = isdb, isde
365 IF( dble( a( jd+1, jd ) ).NE.zero )
THEN
366 ctemp =
zlarnd( 3, iseed )
367 ctemp = ctemp / abs( ctemp )
368 a( jd+1, jd ) = ctemp*dble( 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*
zlarnd( idist, iseed )