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_dstevd (f08jc)

Purpose

nag_lapack_dstevd (f08jc) computes all the eigenvalues and, optionally, all the eigenvectors of a real symmetric tridiagonal matrix. If the eigenvectors are requested, then it uses a divide-and-conquer algorithm to compute eigenvalues and eigenvectors. However, if only eigenvalues are required, then it uses the Pal–Walker–Kahan variant of the QLQL or QRQR algorithm.

Syntax

[d, e, z, info] = f08jc(job, d, e, 'n', n)
[d, e, z, info] = nag_lapack_dstevd(job, d, e, 'n', n)

Description

nag_lapack_dstevd (f08jc) computes all the eigenvalues and, optionally, all the eigenvectors of a real symmetric tridiagonal matrix TT. In other words, it can compute the spectral factorization of TT as
T = ZΛZT,
T=ZΛZT,
where ΛΛ is a diagonal matrix whose diagonal elements are the eigenvalues λiλi, and ZZ is the orthogonal matrix whose columns are the eigenvectors zizi. Thus
Tzi = λizi,  i = 1,2,,n.
Tzi=λizi,  i=1,2,,n.

References

Golub G H and Van Loan C F (1996) Matrix Computations (3rd Edition) Johns Hopkins University Press, Baltimore

Parameters

Compulsory Input Parameters

1:     job – string (length ≥ 1)
Indicates whether eigenvectors are computed.
job = 'N'job='N'
Only eigenvalues are computed.
job = 'V'job='V'
Eigenvalues and eigenvectors are computed.
Constraint: job = 'N'job='N' or 'V''V'.
2:     d( : :) – double array
Note: the dimension of the array d must be at least max (1,n)max(1,n).
The nn diagonal elements of the tridiagonal matrix TT.
3:     e( : :) – double array
Note: the dimension of the array e must be at least max (1,n)max(1,n).
The n1n-1 off-diagonal elements of the tridiagonal matrix TT. The nnth element of this array is used as workspace.

Optional Input Parameters

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

Input Parameters Omitted from the MATLAB Interface

ldz work lwork iwork liwork

Output Parameters

1:     d( : :) – double array
Note: the dimension of the array d must be at least max (1,n)max(1,n).
The eigenvalues of the matrix TT in ascending order.
2:     e( : :) – double array
Note: the dimension of the array e must be at least max (1,n)max(1,n).
e is overwritten with intermediate results.
3:     z(ldz, : :) – double array
The first dimension, ldz, of the array z will be
  • if job = 'V'job='V', ldz max (1,n) ldz max(1,n) ;
  • if job = 'N'job='N', ldz1ldz1.
The second dimension of the array will be max (1,n)max(1,n) if job = 'V'job='V' and at least 11 if job = 'N'job='N'
If job = 'V'job='V', z stores the orthogonal matrix ZZ which contains the eigenvectors of TT.
If job = 'N'job='N', z is not referenced.
4:     info – int64int32nag_int scalar
info = 0info=0 unless the function detects an error (see Section [Error Indicators and Warnings]).

Error Indicators and Warnings

  info = iinfo=-i
If info = iinfo=-i, parameter ii had an illegal value on entry. The parameters are numbered as follows:
1: job, 2: n, 3: d, 4: e, 5: z, 6: ldz, 7: work, 8: lwork, 9: iwork, 10: liwork, 11: 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.
  INFO > 0INFO>0
if info = iinfo=i and job = 'N'job='N', the algorithm failed to converge; ii elements of an intermediate tridiagonal form did not converge to zero; if info = iinfo=i and job = 'V'job='V', then the algorithm failed to compute an eigenvalue while working on the submatrix lying in rows and column i / (n + 1)i/(n+1) through i  mod  (n + 1)i mod (n+1).

Accuracy

The computed eigenvalues and eigenvectors are exact for a nearby matrix (T + E)(T+E), where
E2 = O(ε) T2 ,
E2 = O(ε) T2 ,
and εε is the machine precision.
If λiλi is an exact eigenvalue and λ̃iλ~i is the corresponding computed value, then
|λ̃iλi| c (n) ε T2 ,
| λ~i - λi | c (n) ε T2 ,
where c(n)c(n) is a modestly increasing function of nn.
If zizi is the corresponding exact eigenvector, and iz~i is the corresponding computed eigenvector, then the angle θ(i,zi)θ(z~i,zi) between them is bounded as follows:
θ (i,zi) ( c (n) ε T2 )/( minij  |λiλj| ) .
θ (z~i,zi) c (n) ε T2 min ij | λi - λj | .
Thus the accuracy of a computed eigenvector depends on the gap between its eigenvalue and all the other eigenvalues.

Further Comments

There is no complex analogue of this function.

Example

function nag_lapack_dstevd_example
job = 'V';
d = [1;
     4;
     9;
     16];
e = [1;
     2;
     3;
     0];
[dOut, eOut, z, info] = nag_lapack_dstevd(job, d, e)
 

dOut =

    0.6476
    3.5470
    8.6578
   17.1477


eOut =

     0
     0
     0
     0


z =

    0.9396    0.3388   -0.0494    0.0034
   -0.3311    0.8628   -0.3781    0.0545
    0.0853   -0.3648   -0.8558    0.3568
   -0.0167    0.0879    0.3497    0.9326


info =

                    0


function f08jc_example
job = 'V';
d = [1;
     4;
     9;
     16];
e = [1;
     2;
     3;
     0];
[dOut, eOut, z, info] = f08jc(job, d, e)
 

dOut =

    0.6476
    3.5470
    8.6578
   17.1477


eOut =

     0
     0
     0
     0


z =

    0.9396    0.3388   -0.0494    0.0034
   -0.3311    0.8628   -0.3781    0.0545
    0.0853   -0.3648   -0.8558    0.3568
   -0.0167    0.0879    0.3497    0.9326


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