hide long namesshow long names
hide short namesshow short names
Integer type:  int32  int64  nag_int  show int32  show int32  show int64  show int64  show nag_int  show nag_int

PDF version (NAG web site, 64-bit version, 64-bit version)
Chapter Contents
Chapter Introduction
NAG Toolbox

NAG Toolbox: nag_lapack_zgeevx (f08np)

Purpose

nag_lapack_zgeevx (f08np) computes the eigenvalues and, optionally, the left and/or right eigenvectors for an nn by nn complex nonsymmetric matrix AA.
Optionally, it also computes a balancing transformation to improve the conditioning of the eigenvalues and eigenvectors, reciprocal condition numbers for the eigenvalues, and reciprocal condition numbers for the right eigenvectors.

Syntax

[a, w, vl, vr, ilo, ihi, scale, abnrm, rconde, rcondv, info] = f08np(balanc, jobvl, jobvr, sense, a, 'n', n)
[a, w, vl, vr, ilo, ihi, scale, abnrm, rconde, rcondv, info] = nag_lapack_zgeevx(balanc, jobvl, jobvr, sense, a, 'n', n)

Description

The right eigenvector vjvj of AA satisfies
A vj = λj vj
A vj = λj vj
where λjλj is the jjth eigenvalue of AA. The left eigenvector ujuj of AA satisfies
ujH A = λj ujH
ujH A = λj ujH
where ujHujH denotes the conjugate transpose of ujuj.
Balancing a matrix means permuting the rows and columns to make it more nearly upper triangular, and applying a diagonal similarity transformation DAD1DAD-1, where DD is a diagonal matrix, with the aim of making its rows and columns closer in norm and the condition numbers of its eigenvalues and eigenvectors smaller. The computed reciprocal condition numbers correspond to the balanced matrix. Permuting rows and columns will not change the condition numbers (in exact arithmetic) but diagonal scaling will. For further explanation of balancing, see Section 4.8.1.2 of Anderson et al. (1999).
Following the optional balancing, the matrix AA is first reduced to upper Hessenberg form by means of unitary similarity transformations, and the QRQR algorithm is then used to further reduce the matrix to upper triangular Schur form, TT, from which the eigenvalues are computed. Optionally, the eigenvectors of TT are also computed and backtransformed to those of AA.

References

Anderson E, Bai Z, Bischof C, Blackford S, Demmel J, Dongarra J J, Du Croz J J, Greenbaum A, Hammarling S, McKenney A and Sorensen D (1999) LAPACK Users' Guide (3rd Edition) SIAM, Philadelphia http://www.netlib.org/lapack/lug
Golub G H and Van Loan C F (1996) Matrix Computations (3rd Edition) Johns Hopkins University Press, Baltimore

Parameters

Compulsory Input Parameters

1:     balanc – string (length ≥ 1)
Indicates how the input matrix should be diagonally scaled and/or permuted to improve the conditioning of its eigenvalues.
balanc = 'N'balanc='N'
Do not diagonally scale or permute.
balanc = 'P'balanc='P'
Perform permutations to make the matrix more nearly upper triangular. Do not diagonally scale.
balanc = 'S'balanc='S'
Diagonally scale the matrix, i.e., replace AA by DAD1DAD-1, where DD is a diagonal matrix chosen to make the rows and columns of AA more equal in norm. Do not permute.
balanc = 'B'balanc='B'
Both diagonally scale and permute AA.
Computed reciprocal condition numbers will be for the matrix after balancing and/or permuting. Permuting does not change condition numbers (in exact arithmetic), but balancing does.
Constraint: balanc = 'N'balanc='N', 'P''P', 'S''S' or 'B''B'.
2:     jobvl – string (length ≥ 1)
If jobvl = 'N'jobvl='N', the left eigenvectors of AA are not computed.
If jobvl = 'V'jobvl='V', the left eigenvectors of AA are computed.
If sense = 'E'sense='E' or 'B''B', jobvl must be set to jobvl = 'V'jobvl='V'.
Constraint: jobvl = 'N'jobvl='N' or 'V''V'.
3:     jobvr – string (length ≥ 1)
If jobvr = 'N'jobvr='N', the right eigenvectors of AA are not computed.
If jobvr = 'V'jobvr='V', the right eigenvectors of AA are computed.
If sense = 'E'sense='E' or 'B''B', jobvr must be set to jobvr = 'V'jobvr='V'.
Constraint: jobvr = 'N'jobvr='N' or 'V''V'.
4:     sense – string (length ≥ 1)
Determines which reciprocal condition numbers are computed.
sense = 'N'sense='N'
None are computed.
sense = 'E'sense='E'
Computed for eigenvalues only.
sense = 'V'sense='V'
Computed for right eigenvectors only.
sense = 'B'sense='B'
Computed for eigenvalues and right eigenvectors.
If sense = 'E'sense='E' or 'B''B', both left and right eigenvectors must also be computed (jobvl = 'V'jobvl='V' and jobvr = 'V'jobvr='V').
Constraint: sense = 'N'sense='N', 'E''E', 'V''V' or 'B''B'.
5:     a(lda, : :) – complex array
The first dimension of the array a must be at least max (1,n)max(1,n)
The second dimension of the array must be at least max (1,n)max(1,n)
The nn by nn matrix AA.

