NAG Library Routine Document
f08jvf (zstedc)
1
Purpose
f08jvf (zstedc) computes all the eigenvalues and, optionally, all the eigenvectors of a real by symmetric tridiagonal matrix, or of a complex full or banded Hermitian matrix which has been reduced to tridiagonal form.
2
Specification
Fortran Interface
Subroutine f08jvf ( |
compz, n, d, e, z, ldz, work, lwork, rwork, lrwork, iwork, liwork, info) |
Integer, Intent (In) | :: | n, ldz, lwork, lrwork, liwork | Integer, Intent (Out) | :: | iwork(max(1,liwork)), info | Real (Kind=nag_wp), Intent (Inout) | :: | d(*), e(*) | Real (Kind=nag_wp), Intent (Out) | :: | rwork(max(1,lrwork)) | Complex (Kind=nag_wp), Intent (Inout) | :: | z(ldz,*) | Complex (Kind=nag_wp), Intent (Out) | :: | work(max(1,lwork)) | Character (1), Intent (In) | :: | compz |
|
C Header Interface
#include <nagmk26.h>
void |
f08jvf_ (const char *compz, const Integer *n, double d[], double e[], Complex z[], const Integer *ldz, Complex work[], const Integer *lwork, double rwork[], const Integer *lrwork, Integer iwork[], const Integer *liwork, Integer *info, const Charlen length_compz) |
|
The routine may be called by its
LAPACK
name zstedc.
3
Description
f08jvf (zstedc) computes all the eigenvalues and, optionally, the eigenvectors of a real symmetric tridiagonal matrix
. That is, the routine computes the spectral factorization of
given by
where
is a diagonal matrix whose diagonal elements are the eigenvalues,
, of
and
is an orthogonal matrix whose columns are the eigenvectors,
, of
. Thus
The routine may also be used to compute all the eigenvalues and eigenvectors of a complex full, or banded, Hermitian matrix
which has been reduced to real tridiagonal form
as
where
is unitary. The spectral factorization of
is then given by
In this case
must be formed explicitly and passed to
f08jvf (zstedc) in the array
z, and the routine called with
. Routines which may be called to form
and
are
When only eigenvalues are required then this routine calls
f08jff (dsterf) to compute the eigenvalues of the tridiagonal matrix
, but when eigenvectors of
are also required and the matrix is not too small, then a divide and conquer method is used, which can be much faster than
f08jsf (zsteqr), although more storage is required.
4
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
5
Arguments
- 1: – Character(1)Input
-
On entry: indicates whether the eigenvectors are to be computed.
- Only the eigenvalues are computed (and the array z is not referenced).
- The eigenvalues and eigenvectors of are computed (and the array z must contain the matrix on entry).
- The eigenvalues and eigenvectors of are computed (and the array z is initialized by the routine).
Constraint:
, or .
- 2: – IntegerInput
-
On entry: , the order of the symmetric tridiagonal matrix .
Constraint:
.
- 3: – Real (Kind=nag_wp) arrayInput/Output
-
Note: the dimension of the array
d
must be at least
.
On entry: the diagonal elements of the tridiagonal matrix.
On exit: if , the eigenvalues in ascending order.
- 4: – Real (Kind=nag_wp) arrayInput/Output
-
Note: the dimension of the array
e
must be at least
.
On entry: the subdiagonal elements of the tridiagonal matrix.
On exit:
e is overwritten.
- 5: – Complex (Kind=nag_wp) arrayInput/Output
-
Note: the second dimension of the array
z
must be at least
if
or
, and at least
otherwise.
On entry: if
,
z must contain the unitary matrix
used in the reduction to tridiagonal form.
On exit: if
,
z contains the orthonormal eigenvectors of the original Hermitian matrix
, and if
,
z contains the orthonormal eigenvectors of the symmetric tridiagonal matrix
.
If
,
z is not referenced.
- 6: – IntegerInput
-
On entry: the first dimension of the array
z as declared in the (sub)program from which
f08jvf (zstedc) is called.
Constraints:
- if or , ;
- otherwise .
- 7: – Complex (Kind=nag_wp) arrayWorkspace
-
On exit: if
, the real part of
contains the minimum value of
lwork required for optimal performance.
- 8: – IntegerInput
-
On entry: the dimension of the array
work as declared in the (sub)program from which
f08jvf (zstedc) is called.
If
, a workspace query is assumed; the routine only calculates the optimal sizes of the
work,
rwork and
iwork arrays, returns these values as the first entries of the
work,
rwork and
iwork arrays, and no error message related to
lwork,
lrwork or
liwork is issued.
Constraints:
if
,
- if or or , ;
- if and , .
Note: that for
, then if
n is less than or equal to the minimum divide size, usually
,
lwork need only be
.
- 9: – Real (Kind=nag_wp) arrayWorkspace
-
On exit: if
,
returns the optimal
lrwork.
- 10: – IntegerInput
-
On entry: the dimension of the array
rwork as declared in the (sub)program from which
f08jvf (zstedc) is called.
If
, a workspace query is assumed; the routine only calculates the optimal sizes of the
work,
rwork and
iwork arrays, returns these values as the first entries of the
work,
rwork and
iwork arrays, and no error message related to
lwork,
lrwork or
liwork is issued.
Constraints:
if
,
- if or , ;
- if and , , where smallest integer such that ;
- if and , .
Note: that for
or
if
n is less than or equal to the minimum divide size, usually
, then
lrwork need only be
.
- 11: – Integer arrayWorkspace
-
On exit: if
,
returns the optimal
liwork.
- 12: – IntegerInput
-
On entry: the dimension of the array
iwork as declared in the (sub)program from which
f08jvf (zstedc) is called.
If
, a workspace query is assumed; the routine only calculates the optimal sizes of the
work,
rwork and
iwork arrays, returns these values as the first entries of the
work,
rwork and
iwork arrays, and no error message related to
lwork,
lrwork or
liwork is issued.
Constraints:
if
,
- if or , ;
- if and , ;
- if and , .
- 13: – IntegerOutput
On exit:
unless the routine detects an error (see
Section 6).
6
Error Indicators and Warnings
If , argument had an illegal value. An explanatory message is output, and execution of the program is terminated.
-
The algorithm failed to compute an eigenvalue while working on the submatrix lying in rows and columns through .
7
Accuracy
The computed eigenvalues and eigenvectors are exact for a nearby matrix
, where
and
is the
machine precision.
If
is an exact eigenvalue and
is the corresponding computed value, then
where
is a modestly increasing function of
.
If
is the corresponding exact eigenvector, and
is the corresponding computed eigenvector, then the angle
between them is bounded as follows:
Thus the accuracy of a computed eigenvector depends on the gap between its eigenvalue and all the other eigenvalues.
See Section 4.7 of
Anderson et al. (1999) for further details. See also
f08flf (ddisna).
8
Parallelism and Performance
f08jvf (zstedc) is threaded by NAG for parallel execution in multithreaded implementations of the NAG Library.
f08jvf (zstedc) makes calls to BLAS and/or LAPACK routines, which may be threaded within the vendor library used by this implementation. Consult the documentation for the vendor library for further information.
Please consult the
X06 Chapter Introduction for information on how to control and interrogate the OpenMP environment used within this routine. Please also consult the
Users' Note for your implementation for any additional implementation-specific information.
If only eigenvalues are required, the total number of floating-point operations is approximately proportional to
. When eigenvectors are required the number of operations is bounded above by approximately the same number of operations as
f08jsf (zsteqr), but for large matrices
f08jvf (zstedc) is usually much faster.
The real analogue of this routine is
f08jhf (dstedc).
10
Example
This example finds all the eigenvalues and eigenvectors of the Hermitian band matrix
is first reduced to tridiagonal form by a call to
f08hsf (zhbtrd).
10.1
Program Text
Program Text (f08jvfe.f90)
10.2
Program Data
Program Data (f08jvfe.d)
10.3
Program Results
Program Results (f08jvfe.r)