1 SUBROUTINE dlamsh ( S, LDS, NBULGE, JBLK, H, LDH, N, ULP )
9 INTEGER LDS, NBULGE, JBLK, LDH, N
13 DOUBLE PRECISION S(LDS,*), H(LDH,*)
75 DOUBLE PRECISION ZERO, TEN
76 parameter( zero = 0.0d+0, ten = 10.0d+0 )
79 INTEGER K, IBULGE, M, NR, J, IVAL, I
80 DOUBLE PRECISION H44, H33, H43H34, H11, H22, H21, H12, H44S,
81 $ H33S, V1, V2, V3, H00, H10, TST1, T1, T2, T3,
88 EXTERNAL dlarfg, dcopy
96 DO 10 ibulge = 1, nbulge
97 h44 = s(2*jblk-2*ibulge+2, 2*jblk-2*ibulge+2)
98 h33 = s(2*jblk-2*ibulge+1,2*jblk-2*ibulge+1)
99 h43h34 = s(2*jblk-2*ibulge+1,2*jblk-2*ibulge+2)*
100 $ s(2*jblk-2*ibulge+2, 2*jblk-2*ibulge+1)
107 v1 = ( h33s*h44s-h43h34 ) / h21 + h12
108 v2 = h22 - h11 - h33s - h44s
110 s1 = abs( v1 ) + abs( v2 ) + abs( v3 )
119 tst1 = abs( v1 )*( abs( h00 )+abs( h11 )+abs( h22 ) )
120 IF( abs( h10 )*( abs( v2 )+abs( v3 ) ).GT.ulp*tst1 )
THEN
122 dval = (abs(h10)*(abs(v2)+abs(v3))) / (ulp*tst1)
124 DO 15 i = ibulge+1, nbulge
125 h44 = s(2*jblk-2*i+2, 2*jblk-2*i+2)
126 h33 = s(2*jblk-2*i+1,2*jblk-2*i+1)
127 h43h34 = s(2*jblk-2*i+1,2*jblk-2*i+2)*
128 $ s(2*jblk-2*i+2, 2*jblk-2*i+1)
135 v1 = ( h33s*h44s-h43h34 ) / h21 + h12
136 v2 = h22 - h11 - h33s - h44s
138 s1 = abs( v1 ) + abs( v2 ) + abs( v3 )
147 tst1 = abs( v1 )*( abs( h00 )+abs( h11 )+abs( h22 ) )
148 IF ( (dval.GT.(abs(h10)*(abs(v2)+abs(v3)))/(ulp*tst1))
149 $ .AND. ( dval .GT. 1.d0 ) )
THEN
150 dval = (abs(h10)*(abs(v2)+abs(v3))) / (ulp*tst1)
154 IF ( (dval .LT. ten) .AND. (ival .NE. ibulge) )
THEN
155 h44 = s(2*jblk-2*ival+2, 2*jblk-2*ival+2)
156 h33 = s(2*jblk-2*ival+1,2*jblk-2*ival+1)
157 h43h34 = s(2*jblk-2*ival+1,2*jblk-2*ival+2)
158 h10 = s(2*jblk-2*ival+2, 2*jblk-2*ival+1)
159 s(2*jblk-2*ival+2,2*jblk-2*ival+2) =
160 $ s(2*jblk-2*ibulge+2,2*jblk-2*ibulge+2)
161 s(2*jblk-2*ival+1,2*jblk-2*ival+1) =
162 $ s(2*jblk-2*ibulge+1,2*jblk-2*ibulge+1)
163 s(2*jblk-2*ival+1,2*jblk-2*ival+2) =
164 $ s(2*jblk-2*ibulge+1,2*jblk-2*ibulge+2)
165 s(2*jblk-2*ival+2, 2*jblk-2*ival+1) =
166 $ s(2*jblk-2*ibulge+2, 2*jblk-2*ibulge+1)
167 s(2*jblk-2*ibulge+2, 2*jblk-2*ibulge+2) = h44
168 s(2*jblk-2*ibulge+1,2*jblk-2*ibulge+1) = h33
169 s(2*jblk-2*ibulge+1,2*jblk-2*ibulge+2) = h43h34
170 s(2*jblk-2*ibulge+2, 2*jblk-2*ibulge+1) = h10
172 h44 = s(2*jblk-2*ibulge+2, 2*jblk-2*ibulge+2)
173 h33 = s(2*jblk-2*ibulge+1,2*jblk-2*ibulge+1)
174 h43h34 = s(2*jblk-2*ibulge+1,2*jblk-2*ibulge+2)*
175 $ s(2*jblk-2*ibulge+2, 2*jblk-2*ibulge+1)
182 v1 = ( h33s*h44s-h43h34 ) / h21 + h12
183 v2 = h22 - h11 - h33s - h44s
185 s1 = abs( v1 ) + abs( v2 ) + abs( v3 )
194 tst1 = abs( v1 )*( abs( h00 )+abs( h11 )+abs( h22 ) )
196 IF( abs( h10 )*( abs( v2 )+abs( v3 ) ).GT.ten*ulp*tst1 )
THEN
198 nbulge =
max(ibulge -1,1)
204 $
CALL dcopy( nr, h( k, k-1 ), 1, v, 1 )
205 CALL dlarfg( nr, v( 1 ), v( 2 ), 1, t1 )
210 $ h( k+2, k-1 ) = zero
212 h( k, k-1 ) = -h( k, k-1 )
220 sum = h( k, j ) + v2*h( k+1, j ) + v3*h( k+2, j )
221 h( k, j ) = h( k, j ) - sum*t1
222 h( k+1, j ) = h( k+1, j ) - sum*t2
223 h( k+2, j ) = h( k+2, j ) - sum*t3
225 DO 70 j = 1,
min( k+3, n )
226 sum = h( j, k ) + v2*h( j, k+1 ) + v3*h( j, k+2 )
227 h( j, k ) = h( j, k ) - sum*t1
228 h( j, k+1 ) = h( j, k+1 ) - sum*t2
229 h( j, k+2 ) = h( j, k+2 ) - sum*t3