nag_dstein (f08jkc) (PDF version)
f08 Chapter Contents
f08 Chapter Introduction
NAG C Library Manual

NAG Library Function Document

nag_dstein (f08jkc)

+ Contents

    1  Purpose
    7  Accuracy
    9  Example

1  Purpose

nag_dstein (f08jkc) computes the eigenvectors of a real symmetric tridiagonal matrix corresponding to specified eigenvalues, by inverse iteration.

2  Specification

#include <nag.h>
#include <nagf08.h>
void  nag_dstein (Nag_OrderType order, Integer n, const double d[], const double e[], Integer m, const double w[], const Integer iblock[], const Integer isplit[], double z[], Integer pdz, Integer ifailv[], NagError *fail)

3  Description

nag_dstein (f08jkc) computes the eigenvectors of a real symmetric tridiagonal matrix T corresponding to specified eigenvalues, by inverse iteration (see Jessup and Ipsen (1992)). It is designed to be used in particular after the specified eigenvalues have been computed by nag_dstebz (f08jjc) with rank=Nag_ByBlock, but may also be used when the eigenvalues have been computed by other functions in Chapters f02 or f08.
If T has been formed by reduction of a full real symmetric matrix A to tridiagonal form, then eigenvectors of T may be transformed to eigenvectors of A by a call to nag_dormtr (f08fgc) or nag_dopmtr (f08ggc).
nag_dstebz (f08jjc) determines whether the matrix T splits into block diagonal form:
T = T1 T2 . . . Tp
and passes details of the block structure to this function in the arrays iblock and isplit. This function can then take advantage of the block structure by performing inverse iteration on each block Ti separately, which is more efficient than using the whole matrix.

4  References

Golub G H and Van Loan C F (1996) Matrix Computations (3rd Edition) Johns Hopkins University Press, Baltimore
Jessup E and Ipsen I C F (1992) Improving the accuracy of inverse iteration SIAM J. Sci. Statist. Comput. 13 550–572

5  Arguments

1:     orderNag_OrderTypeInput
On entry: the order argument specifies the two-dimensional storage scheme being used, i.e., row-major ordering or column-major ordering. C language defined storage is specified by order=Nag_RowMajor. See Section 3.2.1.3 in the Essential Introduction for a more detailed explanation of the use of this argument.
Constraint: order=Nag_RowMajor or Nag_ColMajor.
2:     nIntegerInput
On entry: n, the order of the matrix T.
Constraint: n0.
3:     d[dim]const doubleInput
Note: the dimension, dim, of the array d must be at least max1,n.
On entry: the diagonal elements of the tridiagonal matrix T.
4:     e[dim]const doubleInput
Note: the dimension, dim, of the array e must be at least max1,n-1.
On entry: the off-diagonal elements of the tridiagonal matrix T.
5:     mIntegerInput
On entry: m, the number of eigenvectors to be returned.
Constraint: 0mn.
6:     w[dim]const doubleInput
Note: the dimension, dim, of the array w must be at least max1,n.
On entry: the eigenvalues of the tridiagonal matrix T stored in w[0] to w[m-1], as returned by nag_dstebz (f08jjc) with rank=Nag_ByBlock. Eigenvalues associated with the first sub-matrix must be supplied first, in nondecreasing order; then those associated with the second sub-matrix, again in nondecreasing order; and so on.
Constraint: if iblock[i]=iblock[i+1], w[i]w[i+1], for i=0,1,,m-2.
7:     iblock[dim]const IntegerInput
Note: the dimension, dim, of the array iblock must be at least max1,n.
On entry: the first m elements must contain the sub-matrix indices associated with the specified eigenvalues, as returned by nag_dstebz (f08jjc) with rank=Nag_ByBlock. If the eigenvalues were not computed by nag_dstebz (f08jjc) with rank=Nag_ByBlock, set iblock[i-1] to 1, for i=1,2,,m.
Constraint: iblock[i]iblock[i+1], for i=0,1,,m-2.
8:     isplit[dim]const IntegerInput
Note: the dimension, dim, of the array isplit must be at least max1,n.
On entry: the points at which T breaks up into sub-matrices, as returned by nag_dstebz (f08jjc) with rank=Nag_ByBlock. If the eigenvalues were not computed by nag_dstebz (f08jjc) with rank=Nag_ByBlock, set isplit[0] to n.
9:     z[dim]doubleOutput
Note: the dimension, dim, of the array z must be at least
  • max1,pdz×m when order=Nag_ColMajor;
  • max1,n×pdz when order=Nag_RowMajor.
The i,jth element of the matrix Z is stored in
  • z[j-1×pdz+i-1] when order=Nag_ColMajor;
  • z[i-1×pdz+j-1] when order=Nag_RowMajor.
On exit: the m eigenvectors, stored as columns of Z; the ith column corresponds to the ith specified eigenvalue, unless fail.code= NE_CONVERGENCE (in which case see Section 6).
10:   pdzIntegerInput
On entry: the stride separating row or column elements (depending on the value of order) in the array z.
Constraints:
  • if order=Nag_ColMajor, pdz max1,n ;
  • if order=Nag_RowMajor, pdzmax1,m.
11:   ifailv[m]IntegerOutput
On exit: if fail.errnum=i>0, the first i elements of ifailv contain the indices of any eigenvectors which have failed to converge. The rest of the first m elements of ifailv are set to 0.
12:   failNagError *Input/Output
The NAG error argument (see Section 3.6 in the Essential Introduction).

6  Error Indicators and Warnings

NE_ALLOC_FAIL
Dynamic memory allocation failed.
NE_BAD_PARAM
On entry, argument value had an illegal value.
NE_CONSTRAINT
On entry, m=value, iblock[i]iblock[i+1]=value and w[i]w[i+1]=value.
Constraint: , for i=0,1,,m-2
NE_CONVERGENCE
value eigenvectors (as indicated by argument ifailv) each failed to converge in five iterations. The current iterate after five iterations is stored in the corresponding column of z.
NE_INT
On entry, n=value.
Constraint: n0.
On entry, pdz=value.
Constraint: pdz>0.
NE_INT_2
On entry, m=value and n=value.
Constraint: 0mn.
On entry, pdz=value and m=value.
Constraint: pdzmax1,m.
On entry, pdz=value and n=value.
Constraint: pdz max1,n .
NE_INT_ARRAY
On entry, m=value and iblock[i]iblock[i+1]=value.
Constraint: iblock[i]iblock[i+1], for i=0,1,,m-2
NE_INTERNAL_ERROR
An internal error has occurred in this function. Check the function call and any array sizes. If the call is correct then please contact NAG for assistance.

7  Accuracy

Each computed eigenvector zi is the exact eigenvector of a nearby matrix A+Ei, such that
Ei = Oε A ,
where ε is the machine precision. Hence the residual is small:
A zi - λi zi = Oε A .
However, a set of eigenvectors computed by this function may not be orthogonal to so high a degree of accuracy as those computed by nag_dsteqr (f08jec).

8  Further Comments

The complex analogue of this function is nag_zstein (f08jxc).

9  Example

See Section 9 in nag_dormtr (f08fgc).

nag_dstein (f08jkc) (PDF version)
f08 Chapter Contents
f08 Chapter Introduction
NAG C Library Manual

© The Numerical Algorithms Group Ltd, Oxford, UK. 2012