Optional Input Parameters

1:     n – int64int32nag_int scalar
Default: The first dimension of the array a and the second dimension of the array a. (An error is raised if these dimensions are not equal.)
nn, the order of the matrix AA.
Constraint: n0n0.

Input Parameters Omitted from the MATLAB Interface

lda ldvl ldvr work lwork rwork

Output Parameters

1:     a(lda, : :) – complex array
The first dimension of the array a will be max (1,n)max(1,n)
The second dimension of the array will be max (1,n)max(1,n)
ldamax (1,n)ldamax(1,n).
a has been overwritten. If jobvl = 'V'jobvl='V' or jobvr = 'V'jobvr='V', AA contains the Schur form of the balanced version of the matrix AA.
2:     w( : :) – complex array
Note: the dimension of the array w must be at least max (1,n)max(1,n).
Contains the computed eigenvalues.
3:     vl(ldvl, : :) – complex array
The first dimension, ldvl, of the array vl will be
  • if jobvl = 'V'jobvl='V', ldvl max (1,n) ldvl max(1,n) ;
  • otherwise ldvl1ldvl1.
The second dimension of the array will be max (1,n)max(1,n) if jobvl = 'V'jobvl='V', and at least 11 otherwise
If jobvl = 'V'jobvl='V', the left eigenvectors ujuj are stored one after another in the columns of vl, in the same order as their corresponding eigenvalues; that is uj = vl( : ,j)uj=vl:j, the jjth column of vl.
If jobvl = 'N'jobvl='N', vl is not referenced.
4:     vr(ldvr, : :) – complex array
The first dimension, ldvr, of the array vr will be
  • if jobvr = 'V'jobvr='V', ldvr max (1,n) ldvr max(1,n) ;
  • otherwise ldvr1ldvr1.
The second dimension of the array will be max (1,n)max(1,n) if jobvr = 'V'jobvr='V', and at least 11 otherwise
If jobvr = 'V'jobvr='V', the right eigenvectors vjvj are stored one after another in the columns of vr, in the same order as their corresponding eigenvalues; that is vj = vr( : ,j)vj=vr:j, the jjth column of vr.
If jobvr = 'N'jobvr='N', vr is not referenced.
5:     ilo – int64int32nag_int scalar
6:     ihi – int64int32nag_int scalar
ilo and ihi are integer values determined when AA was balanced. The balanced AA has aij = 0aij=0 if i > ji>j and j = 1,2,,ilo1j=1,2,,ilo-1 or i = ihi + 1,,ni=ihi+1,,n.
7:     scale( : :) – double array
Note: the dimension of the array scale must be at least max (1,n)max(1,n).
Details of the permutations and scaling factors applied when balancing AA.
If pjpj is the index of the row and column interchanged with row and column jj, and djdj is the scaling factor applied to row and column jj, then
  • scale(j) = pjscalej=pj, for j = 1,2,,ilo1j=1,2,,ilo-1;
  • scale(j) = djscalej=dj, for j = ilo,,ihij=ilo,,ihi;
  • scale(j) = pjscalej=pj, for j = ihi + 1,,nj=ihi+1,,n.
