1 SUBROUTINE dlattp( IMAT, UPLO, TRANS, DIAG, ISEED, N, A, B, WORK,
14 DOUBLE PRECISION a( * ), b( * ), work( * )
75 DOUBLE PRECISION one, two, zero
76 parameter( one = 1.0d+0, two = 2.0d+0, zero = 0.0d+0 )
80 CHARACTER dist, packit, type
82 INTEGER i, iy, j, jc, jcnext, jcount, jj, jl, jr, jx,
84 DOUBLE PRECISION anorm, bignum, bnorm, bscal, c, cndnum, plus1,
85 $ plus2, ra, rb, rexp, s, sfac, smlnum, star1,
86 $ stemp, t, texp, tleft, tscal, ulp, unfl, x, y,
92 DOUBLE PRECISION dlamch,
dlarnd
93 EXTERNAL lsame, idamax, dlamch,
dlarnd
100 INTRINSIC abs, dble,
max, sign, sqrt
104 path( 1: 1 ) =
'Double precision'
106 unfl = dlamch(
'Safe minimum' )
107 ulp = dlamch(
'Epsilon' )*dlamch(
'Base' )
109 bignum = ( one-ulp ) / smlnum
110 CALL dlabad( smlnum, bignum )
111 IF( ( imat.GE.7 .AND. imat.LE.10 ) .OR. imat.EQ.18 )
THEN
125 upper = lsame(
uplo,
'U' )
127 CALL
dlatb4( path, imat, n, n, type, kl, ku, anorm, mode,
131 CALL
dlatb4( path, -imat, n, n, type, kl, ku, anorm, mode,
139 CALL
dlatms( n, n, dist, iseed, type, b, mode, cndnum, anorm,
140 $ kl, ku, packit, a, n, work, info )
147 ELSE IF( imat.EQ.7 )
THEN
174 ELSE IF( imat.LE.10 )
THEN
257 plus2 = star1 / plus1
263 plus1 = star1 / plus2
265 star1 = star1*( sfac**rexp )
266 IF( rexp.LT.zero )
THEN
267 star1 = -sfac**( one-rexp )
269 star1 = sfac**( one+rexp )
274 x = sqrt( cndnum ) - one / sqrt( cndnum )
276 y = sqrt( two / dble( n-2 ) )*x
291 $ a( jc+j-1 ) = work( j-2 )
293 $ a( jc+j-2 ) = work( n+j-3 )
312 a( jc+1 ) = work( j-1 )
314 $ a( jc+2 ) = work( n+j-1 )
328 CALL drotg( ra, rb, c, s )
335 stemp = c*a( jx+j ) + s*a( jx+j+1 )
336 a( jx+j+1 ) = -s*a( jx+j ) + c*a( jx+j+1 )
345 $ CALL drot( j-1, a( jcnext ), 1, a( jc ), 1, -c, -s )
349 a( jcnext+j-1 ) = -a( jcnext+j-1 )
355 jcnext = jc + n - j + 1
358 CALL drotg( ra, rb, c, s )
363 $ CALL drot( n-j-1, a( jcnext+1 ), 1, a( jc+2 ), 1, c,
371 stemp = -c*a( jx+j-i ) + s*a( jx+j-i+1 )
372 a( jx+j-i+1 ) = -s*a( jx+j-i ) - c*a( jx+j-i+1 )
380 a( jc+1 ) = -a( jc+1 )
389 ELSE IF( imat.EQ.11 )
THEN
398 CALL dlarnv( 2, iseed, j, a( jc ) )
399 a( jc+j-1 ) = sign( two, a( jc+j-1 ) )
405 CALL dlarnv( 2, iseed, n-j+1, a( jc ) )
406 a( jc ) = sign( two, a( jc ) )
413 CALL dlarnv( 2, iseed, n, b )
414 iy = idamax( n, b, 1 )
415 bnorm = abs( b( iy ) )
416 bscal = bignum /
max( one, bnorm )
417 CALL dscal( n, bscal, b, 1 )
419 ELSE IF( imat.EQ.12 )
THEN
425 CALL dlarnv( 2, iseed, n, b )
426 tscal = one /
max( one, dble( n-1 ) )
430 CALL dlarnv( 2, iseed, j-1, a( jc ) )
431 CALL dscal( j-1, tscal, a( jc ), 1 )
432 a( jc+j-1 ) = sign( one,
dlarnd( 2, iseed ) )
435 a( n*( n+1 ) / 2 ) = smlnum
439 CALL dlarnv( 2, iseed, n-j, a( jc+1 ) )
440 CALL dscal( n-j, tscal, a( jc+1 ), 1 )
441 a( jc ) = sign( one,
dlarnd( 2, iseed ) )
447 ELSE IF( imat.EQ.13 )
THEN
453 CALL dlarnv( 2, iseed, n, b )
457 CALL dlarnv( 2, iseed, j-1, a( jc ) )
458 a( jc+j-1 ) = sign( one,
dlarnd( 2, iseed ) )
461 a( n*( n+1 ) / 2 ) = smlnum
465 CALL dlarnv( 2, iseed, n-j, a( jc+1 ) )
466 a( jc ) = sign( one,
dlarnd( 2, iseed ) )
472 ELSE IF( imat.EQ.14 )
THEN
480 jc = ( n-1 )*n / 2 + 1
485 IF( jcount.LE.2 )
THEN
502 IF( jcount.LE.2 )
THEN
524 DO 290 i = 1, n - 1, 2
530 ELSE IF( imat.EQ.15 )
THEN
536 texp = one /
max( one, dble( n-1 ) )
538 CALL dlarnv( 2, iseed, n, b )
565 ELSE IF( imat.EQ.16 )
THEN
573 CALL dlarnv( 2, iseed, j, a( jc ) )
575 a( jc+j-1 ) = sign( two, a( jc+j-1 ) )
584 CALL dlarnv( 2, iseed, n-j+1, a( jc ) )
586 a( jc ) = sign( two, a( jc ) )
593 CALL dlarnv( 2, iseed, n, b )
594 CALL dscal( n, two, b, 1 )
596 ELSE IF( imat.EQ.17 )
THEN
604 tscal = ( one-ulp ) / tscal
605 DO 360 j = 1, n*( n+1 ) / 2
610 jc = ( n-1 )*n / 2 + 1
612 a( jc ) = -tscal / dble( n+1 )
614 b( j ) = texp*( one-ulp )
616 a( jc ) = -( tscal / dble( n+1 ) ) / dble( n+2 )
618 b( j-1 ) = texp*dble( n*n+n-1 )
622 b( 1 ) = ( dble( n+1 ) / dble( n+2 ) )*tscal
625 DO 380 j = 1, n - 1, 2
626 a( jc+n-j ) = -tscal / dble( n+1 )
628 b( j ) = texp*( one-ulp )
630 a( jc+n-j-1 ) = -( tscal / dble( n+1 ) ) / dble( n+2 )
632 b( j+1 ) = texp*dble( n*n+n-1 )
636 b( n ) = ( dble( n+1 ) / dble( n+2 ) )*tscal
639 ELSE IF( imat.EQ.18 )
THEN
648 CALL dlarnv( 2, iseed, j-1, a( jc ) )
656 $ CALL dlarnv( 2, iseed, n-j, a( jc+1 ) )
664 CALL dlarnv( 2, iseed, n, b )
665 iy = idamax( n, b, 1 )
666 bnorm = abs( b( iy ) )
667 bscal = bignum /
max( one, bnorm )
668 CALL dscal( n, bscal, b, 1 )
670 ELSE IF( imat.EQ.19 )
THEN
676 tleft = bignum /
max( one, dble( n-1 ) )
677 tscal = bignum*( dble( n-1 ) /
max( one, dble( n ) ) )
681 CALL dlarnv( 2, iseed, j, a( jc ) )
683 a( jc+i-1 ) = sign( tleft, a( jc+i-1 ) ) +
691 CALL dlarnv( 2, iseed, n-j+1, a( jc ) )
693 a( jc+i-j ) = sign( tleft, a( jc+i-j ) ) +
699 CALL dlarnv( 2, iseed, n, b )
700 CALL dscal( n, two, b, 1 )
706 IF( .NOT.lsame(
trans,
'N' ) )
THEN
714 a( jr-i+j ) = a( jl )
728 a( jl+i-j ) = a( jr )