102 SUBROUTINE dget39( RMAX, LMAX, NINFO, KNT )
109 INTEGER KNT, LMAX, NINFO
110 DOUBLE PRECISION RMAX
117 parameter( ldt = 10, ldt2 = 2*ldt )
118 DOUBLE PRECISION ZERO, ONE
119 parameter( zero = 0.0d0, one = 1.0d0 )
122 INTEGER I, INFO, IVM1, IVM2, IVM3, IVM4, IVM5, J, K, N,
124 DOUBLE PRECISION BIGNUM, DOMIN, DUMM, EPS, NORM, NORMTB, RESID,
125 $ SCALE, SMLNUM, W, XNORM
129 DOUBLE PRECISION DASUM, DDOT, DLAMCH, DLANGE
130 EXTERNAL idamax, dasum, ddot, dlamch, dlange
136 INTRINSIC abs, cos, dble, max, sin, sqrt
139 INTEGER IDIM( 6 ), IVAL( 5, 5, 6 )
140 DOUBLE PRECISION B( LDT ), D( LDT2 ), DUM( 1 ), T( LDT, LDT ),
141 $ VM1( 5 ), VM2( 5 ), VM3( 5 ), VM4( 5 ),
142 $ VM5( 3 ), WORK( LDT ), X( LDT2 ), Y( LDT2 )
146 DATA ival / 3, 4*0, 1, 1, -1, 0, 0, 3, 2, 1, 0, 0,
147 $ 4, 3, 2, 2, 0, 5*0, 1, 4*0, 2, 2, 3*0, 3, 3, 4,
148 $ 0, 0, 4, 2, 2, 3, 0, 4*1, 5, 1, 4*0, 2, 4, -2,
149 $ 0, 0, 3, 3, 4, 0, 0, 4, 2, 2, 3, 0, 5*1, 1,
150 $ 4*0, 2, 1, -1, 0, 0, 9, 8, 1, 0, 0, 4, 9, 1, 2,
151 $ -1, 5*2, 9, 4*0, 6, 4, 0, 0, 0, 3, 2, 1, 1, 0,
152 $ 5, 1, -1, 1, 0, 5*2, 4, 4*0, 2, 2, 0, 0, 0, 1,
153 $ 4, 4, 0, 0, 2, 4, 2, 2, -1, 5*2 /
160 smlnum = dlamch(
'S' )
161 bignum = one / smlnum
166 vm1( 2 ) = sqrt( smlnum )
167 vm1( 3 ) = sqrt( vm1( 2 ) )
168 vm1( 4 ) = sqrt( bignum )
169 vm1( 5 ) = sqrt( vm1( 4 ) )
172 vm2( 2 ) = sqrt( smlnum )
173 vm2( 3 ) = sqrt( vm2( 2 ) )
174 vm2( 4 ) = sqrt( bignum )
175 vm2( 5 ) = sqrt( vm2( 4 ) )
178 vm3( 2 ) = sqrt( smlnum )
179 vm3( 3 ) = sqrt( vm3( 2 ) )
180 vm3( 4 ) = sqrt( bignum )
181 vm3( 5 ) = sqrt( vm3( 4 ) )
184 vm4( 2 ) = sqrt( smlnum )
185 vm4( 3 ) = sqrt( vm4( 2 ) )
186 vm4( 4 ) = sqrt( bignum )
187 vm4( 5 ) = sqrt( vm4( 4 ) )
191 vm5( 3 ) = sqrt( smlnum )
198 smlnum = smlnum / eps
212 t( i, j ) = dble( ival( i, j, ndim ) )*
215 $ t( i, j ) = t( i, j )*vm5( ivm5 )
222 b( i ) = cos( dble( i ) )*vm3( ivm3 )
226 d( i ) = sin( dble( i ) )*vm4( ivm4 )
229 norm = dlange(
'1', n, n, t, ldt, work )
230 k = idamax( n, b, 1 )
231 normtb = norm + abs( b( k ) ) + abs( w )
233 CALL dcopy( n, d, 1, x, 1 )
235 CALL dlaqtr( .false., .true., n, t, ldt, dum,
236 $ dumm, scale, x, work, info )
243 CALL dcopy( n, d, 1, y, 1 )
244 CALL dgemv(
'No transpose', n, n, one, t, ldt,
245 $ x, 1, -scale, y, 1 )
246 xnorm = dasum( n, x, 1 )
247 resid = dasum( n, y, 1 )
248 domin = max( smlnum, ( smlnum / eps )*norm,
249 $ ( norm*eps )*xnorm )
250 resid = resid / domin
251 IF( resid.GT.rmax )
THEN
256 CALL dcopy( n, d, 1, x, 1 )
258 CALL dlaqtr( .true., .true., n, t, ldt, dum,
259 $ dumm, scale, x, work, info )
266 CALL dcopy( n, d, 1, y, 1 )
267 CALL dgemv(
'Transpose', n, n, one, t, ldt, x,
269 xnorm = dasum( n, x, 1 )
270 resid = dasum( n, y, 1 )
271 domin = max( smlnum, ( smlnum / eps )*norm,
272 $ ( norm*eps )*xnorm )
273 resid = resid / domin
274 IF( resid.GT.rmax )
THEN
279 CALL dcopy( 2*n, d, 1, x, 1 )
281 CALL dlaqtr( .false., .false., n, t, ldt, b, w,
282 $ scale, x, work, info )
291 CALL dcopy( 2*n, d, 1, y, 1 )
292 y( 1 ) = ddot( n, b, 1, x( 1+n ), 1 ) +
295 y( i ) = w*x( i+n ) + scale*y( i )
297 CALL dgemv(
'No transpose', n, n, one, t, ldt,
300 y( 1+n ) = ddot( n, b, 1, x, 1 ) -
303 y( i+n ) = w*x( i ) - scale*y( i+n )
305 CALL dgemv(
'No transpose', n, n, one, t, ldt,
306 $ x( 1+n ), 1, one, y( 1+n ), 1 )
308 resid = dasum( 2*n, y, 1 )
309 domin = max( smlnum, ( smlnum / eps )*normtb,
310 $ eps*( normtb*dasum( 2*n, x, 1 ) ) )
311 resid = resid / domin
312 IF( resid.GT.rmax )
THEN
317 CALL dcopy( 2*n, d, 1, x, 1 )
319 CALL dlaqtr( .true., .false., n, t, ldt, b, w,
320 $ scale, x, work, info )
328 CALL dcopy( 2*n, d, 1, y, 1 )
329 y( 1 ) = b( 1 )*x( 1+n ) - scale*y( 1 )
331 y( i ) = b( i )*x( 1+n ) + w*x( i+n ) -
334 CALL dgemv(
'Transpose', n, n, one, t, ldt, x,
337 y( 1+n ) = b( 1 )*x( 1 ) + scale*y( 1+n )
339 y( i+n ) = b( i )*x( 1 ) + w*x( i ) +
342 CALL dgemv(
'Transpose', n, n, one, t, ldt,
343 $ x( 1+n ), 1, -one, y( 1+n ), 1 )
345 resid = dasum( 2*n, y, 1 )
346 domin = max( smlnum, ( smlnum / eps )*normtb,
347 $ eps*( normtb*dasum( 2*n, x, 1 ) ) )
348 resid = resid / domin
349 IF( resid.GT.rmax )
THEN
subroutine dget39(rmax, lmax, ninfo, knt)
DGET39
subroutine dcopy(n, dx, incx, dy, incy)
DCOPY
subroutine dgemv(trans, m, n, alpha, a, lda, x, incx, beta, y, incy)
DGEMV
subroutine dlaqtr(ltran, lreal, n, t, ldt, b, w, scale, x, work, info)
DLAQTR solves a real quasi-triangular system of equations, or a complex quasi-triangular system of sp...