The order in which the interchanges are made is n to ihi + 1ihi+1, then 11 to ilo1ilo-1.
8:     abnrm – double scalar
The 11-norm of the balanced matrix (the maximum of the sum of absolute values of elements of any column).
9:     rconde( : :) – double array
Note: the dimension of the array rconde must be at least max (1,n)max(1,n).
rconde(j)rcondej is the reciprocal condition number of the jjth eigenvalue.
10:   rcondv( : :) – double array
Note: the dimension of the array rcondv must be at least max (1,n)max(1,n).
rcondv(j)rcondvj is the reciprocal condition number of the jjth right eigenvector.
11:   info – int64int32nag_int scalar
info = 0info=0 unless the function detects an error (see Section [Error Indicators and Warnings]).

Error Indicators and Warnings

Cases prefixed with W are classified as warnings and do not generate an error of type NAG:error_n. See nag_issue_warnings.

  info = iinfo=-i
If info = iinfo=-i, parameter ii had an illegal value on entry. The parameters are numbered as follows:
1: balanc, 2: jobvl, 3: jobvr, 4: sense, 5: n, 6: a, 7: lda, 8: w, 9: vl, 10: ldvl, 11: vr, 12: ldvr, 13: ilo, 14: ihi, 15: scale, 16: abnrm, 17: rconde, 18: rcondv, 19: work, 20: lwork, 21: rwork, 22: info.
It is possible that info refers to a parameter that is omitted from the MATLAB interface. This usually indicates that an error in one of the other input parameters has caused an incorrect value to be inferred.
W INFO > 0INFO>0
If info = iinfo=i, the QRQR algorithm failed to compute all the eigenvalues, and no eigenvectors or condition numbers have been computed; elements 1 : ilo11:ilo-1 and i + 1 : ni+1:n of w contain eigenvalues which have converged.

Accuracy

The computed eigenvalues and eigenvectors are exact for a nearby matrix (A + E)(A+E), where
E2 = O(ε) A2 ,
E2 = O(ε) A2 ,
and εε is the machine precision. See Section 4.8 of Anderson et al. (1999) for further details.

Further Comments

Each eigenvector is normalized to have Euclidean norm equal to unity and the element of largest absolute value real and positive.
The total number of floating point operations is proportional to n3n3.
The real analogue of this function is nag_lapack_dgeevx (f08nb).

Example

function nag_lapack_zgeevx_example
balanc = 'Balance';
jobvl = 'Vectors (left)';
jobvr = 'Vectors (right)';
sense = 'Both reciprocal condition numbers';
a = [ -3.97 - 5.04i,  -4.11 + 3.7i,  -0.34 + 1.01i,  1.29 - 0.86i;
      0.34 - 1.5i,  1.52 - 0.43i,  1.88 - 5.38i,  3.36 + 0.65i;
      3.31 - 3.85i,  2.5 + 3.45i,  0.88 - 1.08i,  0.64 - 1.48i;
      -1.1 + 0.82i,  1.81 - 1.59i,  3.25 + 1.33i,  1.57 - 3.44i];
[aOut, w, vl, vr, ilo, ihi, scale, abnrm, rconde, rcondv, info] = ...
    nag_lapack_zgeevx(balanc, jobvl, jobvr, sense, a)
 

aOut =

  -6.0004 - 6.9998i  -0.3656 + 0.3637i   0.4761 - 0.1946i  -0.7237 + 0.5589i
   0.0000 + 0.0000i  -5.0000 + 2.0060i   0.4981 - 0.5232i  -0.1637 + 0.2071i
   0.0000 + 0.0000i   0.0000 + 0.0000i   7.9982 - 0.9964i   0.8487 - 0.6651i
   0.0000 + 0.0000i   0.0000 + 0.0000i   0.0000 + 0.0000i   3.0023 - 3.9998i


w =

  -6.0004 - 6.9998i
  -5.0000 + 2.0060i
   7.9982 - 0.9964i
   3.0023 - 3.9998i


vl =

   0.8357 + 0.0000i  -0.3510 + 0.1013i  -0.1689 + 0.2595i   0.1099 - 0.2007i
  -0.0794 + 0.3372i  -0.4035 + 0.4540i   0.6762 + 0.0000i   0.0336 + 0.2312i
   0.0917 + 0.3097i   0.6239 + 0.0000i   0.3032 + 0.5642i   0.0944 - 0.3947i
   0.0456 - 0.2741i  -0.0816 - 0.3190i   0.1328 + 0.1376i   0.8534 + 0.0000i


