1 SUBROUTINE claref( TYPE, A, LDA, WANTZ, Z, LDZ, BLOCK, IROW1,
2 $ ICOL1, ISTART, ISTOP, ITMP1, ITMP2, LILOZ,
3 $ LIHIZ, VECS, V2, V3, T1, T2, T3 )
13 INTEGER ICOL1, IROW1, ISTART, ISTOP, ITMP1, ITMP2, LDA,
15 COMPLEX T1, T2, T3, V2, V3
18 COMPLEX A( LDA, * ), VECS( * ), Z( LDZ, * )
115 COMPLEX A1, A11, A2, A22, A3, A4, A5, B1, B2, B3, B4,
116 $ b5, h11, h22, sum, sum1, sum2, sum3, t12, t13,
117 $ t22, t23, t32, t33, tmp1, tmp2, tmp3, v22, v23,
129 IF( lsame(
TYPE,
'R' ) ) then
131 DO 30 k = istart, istop - mod( istop-istart+1, 3 ), 3
132 v2 = vecs( ( k-1 )*3+1 )
133 v3 = vecs( ( k-1 )*3+2 )
134 t1 = vecs( ( k-1 )*3+3 )
135 v22 = vecs( ( k-1 )*3+4 )
136 v32 = vecs( ( k-1 )*3+5 )
137 t12 = vecs( ( k-1 )*3+6 )
138 v23 = vecs( ( k-1 )*3+7 )
139 v33 = vecs( ( k-1 )*3+8 )
140 t13 = vecs( ( k-1 )*3+9 )
147 DO 10 j = itmp1, itmp2 - mod( itmp2-itmp1+1, 2 ), 2
154 b2 = a( irow1+1, j+1 )
155 b3 = a( irow1+2, j+1 )
156 b4 = a( irow1+3, j+1 )
157 b5 = a( irow1+4, j+1 )
158 sum1 = conjg( t1 )*a1 + conjg( t2 )*a2 +
160 a( irow1, j ) = a1 - sum1
163 tmp1 = conjg( t1 )*b1 + conjg( t2 )*b2 +
165 a( irow1, j+1 ) = b1 - tmp1
168 sum2 = conjg( t12 )*h11 + conjg( t22 )*h22 +
170 a( irow1+1, j ) = h11 - sum2
173 tmp2 = conjg( t12 )*a11 + conjg( t22 )*a22 +
175 a( irow1+1, j+1 ) = a11 - tmp2
178 sum3 = conjg( t13 )*h11 + conjg( t23 )*h22 +
180 a( irow1+2, j ) = h11 - sum3
181 a( irow1+3, j ) = h22 - sum3*v23
182 a( irow1+4, j ) = a5 - sum3*v33
183 tmp3 = conjg( t13 )*a11 + conjg( t23 )*a22 +
185 a( irow1+2, j+1 ) = a11 - tmp3
186 a( irow1+3, j+1 ) = a22 - tmp3*v23
187 a( irow1+4, j+1 ) = b5 - tmp3*v33
189 DO 20 j = itmp2 - mod( itmp2-itmp1+1, 2 ) + 1, itmp2
190 sum = conjg( t1 )*a( irow1, j ) +
191 $ conjg( t2 )*a( irow1+1, j ) +
192 $ conjg( t3 )*a( irow1+2, j )
193 a( irow1, j ) = a( irow1, j ) - sum
194 h11 = a( irow1+1, j ) - sum*v2
195 h22 = a( irow1+2, j ) - sum*v3
196 sum = conjg( t12 )*h11 + conjg( t22 )*h22 +
197 $ conjg( t32 )*a( irow1+3, j )
198 a( irow1+1, j ) = h11 - sum
200 h22 = a( irow1+3, j ) - sum*v32
201 sum = conjg( t13 )*h11 + conjg( t23 )*h22 +
202 $ conjg( t33 )*a( irow1+4, j )
203 a( irow1+2, j ) = h11 - sum
204 a( irow1+3, j ) = h22 - sum*v23
205 a( irow1+4, j ) = a( irow1+4, j ) - sum*v33
209 DO 50 k = istop - mod( istop-istart+1, 3 ) + 1, istop
210 v2 = vecs( ( k-1 )*3+1 )
211 v3 = vecs( ( k-1 )*3+2 )
212 t1 = vecs( ( k-1 )*3+3 )
215 DO 40 j = itmp1, itmp2
216 sum = conjg( t1 )*a( irow1, j ) +
217 $ conjg( t2 )*a( irow1+1, j ) +
218 $ conjg( t3 )*a( irow1+2, j )
219 a( irow1, j ) = a( irow1, j ) - sum
220 a( irow1+1, j ) = a( irow1+1, j ) - sum*v2
221 a( irow1+2, j ) = a( irow1+2, j ) - sum*v3
226 DO 60 j = itmp1, itmp2
227 sum = conjg( t1 )*a( irow1, j ) +
228 $ conjg( t2 )*a( irow1+1, j ) +
229 $ conjg( t3 )*a( irow1+2, j )
230 a( irow1, j ) = a( irow1, j ) - sum
231 a( irow1+1, j ) = a( irow1+1, j ) - sum*v2
232 a( irow1+2, j ) = a( irow1+2, j ) - sum*v3
240 DO 90 k = istart, istop - mod( istop-istart+1, 3 ), 3
241 v2 = vecs( ( k-1 )*3+1 )
242 v3 = vecs( ( k-1 )*3+2 )
243 t1 = vecs( ( k-1 )*3+3 )
244 v22 = vecs( ( k-1 )*3+4 )
245 v32 = vecs( ( k-1 )*3+5 )
246 t12 = vecs( ( k-1 )*3+6 )
247 v23 = vecs( ( k-1 )*3+7 )
248 v33 = vecs( ( k-1 )*3+8 )
249 t13 = vecs( ( k-1 )*3+9 )
256 DO 70 j = itmp1, itmp2
257 sum = t1*a( j, icol1 ) + t2*a( j, icol1+1 ) +
259 a( j, icol1 ) = a( j, icol1 ) - sum
260 h11 = a( j, icol1+1 ) - sum*conjg( v2 )
261 h22 = a( j, icol1+2 ) - sum*conjg( v3 )
262 sum = t12*h11 + t22*h22 + t32*a( j, icol1+3 )
263 a( j, icol1+1 ) = h11 - sum
264 h11 = h22 - sum*conjg( v22 )
265 h22 = a( j, icol1+3 ) - sum*conjg( v32 )
266 sum = t13*h11 + t23*h22 + t33*a( j, icol1+4 )
267 a( j, icol1+2 ) = h11 - sum
268 a( j, icol1+3 ) = h22 - sum*conjg( v23 )
269 a( j, icol1+4 ) = a( j, icol1+4 ) - sum*conjg( v33 )
272 DO 80 j = liloz, lihiz
273 sum = t1*z( j, icol1 ) + t2*z( j, icol1+1 ) +
275 z( j, icol1 ) = z( j, icol1 ) - sum
276 h11 = z( j, icol1+1 ) - sum*conjg( v2 )
277 h22 = z( j, icol1+2 ) - sum*conjg( v3 )
278 sum = t12*h11 + t22*h22 + t32*z( j, icol1+3 )
279 z( j, icol1+1 ) = h11 - sum
280 h11 = h22 - sum*conjg( v22 )
281 h22 = z( j, icol1+3 ) - sum*conjg( v32 )
282 sum = t13*h11 + t23*h22 + t33*z( j, icol1+4 )
283 z( j, icol1+2 ) = h11 - sum
284 z( j, icol1+3 ) = h22 - sum*conjg( v23 )
285 z( j, icol1+4 ) = z( j, icol1+4 ) -
291 DO 120 k = istop - mod( istop-istart+1, 3 ) + 1, istop
292 v2 = vecs( ( k-1 )*3+1 )
293 v3 = vecs( ( k-1 )*3+2 )
294 t1 = vecs( ( k-1 )*3+3 )
297 DO 100 j = itmp1, itmp2
298 sum = t1*a( j, icol1 ) + t2*a( j, icol1+1 ) +
300 a( j, icol1 ) = a( j, icol1 ) - sum
301 a( j, icol1+1 ) = a( j, icol1+1 ) - sum*conjg( v2 )
302 a( j, icol1+2 ) = a( j, icol1+2 ) - sum*conjg( v3 )
305 DO 110 j = liloz, lihiz
306 sum = t1*z( j, icol1 ) + t2*z( j, icol1+1 ) +
308 z( j, icol1 ) = z( j, icol1 ) - sum
309 z( j, icol1+1 ) = z( j, icol1+1 ) -
311 z( j, icol1+2 ) = z( j, icol1+2 ) -
318 DO 130 j = itmp1, itmp2
319 sum = t1*a( j, icol1 ) + t2*a( j, icol1+1 ) +
321 a( j, icol1 ) = a( j, icol1 ) - sum
322 a( j, icol1+1 ) = a( j, icol1+1 ) - sum*conjg( v2 )
323 a( j, icol1+2 ) = a( j, icol1+2 ) - sum*conjg( v3 )