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_dgeev (f08na)

Purpose

nag_lapack_dgeev (f08na) computes the eigenvalues and, optionally, the left and/or right eigenvectors for an nn by nn real nonsymmetric matrix AA.

Syntax

[a, wr, wi, vl, vr, info] = f08na(jobvl, jobvr, a, 'n', n)
[a, wr, wi, vl, vr, info] = nag_lapack_dgeev(jobvl, jobvr, 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.
The matrix AA is first reduced to upper Hessenberg form by means of orthogonal similarity transformations, and the QRQR algorithm is then used to further reduce the matrix to upper quasi-triangular Schur form, TT, with 11 by 11 and 22 by 22 blocks on the main diagonal. The eigenvalues are computed from TT, the 22 by 22 blocks corresponding to complex conjugate pairs and, optionally, the eigenvectors of TT are computed and backtransformed to the eigenvectors 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:     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.
Constraint: jobvl = 'N'jobvl='N' or 'V''V'.
2:     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.
Constraint: jobvr = 'N'jobvr='N' or 'V''V'.
3:     a(lda, : :) – double 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

Output Parameters

1:     a(lda, : :) – double 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)
2:     wr( : :) – double array
3:     wi( : :) – double array
Note: the dimension of the arrays wr and wi must be at least max (1,n)max(1,n).
wr and wi contain the real and imaginary parts, respectively, of the computed eigenvalues. Complex conjugate pairs of eigenvalues appear consecutively with the eigenvalue having the positive imaginary part first.
4:     vl(ldvl, : :) – double 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. If the jjth eigenvalue is real, then uj = vl( : ,j)uj=vl:j, the jjth column of vl. If the jjth and (j + 1)(j+1)st eigenvalues form a complex conjugate pair, then uj = vl( : ,j) + i × vl( : ,j + 1)uj=vl:j+i×vl:j+1 and uj + 1 = vl( : ,j)i × vl( : ,j + 1)uj+1=vl:j-i×vl:j+1.
If jobvl = 'N'jobvl='N', vl is not referenced.
5:     vr(ldvr, : :) – double 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. If the jjth eigenvalue is real, then vj = vr( : ,j)vj=vr:j, the jjth column of vr. If the jjth and (j + 1)(j+1)st eigenvalues form a complex conjugate pair, then vj = vr( : ,j) + i × vr( : ,j + 1)vj=vr:j+i×vr:j+1 and vj + 1 = vr( : ,j)i × vr( : ,j + 1)vj+1=vr:j-i×vr:j+1.
If jobvr = 'N'jobvr='N', vr is not referenced.
6:     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: jobvl, 2: jobvr, 3: n, 4: a, 5: lda, 6: wr, 7: wi, 8: vl, 9: ldvl, 10: vr, 11: ldvr, 12: work, 13: lwork, 14: 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 have been computed; elements i + 1 : ni+1:n of wr and wi 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 complex analogue of this function is nag_lapack_zgeev (f08nn).

Example

function nag_lapack_dgeev_example
jobvl = 'No left vectors';
jobvr = 'Vectors (right)';
a = [0, 0.45, -0.14, -0.17;
     0, 0.07, -0.54, 0.35;
     0, -0.33, -0.03, 0.17;
     0.25, -0.32, -0.13, 0.11];
[aOut, wr, wi, vl, vr, info] = nag_lapack_dgeev(jobvl, jobvr, a)
 

aOut =

   -0.1280   -0.1651   -0.3690    0.2446
    0.6753   -0.1280   -0.1836   -0.1114
         0         0   -0.0509    0.1800
         0         0         0    0.4569


wr =

   -0.1280
   -0.1280
   -0.0509
    0.4569


wi =

    0.3339
   -0.3339
         0
         0


vl =

     0


vr =

   -0.2708    0.3271   -0.3282   -0.6887
    0.1909   -0.3732   -0.3848   -0.6091
    0.2941   -0.2549   -0.5282    0.3853
    0.7018         0   -0.6820   -0.0788


info =

                    0


function f08na_example
jobvl = 'No left vectors';
jobvr = 'Vectors (right)';
a = [0, 0.45, -0.14, -0.17;
     0, 0.07, -0.54, 0.35;
     0, -0.33, -0.03, 0.17;
     0.25, -0.32, -0.13, 0.11];
[aOut, wr, wi, vl, vr, info] = f08na(jobvl, jobvr, a)
 

aOut =

   -0.1280   -0.1651   -0.3690    0.2446
    0.6753   -0.1280   -0.1836   -0.1114
         0         0   -0.0509    0.1800
         0         0         0    0.4569


wr =

   -0.1280
   -0.1280
   -0.0509
    0.4569


wi =

    0.3339
   -0.3339
         0
         0


vl =

     0


vr =

   -0.2708    0.3271   -0.3282   -0.6887
    0.1909   -0.3732   -0.3848   -0.6091
    0.2941   -0.2549   -0.5282    0.3853
    0.7018         0   -0.6820   -0.0788


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