145 SUBROUTINE claein( RIGHTV, NOINIT, N, H, LDH, W, V, B, LDB,
147 $ EPS3, SMLNUM, INFO )
154 LOGICAL NOINIT, RIGHTV
155 INTEGER INFO, LDB, LDH, N
161 COMPLEX B( LDB, * ), H( LDH, * ), V( * )
168 PARAMETER ( ONE = 1.0e+0, tenth = 1.0e-1 )
170 parameter( zero = ( 0.0e+0, 0.0e+0 ) )
173 CHARACTER NORMIN, TRANS
174 INTEGER I, IERR, ITS, J
175 REAL GROWTO, NRMSML, ROOTN, RTEMP, SCALE, VNORM
176 COMPLEX CDUM, EI, EJ, TEMP, X
182 EXTERNAL icamax, scasum, scnrm2, cladiv
188 INTRINSIC abs, aimag, max, real, sqrt
194 cabs1( cdum ) = abs( real( cdum ) ) + abs( aimag( cdum ) )
203 rootn = sqrt( real( n ) )
204 growto = tenth / rootn
205 nrmsml = max( one, eps3*rootn )*smlnum
212 b( i, j ) = h( i, j )
214 b( j, j ) = h( j, j ) - w
228 vnorm = scnrm2( n, v, 1 )
229 CALL csscal( n, ( eps3*rootn ) / max( vnorm, nrmsml ), v,
240 IF( cabs1( b( i, i ) ).LT.cabs1( ei ) )
THEN
244 x = cladiv( b( i, i ), ei )
248 b( i+1, j ) = b( i, j ) - x*temp
255 IF( b( i, i ).EQ.zero )
257 x = cladiv( ei, b( i, i ) )
260 b( i+1, j ) = b( i+1, j ) - x*b( i, j )
265 IF( b( n, n ).EQ.zero )
277 IF( cabs1( b( j, j ) ).LT.cabs1( ej ) )
THEN
281 x = cladiv( b( j, j ), ej )
285 b( i, j-1 ) = b( i, j ) - x*temp
292 IF( b( j, j ).EQ.zero )
294 x = cladiv( ej, b( j, j ) )
297 b( i, j-1 ) = b( i, j-1 ) - x*b( i, j )
302 IF( b( 1, 1 ).EQ.zero )
316 CALL clatrs(
'Upper', trans,
'Nonunit', normin, n, b, ldb,
318 $ scale, rwork, ierr )
323 vnorm = scasum( n, v, 1 )
324 IF( vnorm.GE.growto*scale )
329 rtemp = eps3 / ( rootn+one )
334 v( n-its+1 ) = v( n-its+1 ) - eps3*rootn
345 i = icamax( n, v, 1 )
346 CALL csscal( n, one / cabs1( v( i ) ), v, 1 )
subroutine claein(rightv, noinit, n, h, ldh, w, v, b, ldb, rwork, eps3, smlnum, info)
CLAEIN computes a specified right or left eigenvector of an upper Hessenberg matrix by inverse iterat...
subroutine clatrs(uplo, trans, diag, normin, n, a, lda, x, scale, cnorm, info)
CLATRS solves a triangular system of equations with the scale factor set to prevent overflow.