147 SUBROUTINE claein( RIGHTV, NOINIT, N, H, LDH, W, V, B, LDB, RWORK,
148 $ EPS3, SMLNUM, INFO )
155 LOGICAL NOINIT, RIGHTV
156 INTEGER INFO, LDB, LDH, N
162 COMPLEX B( LDB, * ), H( LDH, * ), V( * )
169 parameter( one = 1.0e+0, tenth = 1.0e-1 )
171 parameter( zero = ( 0.0e+0, 0.0e+0 ) )
174 CHARACTER NORMIN, TRANS
175 INTEGER I, IERR, ITS, J
176 REAL GROWTO, NRMSML, ROOTN, RTEMP, SCALE, VNORM
177 COMPLEX CDUM, EI, EJ, TEMP, X
183 EXTERNAL icamax, scasum, scnrm2, cladiv
189 INTRINSIC abs, aimag, max, real, sqrt
195 cabs1( cdum ) = abs( real( cdum ) ) + abs( aimag( cdum ) )
204 rootn = sqrt( real( n ) )
205 growto = tenth / rootn
206 nrmsml = max( one, eps3*rootn )*smlnum
213 b( i, j ) = h( i, j )
215 b( j, j ) = h( j, j ) - w
229 vnorm = scnrm2( n, v, 1 )
230 CALL csscal( n, ( eps3*rootn ) / max( vnorm, nrmsml ), v, 1 )
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, v,
317 $ scale, rwork, ierr )
322 vnorm = scasum( n, v, 1 )
323 IF( vnorm.GE.growto*scale )
328 rtemp = eps3 / ( rootn+one )
333 v( n-its+1 ) = v( n-its+1 ) - eps3*rootn
344 i = icamax( n, v, 1 )
345 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.
subroutine csscal(n, sa, cx, incx)
CSSCAL