LAPACK  3.6.1 LAPACK: Linear Algebra PACKage
 subroutine ctrsen ( character JOB, character COMPQ, logical, dimension( * ) SELECT, integer N, complex, dimension( ldt, * ) T, integer LDT, complex, dimension( ldq, * ) Q, integer LDQ, complex, dimension( * ) W, integer M, real S, real SEP, complex, dimension( * ) WORK, integer LWORK, integer INFO )

CTRSEN

Purpose:
CTRSEN reorders the Schur factorization of a complex matrix
A = Q*T*Q**H, so that a selected cluster of eigenvalues appears in
the leading positions on the diagonal of the upper triangular matrix
T, and the leading columns of Q form an orthonormal basis of the
corresponding right invariant subspace.

Optionally the routine computes the reciprocal condition numbers of
the cluster of eigenvalues and/or the invariant subspace.
Parameters
 [in] JOB JOB is CHARACTER*1 Specifies whether condition numbers are required for the cluster of eigenvalues (S) or the invariant subspace (SEP): = 'N': none; = 'E': for eigenvalues only (S); = 'V': for invariant subspace only (SEP); = 'B': for both eigenvalues and invariant subspace (S and SEP). [in] COMPQ COMPQ is CHARACTER*1 = 'V': update the matrix Q of Schur vectors; = 'N': do not update Q. [in] SELECT SELECT is LOGICAL array, dimension (N) SELECT specifies the eigenvalues in the selected cluster. To select the j-th eigenvalue, SELECT(j) must be set to .TRUE.. [in] N N is INTEGER The order of the matrix T. N >= 0. [in,out] T T is COMPLEX array, dimension (LDT,N) On entry, the upper triangular matrix T. On exit, T is overwritten by the reordered matrix T, with the selected eigenvalues as the leading diagonal elements. [in] LDT LDT is INTEGER The leading dimension of the array T. LDT >= max(1,N). [in,out] Q Q is COMPLEX array, dimension (LDQ,N) On entry, if COMPQ = 'V', the matrix Q of Schur vectors. On exit, if COMPQ = 'V', Q has been postmultiplied by the unitary transformation matrix which reorders T; the leading M columns of Q form an orthonormal basis for the specified invariant subspace. If COMPQ = 'N', Q is not referenced. [in] LDQ LDQ is INTEGER The leading dimension of the array Q. LDQ >= 1; and if COMPQ = 'V', LDQ >= N. [out] W W is COMPLEX array, dimension (N) The reordered eigenvalues of T, in the same order as they appear on the diagonal of T. [out] M M is INTEGER The dimension of the specified invariant subspace. 0 <= M <= N. [out] S S is REAL If JOB = 'E' or 'B', S is a lower bound on the reciprocal condition number for the selected cluster of eigenvalues. S cannot underestimate the true reciprocal condition number by more than a factor of sqrt(N). If M = 0 or N, S = 1. If JOB = 'N' or 'V', S is not referenced. [out] SEP SEP is REAL If JOB = 'V' or 'B', SEP is the estimated reciprocal condition number of the specified invariant subspace. If M = 0 or N, SEP = norm(T). If JOB = 'N' or 'E', SEP is not referenced. [out] WORK WORK is COMPLEX array, dimension (MAX(1,LWORK)) On exit, if INFO = 0, WORK(1) returns the optimal LWORK. [in] LWORK LWORK is INTEGER The dimension of the array WORK. If JOB = 'N', LWORK >= 1; if JOB = 'E', LWORK = max(1,M*(N-M)); if JOB = 'V' or 'B', LWORK >= max(1,2*M*(N-M)). If LWORK = -1, then a workspace query is assumed; the routine only calculates the optimal size of the WORK array, returns this value as the first entry of the WORK array, and no error message related to LWORK is issued by XERBLA. [out] INFO INFO is INTEGER = 0: successful exit < 0: if INFO = -i, the i-th argument had an illegal value
Date
November 2011
Further Details:
CTRSEN first collects the selected eigenvalues by computing a unitary
transformation Z to move them to the top left corner of T. In other
words, the selected eigenvalues are the eigenvalues of T11 in:

Z**H * T * Z = ( T11 T12 ) n1
(  0  T22 ) n2
n1  n2

where N = n1+n2. The first
n1 columns of Z span the specified invariant subspace of T.

If T has been obtained from the Schur factorization of a matrix
A = Q*T*Q**H, then the reordered Schur factorization of A is given by
A = (Q*Z)*(Z**H*T*Z)*(Q*Z)**H, and the first n1 columns of Q*Z span the
corresponding invariant subspace of A.

The reciprocal condition number of the average of the eigenvalues of
T11 may be returned in S. S lies between 0 (very badly conditioned)
and 1 (very well conditioned). It is computed as follows. First we
compute R so that