vr =

   0.8457 + 0.0000i  -0.3865 + 0.1732i  -0.1730 + 0.2669i  -0.0356 - 0.1782i
  -0.0177 + 0.3036i  -0.3539 + 0.4529i   0.6924 + 0.0000i   0.1264 + 0.2666i
   0.0875 + 0.3115i   0.6124 + 0.0000i   0.3324 + 0.4960i   0.0129 - 0.2966i
  -0.0561 - 0.2906i  -0.0859 - 0.3284i   0.2504 - 0.0147i   0.8898 + 0.0000i


ilo =

                    1


ihi =

                    4


scale =

     1
     1
     1
     1


abnrm =

   14.4031


rconde =

    0.9932
    0.9964
    0.9814
    0.9779


rcondv =

    8.4011
    8.0214
    5.8292
    5.8292


info =

                    0


function f08np_example
balanc = 'Balance';
jobvl = 'Vectors (left)';
jobvr = 'Vectors (right)';
sense = 'Both reciprocal condition numbers';
a = [ -3.97 - 5.04i,  -4.11 + 3.7i,  -0.34 + 1.01i,  1.29 - 0.86i;
      0.34 - 1.5i,  1.52 - 0.43i,  1.88 - 5.38i,  3.36 + 0.65i;
      3.31 - 3.85i,  2.5 + 3.45i,  0.88 - 1.08i,  0.64 - 1.48i;
      -1.1 + 0.82i,  1.81 - 1.59i,  3.25 + 1.33i,  1.57 - 3.44i];
[aOut, w, vl, vr, ilo, ihi, scale, abnrm, rconde, rcondv, info] = ...
    f08np(balanc, jobvl, jobvr, sense, a)
 

aOut =

  -6.0004 - 6.9998i  -0.3656 + 0.3637i   0.4761 - 0.1946i  -0.7237 + 0.5589i
   0.0000 + 0.0000i  -5.0000 + 2.0060i   0.4981 - 0.5232i  -0.1637 + 0.2071i
   0.0000 + 0.0000i   0.0000 + 0.0000i   7.9982 - 0.9964i   0.8487 - 0.6651i
   0.0000 + 0.0000i   0.0000 + 0.0000i   0.0000 + 0.0000i   3.0023 - 3.9998i


w =

  -6.0004 - 6.9998i
  -5.0000 + 2.0060i
   7.9982 - 0.9964i
   3.0023 - 3.9998i


vl =

   0.8357 + 0.0000i  -0.3510 + 0.1013i  -0.1689 + 0.2595i   0.1099 - 0.2007i
  -0.0794 + 0.3372i  -0.4035 + 0.4540i   0.6762 + 0.0000i   0.0336 + 0.2312i
   0.0917 + 0.3097i   0.6239 + 0.0000i   0.3032 + 0.5642i   0.0944 - 0.3947i
   0.0456 - 0.2741i  -0.0816 - 0.3190i   0.1328 + 0.1376i   0.8534 + 0.0000i


vr =

   0.8457 + 0.0000i  -0.3865 + 0.1732i  -0.1730 + 0.2669i  -0.0356 - 0.1782i
  -0.0177 + 0.3036i  -0.3539 + 0.4529i   0.6924 + 0.0000i   0.1264 + 0.2666i
   0.0875 + 0.3115i   0.6124 + 0.0000i   0.3324 + 0.4960i   0.0129 - 0.2966i
  -0.0561 - 0.2906i  -0.0859 - 0.3284i   0.2504 - 0.0147i   0.8898 + 0.0000i


ilo =

                    1


ihi =

                    4


scale =

     1
     1
     1
     1


abnrm =

   14.4031


rconde =

    0.9932
    0.9964
    0.9814
    0.9779


rcondv =

    8.4011
    8.0214
    5.8292
    5.8292


info =

                    0



PDF version (NAG web site, 64-bit version, 64-bit version)
Chapter Contents
Chapter Introduction
NAG Toolbox

© The Numerical Algorithms Group Ltd, Oxford, UK. 2009–2013