169 SUBROUTINE zlatm4( ITYPE, N, NZ1, NZ2, RSIGN, AMAGN, RCOND,
170 $ TRIANG, IDIST, ISEED, A, LDA )
178 INTEGER IDIST, ITYPE, LDA, N, NZ1, NZ2
179 DOUBLE PRECISION AMAGN, RCOND, TRIANG
183 COMPLEX*16 A( LDA, * )
189 DOUBLE PRECISION ZERO, ONE
190 parameter( zero = 0.0d+0, one = 1.0d+0 )
191 COMPLEX*16 CZERO, CONE
192 parameter( czero = ( 0.0d+0, 0.0d+0 ),
193 $ cone = ( 1.0d+0, 0.0d+0 ) )
196 INTEGER I, ISDB, ISDE, JC, JD, JR, K, KBEG, KEND, KLEN
197 DOUBLE PRECISION ALPHA
201 DOUBLE PRECISION DLARAN
203 EXTERNAL dlaran, zlarnd
209 INTRINSIC abs, dble, dcmplx, exp, log, max, min, mod
215 CALL zlaset(
'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 ) = dcmplx( jd-nz1 )
284 DO 110 jd = kbeg + 1, kend
285 a( jd, jd ) = dcmplx( rcond )
287 a( kbeg, kbeg ) = cone
293 DO 130 jd = kbeg, kend - 1
296 a( kend, kend ) = dcmplx( rcond )
302 a( kbeg, kbeg ) = cone
304 alpha = rcond**( one / dble( klen-1 ) )
306 a( nz1+i, nz1+i ) = dcmplx( alpha**dble( i-1 ) )
314 a( kbeg, kbeg ) = cone
316 alpha = ( one-rcond ) / dble( klen-1 )
318 a( nz1+i, nz1+i ) = dcmplx( dble( klen-i )*alpha+rcond )
327 DO 190 jd = kbeg, kend
328 a( jd, jd ) = exp( alpha*dlaran( iseed ) )
335 DO 210 jd = kbeg, kend
336 a( jd, jd ) = zlarnd( idist, iseed )
343 DO 230 jd = kbeg, kend
344 a( jd, jd ) = amagn*dble( a( jd, jd ) )
346 DO 240 jd = isdb, isde
347 a( jd+1, jd ) = amagn*dble( a( jd+1, jd ) )
354 DO 250 jd = kbeg, kend
355 IF( dble( a( jd, jd ) ).NE.zero )
THEN
356 ctemp = zlarnd( 3, iseed )
357 ctemp = ctemp / abs( ctemp )
358 a( jd, jd ) = ctemp*dble( a( jd, jd ) )
361 DO 260 jd = isdb, isde
362 IF( dble( a( jd+1, jd ) ).NE.zero )
THEN
363 ctemp = zlarnd( 3, iseed )
364 ctemp = ctemp / abs( ctemp )
365 a( jd+1, jd ) = ctemp*dble( 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*zlarnd( idist, iseed )
subroutine zlaset(uplo, m, n, alpha, beta, a, lda)
ZLASET initializes the off-diagonal elements and the diagonal elements of a matrix to given values.
subroutine zlatm4(itype, n, nz1, nz2, rsign, amagn, rcond, triang, idist, iseed, a, lda)
ZLATM4