P = ( I  R ) n1
( 0  0 ) n2
n1 n2

is the projector on the invariant subspace associated with T11.
R is the solution of the Sylvester equation:

T11*R - R*T22 = T12.

Let F-norm(M) denote the Frobenius-norm of M and 2-norm(M) denote
the two-norm of M. Then S is computed as the lower bound

(1 + F-norm(R)**2)**(-1/2)

on the reciprocal of 2-norm(P), the true reciprocal condition number.
S cannot underestimate 1 / 2-norm(P) by more than a factor of
sqrt(N).

An approximate error bound for the computed average of the
eigenvalues of T11 is

EPS * norm(T) / S

where EPS is the machine precision.

The reciprocal condition number of the right invariant subspace
spanned by the first n1 columns of Z (or of Q*Z) is returned in SEP.
SEP is defined as the separation of T11 and T22:

sep( T11, T22 ) = sigma-min( C )

where sigma-min(C) is the smallest singular value of the
n1*n2-by-n1*n2 matrix

C  = kprod( I(n2), T11 ) - kprod( transpose(T22), I(n1) )

I(m) is an m by m identity matrix, and kprod denotes the Kronecker
product. We estimate sigma-min(C) by the reciprocal of an estimate of
the 1-norm of inverse(C). The true reciprocal 1-norm of inverse(C)
cannot differ from sigma-min(C) by more than a factor of sqrt(n1*n2).

When SEP is small, small changes in T can cause large changes in
the invariant subspace. An approximate bound on the maximum angular
error in the computed right invariant subspace is

EPS * norm(T) / SEP

Definition at line 266 of file ctrsen.f.

