81 SUBROUTINE sget32( RMAX, LMAX, NINFO, KNT )
88 INTEGER KNT, LMAX, NINFO
96 parameter( zero = 0.0e0, one = 1.0e0 )
98 parameter( two = 2.0e0, four = 4.0e0, eight = 8.0e0 )
101 LOGICAL LTRANL, LTRANR
102 INTEGER IB, IB1, IB2, IB3, INFO, ISGN, ITL, ITLSCL,
103 $ ITR, ITRANL, ITRANR, ITRSCL, N1, N2
104 REAL BIGNUM, DEN, EPS, RES, SCALE, SGN, SMLNUM, TMP,
108 INTEGER ITVAL( 2, 2, 8 )
109 REAL B( 2, 2 ), TL( 2, 2 ), TR( 2, 2 ), VAL( 3 ),
120 INTRINSIC abs, max, min, sqrt
123 DATA itval / 8, 4, 2, 1, 4, 8, 1, 2, 2, 1, 8, 4, 1,
124 $ 2, 4, 8, 9, 4, 2, 1, 4, 9, 1, 2, 2, 1, 9, 4, 1,
132 smlnum = slamch(
'S' ) / eps
133 bignum = one / smlnum
137 val( 1 ) = sqrt( smlnum )
139 val( 3 ) = sqrt( bignum )
150 DO 210 isgn = -1, 1, 2
160 tl( 1, 1 ) = val( itl )
161 tr( 1, 1 ) = val( itr )
162 b( 1, 1 ) = val( ib )
164 CALL slasy2( ltranl, ltranr, isgn, n1, n2, tl,
165 $ 2, tr, 2, b, 2, scale, x, 2, xnorm,
169 res = abs( ( tl( 1, 1 )+sgn*tr( 1, 1 ) )*
170 $ x( 1, 1 )-scale*b( 1, 1 ) )
172 den = max( eps*( ( abs( tr( 1,
173 $ 1 ) )+abs( tl( 1, 1 ) ) )*abs( x( 1,
176 den = smlnum*max( abs( x( 1, 1 ) ), one )
180 $ res = res + one / eps
181 res = res + abs( xnorm-abs( x( 1, 1 ) ) ) /
182 $ max( smlnum, xnorm ) / eps
183 IF( info.NE.0 .AND. info.NE.1 )
184 $ res = res + one / eps
185 IF( res.GT.rmax )
THEN
200 b( 1, 1 ) = val( ib1 )
201 b( 2, 1 ) = -four*val( ib2 )
202 tl( 1, 1 ) = itval( 1, 1, itl )*
204 tl( 2, 1 ) = itval( 2, 1, itl )*
206 tl( 1, 2 ) = itval( 1, 2, itl )*
208 tl( 2, 2 ) = itval( 2, 2, itl )*
210 tr( 1, 1 ) = val( itr )
212 CALL slasy2( ltranl, ltranr, isgn, n1, n2,
213 $ tl, 2, tr, 2, b, 2, scale, x,
219 tl( 1, 2 ) = tl( 2, 1 )
222 res = abs( ( tl( 1, 1 )+sgn*tr( 1, 1 ) )*
223 $ x( 1, 1 )+tl( 1, 2 )*x( 2, 1 )-
225 res = res + abs( ( tl( 2, 2 )+sgn*tr( 1,
226 $ 1 ) )*x( 2, 1 )+tl( 2, 1 )*
227 $ x( 1, 1 )-scale*b( 2, 1 ) )
228 tnrm = abs( tr( 1, 1 ) ) +
229 $ abs( tl( 1, 1 ) ) +
230 $ abs( tl( 1, 2 ) ) +
231 $ abs( tl( 2, 1 ) ) +
233 xnrm = max( abs( x( 1, 1 ) ),
235 den = max( smlnum, smlnum*xnrm,
236 $ ( tnrm*eps )*xnrm )
239 $ res = res + one / eps
240 res = res + abs( xnorm-xnrm ) /
241 $ max( smlnum, xnorm ) / eps
242 IF( res.GT.rmax )
THEN
259 b( 1, 1 ) = val( ib1 )
260 b( 1, 2 ) = -two*val( ib2 )
261 tr( 1, 1 ) = itval( 1, 1, itr )*
263 tr( 2, 1 ) = itval( 2, 1, itr )*
265 tr( 1, 2 ) = itval( 1, 2, itr )*
267 tr( 2, 2 ) = itval( 2, 2, itr )*
269 tl( 1, 1 ) = val( itl )
271 CALL slasy2( ltranl, ltranr, isgn, n1, n2,
272 $ tl, 2, tr, 2, b, 2, scale, x,
278 tr( 1, 2 ) = tr( 2, 1 )
281 tnrm = abs( tl( 1, 1 ) ) +
282 $ abs( tr( 1, 1 ) ) +
283 $ abs( tr( 1, 2 ) ) +
284 $ abs( tr( 2, 2 ) ) +
286 xnrm = abs( x( 1, 1 ) ) + abs( x( 1, 2 ) )
287 res = abs( ( ( tl( 1, 1 )+sgn*tr( 1,
288 $ 1 ) ) )*( x( 1, 1 ) )+
289 $ ( sgn*tr( 2, 1 ) )*( x( 1, 2 ) )-
290 $ ( scale*b( 1, 1 ) ) )
291 res = res + abs( ( ( tl( 1, 1 )+sgn*tr( 2,
292 $ 2 ) ) )*( x( 1, 2 ) )+
293 $ ( sgn*tr( 1, 2 ) )*( x( 1, 1 ) )-
294 $ ( scale*b( 1, 2 ) ) )
295 den = max( smlnum, smlnum*xnrm,
296 $ ( tnrm*eps )*xnrm )
299 $ res = res + one / eps
300 res = res + abs( xnorm-xnrm ) /
301 $ max( smlnum, xnorm ) / eps
302 IF( res.GT.rmax )
THEN
321 b( 1, 1 ) = val( ib1 )
322 b( 2, 1 ) = -four*val( ib2 )
323 b( 1, 2 ) = -two*val( ib3 )
325 $ min( val( ib1 ), val
326 $ ( ib2 ), val( ib3 ) )
327 tr( 1, 1 ) = itval( 1, 1, itr )*
329 tr( 2, 1 ) = itval( 2, 1, itr )*
331 tr( 1, 2 ) = itval( 1, 2, itr )*
333 tr( 2, 2 ) = itval( 2, 2, itr )*
335 tl( 1, 1 ) = itval( 1, 1, itl )*
337 tl( 2, 1 ) = itval( 2, 1, itl )*
339 tl( 1, 2 ) = itval( 1, 2, itl )*
341 tl( 2, 2 ) = itval( 2, 2, itl )*
344 CALL slasy2( ltranl, ltranr, isgn,
345 $ n1, n2, tl, 2, tr, 2,
352 tr( 1, 2 ) = tr( 2, 1 )
357 tl( 1, 2 ) = tl( 2, 1 )
360 tnrm = abs( tr( 1, 1 ) ) +
361 $ abs( tr( 2, 1 ) ) +
362 $ abs( tr( 1, 2 ) ) +
363 $ abs( tr( 2, 2 ) ) +
364 $ abs( tl( 1, 1 ) ) +
365 $ abs( tl( 2, 1 ) ) +
366 $ abs( tl( 1, 2 ) ) +
368 xnrm = max( abs( x( 1, 1 ) )+
372 res = abs( ( ( tl( 1, 1 )+sgn*tr( 1,
373 $ 1 ) ) )*( x( 1, 1 ) )+
374 $ ( sgn*tr( 2, 1 ) )*
375 $ ( x( 1, 2 ) )+( tl( 1, 2 ) )*
377 $ ( scale*b( 1, 1 ) ) )
378 res = res + abs( ( tl( 1, 1 ) )*
380 $ ( sgn*tr( 1, 2 ) )*
382 $ ( sgn*tr( 2, 2 ) )*
383 $ ( x( 1, 2 ) )+( tl( 1, 2 ) )*
385 $ ( scale*b( 1, 2 ) ) )
386 res = res + abs( ( tl( 2, 1 ) )*
388 $ ( sgn*tr( 1, 1 ) )*
390 $ ( sgn*tr( 2, 1 ) )*
391 $ ( x( 2, 2 ) )+( tl( 2, 2 ) )*
393 $ ( scale*b( 2, 1 ) ) )
394 res = res + abs( ( ( tl( 2,
395 $ 2 )+sgn*tr( 2, 2 ) ) )*
397 $ ( sgn*tr( 1, 2 ) )*
398 $ ( x( 2, 1 ) )+( tl( 2, 1 ) )*
400 $ ( scale*b( 2, 2 ) ) )
401 den = max( smlnum, smlnum*xnrm,
402 $ ( tnrm*eps )*xnrm )
405 $ res = res + one / eps
406 res = res + abs( xnorm-xnrm ) /
407 $ max( smlnum, xnorm ) / eps
408 IF( res.GT.rmax )
THEN
subroutine slasy2(ltranl, ltranr, isgn, n1, n2, tl, ldtl, tr, ldtr, b, ldb, scale, x, ldx, xnorm, info)
SLASY2 solves the Sylvester matrix equation where the matrices are of order 1 or 2.
subroutine sget32(rmax, lmax, ninfo, knt)
SGET32