123 SUBROUTINE dlattp( IMAT, UPLO, TRANS, DIAG, ISEED, N, A, B, WORK,
131 CHARACTER DIAG, TRANS, UPLO
132 INTEGER IMAT, INFO, N
136 DOUBLE PRECISION A( * ), B( * ), WORK( * )
142 DOUBLE PRECISION ONE, TWO, ZERO
143 parameter( one = 1.0d+0, two = 2.0d+0, zero = 0.0d+0 )
147 CHARACTER DIST, PACKIT, TYPE
149 INTEGER I, IY, J, JC, JCNEXT, JCOUNT, JJ, JL, JR, JX,
151 DOUBLE PRECISION ANORM, BIGNUM, BNORM, BSCAL, C, CNDNUM, PLUS1,
152 $ plus2, ra, rb, rexp, s, sfac, smlnum, star1,
153 $ stemp, t, texp, tleft, tscal, ulp, unfl, x, y,
159 DOUBLE PRECISION DLAMCH, DLARND
160 EXTERNAL lsame, idamax, dlamch, dlarnd
166 INTRINSIC abs, dble, max, sign, sqrt
170 path( 1: 1 ) =
'Double precision'
172 unfl = dlamch(
'Safe minimum' )
173 ulp = dlamch(
'Epsilon' )*dlamch(
'Base' )
175 bignum = ( one-ulp ) / smlnum
176 IF( ( imat.GE.7 .AND. imat.LE.10 ) .OR. imat.EQ.18 )
THEN
190 upper = lsame( uplo,
'U' )
192 CALL dlatb4( path, imat, n, n,
TYPE, kl, ku, anorm, mode,
196 CALL dlatb4( path, -imat, n, n,
TYPE, kl, ku, anorm, mode,
204 CALL dlatms( n, n, dist, iseed,
TYPE, b, mode, cndnum, anorm,
205 $ kl, ku, packit, a, n, work, info )
212 ELSE IF( imat.EQ.7 )
THEN
239 ELSE IF( imat.LE.10 )
THEN
322 plus2 = star1 / plus1
328 plus1 = star1 / plus2
329 rexp = dlarnd( 2, iseed )
330 star1 = star1*( sfac**rexp )
331 IF( rexp.LT.zero )
THEN
332 star1 = -sfac**( one-rexp )
334 star1 = sfac**( one+rexp )
339 x = sqrt( cndnum ) - one / sqrt( cndnum )
341 y = sqrt( two / dble( n-2 ) )*x
356 $ a( jc+j-1 ) = work( j-2 )
358 $ a( jc+j-2 ) = work( n+j-3 )
377 a( jc+1 ) = work( j-1 )
379 $ a( jc+2 ) = work( n+j-1 )
393 CALL drotg( ra, rb, c, s )
400 stemp = c*a( jx+j ) + s*a( jx+j+1 )
401 a( jx+j+1 ) = -s*a( jx+j ) + c*a( jx+j+1 )
410 $
CALL drot( j-1, a( jcnext ), 1, a( jc ), 1, -c, -s )
414 a( jcnext+j-1 ) = -a( jcnext+j-1 )
420 jcnext = jc + n - j + 1
423 CALL drotg( ra, rb, c, s )
428 $
CALL drot( n-j-1, a( jcnext+1 ), 1, a( jc+2 ), 1, c,
436 stemp = -c*a( jx+j-i ) + s*a( jx+j-i+1 )
437 a( jx+j-i+1 ) = -s*a( jx+j-i ) - c*a( jx+j-i+1 )
445 a( jc+1 ) = -a( jc+1 )
454 ELSE IF( imat.EQ.11 )
THEN
463 CALL dlarnv( 2, iseed, j, a( jc ) )
464 a( jc+j-1 ) = sign( two, a( jc+j-1 ) )
470 CALL dlarnv( 2, iseed, n-j+1, a( jc ) )
471 a( jc ) = sign( two, a( jc ) )
478 CALL dlarnv( 2, iseed, n, b )
479 iy = idamax( n, b, 1 )
480 bnorm = abs( b( iy ) )
481 bscal = bignum / max( one, bnorm )
482 CALL dscal( n, bscal, b, 1 )
484 ELSE IF( imat.EQ.12 )
THEN
490 CALL dlarnv( 2, iseed, n, b )
491 tscal = one / max( one, dble( n-1 ) )
495 CALL dlarnv( 2, iseed, j-1, a( jc ) )
496 CALL dscal( j-1, tscal, a( jc ), 1 )
497 a( jc+j-1 ) = sign( one, dlarnd( 2, iseed ) )
500 a( n*( n+1 ) / 2 ) = smlnum
504 CALL dlarnv( 2, iseed, n-j, a( jc+1 ) )
505 CALL dscal( n-j, tscal, a( jc+1 ), 1 )
506 a( jc ) = sign( one, dlarnd( 2, iseed ) )
512 ELSE IF( imat.EQ.13 )
THEN
518 CALL dlarnv( 2, iseed, n, b )
522 CALL dlarnv( 2, iseed, j-1, a( jc ) )
523 a( jc+j-1 ) = sign( one, dlarnd( 2, iseed ) )
526 a( n*( n+1 ) / 2 ) = smlnum
530 CALL dlarnv( 2, iseed, n-j, a( jc+1 ) )
531 a( jc ) = sign( one, dlarnd( 2, iseed ) )
537 ELSE IF( imat.EQ.14 )
THEN
545 jc = ( n-1 )*n / 2 + 1
550 IF( jcount.LE.2 )
THEN
567 IF( jcount.LE.2 )
THEN
589 DO 290 i = 1, n - 1, 2
595 ELSE IF( imat.EQ.15 )
THEN
601 texp = one / max( one, dble( n-1 ) )
603 CALL dlarnv( 2, iseed, n, b )
630 ELSE IF( imat.EQ.16 )
THEN
638 CALL dlarnv( 2, iseed, j, a( jc ) )
640 a( jc+j-1 ) = sign( two, a( jc+j-1 ) )
649 CALL dlarnv( 2, iseed, n-j+1, a( jc ) )
651 a( jc ) = sign( two, a( jc ) )
658 CALL dlarnv( 2, iseed, n, b )
659 CALL dscal( n, two, b, 1 )
661 ELSE IF( imat.EQ.17 )
THEN
669 tscal = ( one-ulp ) / tscal
670 DO 360 j = 1, n*( n+1 ) / 2
675 jc = ( n-1 )*n / 2 + 1
677 a( jc ) = -tscal / dble( n+1 )
679 b( j ) = texp*( one-ulp )
681 a( jc ) = -( tscal / dble( n+1 ) ) / dble( n+2 )
683 b( j-1 ) = texp*dble( n*n+n-1 )
687 b( 1 ) = ( dble( n+1 ) / dble( n+2 ) )*tscal
690 DO 380 j = 1, n - 1, 2
691 a( jc+n-j ) = -tscal / dble( n+1 )
693 b( j ) = texp*( one-ulp )
695 a( jc+n-j-1 ) = -( tscal / dble( n+1 ) ) / dble( n+2 )
697 b( j+1 ) = texp*dble( n*n+n-1 )
701 b( n ) = ( dble( n+1 ) / dble( n+2 ) )*tscal
704 ELSE IF( imat.EQ.18 )
THEN
713 CALL dlarnv( 2, iseed, j-1, a( jc ) )
721 $
CALL dlarnv( 2, iseed, n-j, a( jc+1 ) )
729 CALL dlarnv( 2, iseed, n, b )
730 iy = idamax( n, b, 1 )
731 bnorm = abs( b( iy ) )
732 bscal = bignum / max( one, bnorm )
733 CALL dscal( n, bscal, b, 1 )
735 ELSE IF( imat.EQ.19 )
THEN
741 tleft = bignum / max( one, dble( n-1 ) )
742 tscal = bignum*( dble( n-1 ) / max( one, dble( n ) ) )
746 CALL dlarnv( 2, iseed, j, a( jc ) )
748 a( jc+i-1 ) = sign( tleft, a( jc+i-1 ) ) +
756 CALL dlarnv( 2, iseed, n-j+1, a( jc ) )
758 a( jc+i-j ) = sign( tleft, a( jc+i-j ) ) +
764 CALL dlarnv( 2, iseed, n, b )
765 CALL dscal( n, two, b, 1 )
771 IF( .NOT.lsame( trans,
'N' ) )
THEN
779 a( jr-i+j ) = a( jl )
793 a( jl+i-j ) = a( jr )
subroutine dlatb4(path, imat, m, n, type, kl, ku, anorm, mode, cndnum, dist)
DLATB4
subroutine dlatms(m, n, dist, iseed, sym, d, mode, cond, dmax, kl, ku, pack, a, lda, work, info)
DLATMS
subroutine dlattp(imat, uplo, trans, diag, iseed, n, a, b, work, info)
DLATTP
subroutine dlarnv(idist, iseed, n, x)
DLARNV returns a vector of random numbers from a uniform or normal distribution.
subroutine drot(n, dx, incx, dy, incy, c, s)
DROT
subroutine drotg(a, b, c, s)
DROTG
subroutine dscal(n, da, dx, incx)
DSCAL