266 *
267 * -- LAPACK computational routine (version 3.4.0) --
268 * -- LAPACK is a software package provided by Univ. of Tennessee, --
269 * -- Univ. of California Berkeley, Univ. of Colorado Denver and NAG Ltd..--
270 * November 2011
271 *
272 * .. Scalar Arguments ..
273  CHARACTER compq, job
274  INTEGER info, ldq, ldt, lwork, m, n
275  REAL s, sep
276 * ..
277 * .. Array Arguments ..
278  LOGICAL select( * )
279  COMPLEX q( ldq, * ), t( ldt, * ), w( * ), work( * )
280 * ..
281 *
282 * =====================================================================
283 *
284 * .. Parameters ..
285  REAL zero, one
286  parameter ( zero = 0.0e+0, one = 1.0e+0 )
287 * ..
288 * .. Local Scalars ..
289  LOGICAL lquery, wantbh, wantq, wants, wantsp
290  INTEGER ierr, k, kase, ks, lwmin, n1, n2, nn
291  REAL est, rnorm, scale
292 * ..
293 * .. Local Arrays ..
294  INTEGER isave( 3 )
295  REAL rwork( 1 )
296 * ..
297 * .. External Functions ..
298  LOGICAL lsame
299  REAL clange
300  EXTERNAL lsame, clange
301 * ..
302 * .. External Subroutines ..
303  EXTERNAL clacn2, clacpy, ctrexc, ctrsyl, xerbla
304 * ..
305 * .. Intrinsic Functions ..
306  INTRINSIC max, sqrt
307 * ..
308 * .. Executable Statements ..
309 *
310 * Decode and test the input parameters.
311 *
312  wantbh = lsame( job, 'B' )
313  wants = lsame( job, 'E' ) .OR. wantbh
314  wantsp = lsame( job, 'V' ) .OR. wantbh
315  wantq = lsame( compq, 'V' )
316 *
317 * Set M to the number of selected eigenvalues.
318 *
319  m = 0
320  DO 10 k = 1, n
321  IF( SELECT( k ) )
322  \$ m = m + 1
323  10 CONTINUE
324 *
325  n1 = m
326  n2 = n - m
327  nn = n1*n2
328 *
329  info = 0
330  lquery = ( lwork.EQ.-1 )
331 *
332  IF( wantsp ) THEN
333  lwmin = max( 1, 2*nn )
334  ELSE IF( lsame( job, 'N' ) ) THEN
335  lwmin = 1
336  ELSE IF( lsame( job, 'E' ) ) THEN
337  lwmin = max( 1, nn )
338  END IF
339 *
340  IF( .NOT.lsame( job, 'N' ) .AND. .NOT.wants .AND. .NOT.wantsp )
341  \$ THEN
342  info = -1
343  ELSE IF( .NOT.lsame( compq, 'N' ) .AND. .NOT.wantq ) THEN
344  info = -2
345  ELSE IF( n.LT.0 ) THEN
346  info = -4
347  ELSE IF( ldt.LT.max( 1, n ) ) THEN
348  info = -6
349  ELSE IF( ldq.LT.1 .OR. ( wantq .AND. ldq.LT.n ) ) THEN
350  info = -8
351  ELSE IF( lwork.LT.lwmin .AND. .NOT.lquery ) THEN
352  info = -14
353  END IF
354 *
355  IF( info.EQ.0 ) THEN
356  work( 1 ) = lwmin
357  END IF
358 *
359  IF( info.NE.0 ) THEN
360  CALL xerbla( 'CTRSEN', -info )
361  RETURN
362  ELSE IF( lquery ) THEN
363  RETURN
364  END IF
365 *
366 * Quick return if possible
367 *
368  IF( m.EQ.n .OR. m.EQ.0 ) THEN
369  IF( wants )
370  \$ s = one
371  IF( wantsp )
372  \$ sep = clange( '1', n, n, t, ldt, rwork )
373  GO TO 40
374  END IF
375 *
376 * Collect the selected eigenvalues at the top left corner of T.
377 *
378  ks = 0
379  DO 20 k = 1, n
380  IF( SELECT( k ) ) THEN
381  ks = ks + 1
382 *
383 * Swap the K-th eigenvalue to position KS.
384 *
385  IF( k.NE.ks )
386  \$ CALL ctrexc( compq, n, t, ldt, q, ldq, k, ks, ierr )
387  END IF
388  20 CONTINUE
389 *
390  IF( wants ) THEN
391 *
392 * Solve the Sylvester equation for R:
393 *
394 * T11*R - R*T22 = scale*T12
395 *
396  CALL clacpy( 'F', n1, n2, t( 1, n1+1 ), ldt, work, n1 )
397  CALL ctrsyl( 'N', 'N', -1, n1, n2, t, ldt, t( n1+1, n1+1 ),
398  \$ ldt, work, n1, scale, ierr )
399 *
400 * Estimate the reciprocal of the condition number of the cluster
401 * of eigenvalues.
402 *
403  rnorm = clange( 'F', n1, n2, work, n1, rwork )
404  IF( rnorm.EQ.zero ) THEN
405  s = one
406  ELSE
407  s = scale / ( sqrt( scale*scale / rnorm+rnorm )*
408  \$ sqrt( rnorm ) )
409  END IF
410  END IF
411 *
412  IF( wantsp ) THEN
413 *
414 * Estimate sep(T11,T22).
415 *
416  est = zero
417  kase = 0
418  30 CONTINUE
419  CALL clacn2( nn, work( nn+1 ), work, est, kase, isave )
420  IF( kase.NE.0 ) THEN
421  IF( kase.EQ.1 ) THEN
422 *
423 * Solve T11*R - R*T22 = scale*X.
424 *
425  CALL ctrsyl( 'N', 'N', -1, n1, n2, t, ldt,
426  \$ t( n1+1, n1+1 ), ldt, work, n1, scale,
427  \$ ierr )
428  ELSE
429 *
430 * Solve T11**H*R - R*T22**H = scale*X.
431 *
432  CALL ctrsyl( 'C', 'C', -1, n1, n2, t, ldt,
433  \$ t( n1+1, n1+1 ), ldt, work, n1, scale,
434  \$ ierr )
435  END IF
436  GO TO 30
437  END IF
438 *
439  sep = scale / est
440  END IF
441 *
442  40 CONTINUE
443 *
444 * Copy reordered eigenvalues to W.
445 *
446  DO 50 k = 1, n
447  w( k ) = t( k, k )
448  50 CONTINUE
449 *
450  work( 1 ) = lwmin
451 *
452  RETURN
453 *
454 * End of CTRSEN
455 *
subroutine ctrsyl(TRANA, TRANB, ISGN, M, N, A, LDA, B, LDB, C, LDC, SCALE, INFO)
CTRSYL
Definition: ctrsyl.f:159
real function clange(NORM, M, N, A, LDA, WORK)
CLANGE returns the value of the 1-norm, Frobenius norm, infinity-norm, or the largest absolute value ...
Definition: clange.f:117
subroutine xerbla(SRNAME, INFO)
XERBLA
Definition: xerbla.f:62
subroutine clacpy(UPLO, M, N, A, LDA, B, LDB)
CLACPY copies all or part of one two-dimensional array to another.
Definition: clacpy.f:105
subroutine ctrexc(COMPQ, N, T, LDT, Q, LDQ, IFST, ILST, INFO)
CTREXC
Definition: ctrexc.f:126
logical function lsame(CA, CB)
LSAME
Definition: lsame.f:55
subroutine clacn2(N, V, X, EST, KASE, ISAVE)
CLACN2 estimates the 1-norm of a square matrix, using reverse communication for evaluating matrix-vec...
Definition: clacn2.f:135

Here is the call graph for this function:

Here is the caller graph for this function: