Integer type:  int32  int64  nag_int  show int32  show int32  show int64  show int64  show nag_int  show nag_int

Chapter Contents
Chapter Introduction
NAG Toolbox

# NAG Toolbox: nag_lapack_dsterf (f08jf)

## Purpose

nag_lapack_dsterf (f08jf) computes all the eigenvalues of a real symmetric tridiagonal matrix.

## Syntax

[d, e, info] = f08jf(d, e, 'n', n)
[d, e, info] = nag_lapack_dsterf(d, e, 'n', n)

## Description

nag_lapack_dsterf (f08jf) computes all the eigenvalues of a real symmetric tridiagonal matrix, using a square-root-free variant of the QR$QR$ algorithm.
The function uses an explicit shift, and, like nag_lapack_dsteqr (f08je), switches between the QR$QR$ and QL$QL$ variants in order to handle graded matrices effectively (see Greenbaum and Dongarra (1980)).

## References

Greenbaum A and Dongarra J J (1980) Experiments with QR/QL methods for the symmetric triangular eigenproblem LAPACK Working Note No. 17 (Technical Report CS-89-92) University of Tennessee, Knoxville
Parlett B N (1998) The Symmetric Eigenvalue Problem SIAM, Philadelphia

## Parameters

### Compulsory Input Parameters

1:     d( : $:$) – double array
Note: the dimension of the array d must be at least max (1,n)$\mathrm{max}\phantom{\rule{0.125em}{0ex}}\left(1,{\mathbf{n}}\right)$.
The diagonal elements of the tridiagonal matrix T$T$.
2:     e( : $:$) – double array
Note: the dimension of the array e must be at least max (1,n1)$\mathrm{max}\phantom{\rule{0.125em}{0ex}}\left(1,{\mathbf{n}}-1\right)$.
The off-diagonal elements of the tridiagonal matrix T$T$.

### 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.)
n$n$, the order of the matrix T$T$.
Constraint: n0${\mathbf{n}}\ge 0$.

None.

### Output Parameters

1:     d( : $:$) – double array
Note: the dimension of the array d must be at least max (1,n)$\mathrm{max}\phantom{\rule{0.125em}{0ex}}\left(1,{\mathbf{n}}\right)$.
The n$n$ eigenvalues in ascending order, unless ${\mathbf{INFO}}>{\mathbf{0}}$ (in which case see Section [Error Indicators and Warnings]).
2:     e( : $:$) – double array
Note: the dimension of the array e must be at least max (1,n1)$\mathrm{max}\phantom{\rule{0.125em}{0ex}}\left(1,{\mathbf{n}}-1\right)$.
3:     info – int64int32nag_int scalar
info = 0${\mathbf{info}}=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 = i${\mathbf{info}}=-i$
If info = i${\mathbf{info}}=-i$, parameter i$i$ had an illegal value on entry. The parameters are numbered as follows:
1: n, 2: d, 3: e, 4: info.
W INFO > 0${\mathbf{INFO}}>0$
The algorithm has failed to find all the eigenvalues after a total of 30 × n$30×{\mathbf{n}}$ iterations. If info = i${\mathbf{info}}=i$, then on exit i$i$ elements of e have not converged to zero.

## Accuracy

The computed eigenvalues are exact for a nearby matrix (T + E)$\left(T+E\right)$, where
 ‖E‖2 = O(ε) ‖T‖2 , $‖E‖2 = O(ε) ‖T‖2 ,$
and ε$\epsilon$ is the machine precision.
If λi${\lambda }_{i}$ is an exact eigenvalue and λ̃i${\stackrel{~}{\lambda }}_{i}$ is the corresponding computed value, then
 |λ̃i − λi| ≤ c (n) ε ‖T‖2 , $| λ~i - λi | ≤ c (n) ε ‖T‖2 ,$
where c(n)$c\left(n\right)$ is a modestly increasing function of n$n$.

The total number of floating point operations is typically about 14n2$14{n}^{2}$, but depends on how rapidly the algorithm converges. The operations are all performed in scalar mode.
There is no complex analogue of this function.

## Example

```function nag_lapack_dsterf_example
d = [-6.99;
7.92;
2.34;
0.32];
e = [-0.44;
-2.63;
-1.18];
[dOut, eOut, info] = nag_lapack_dsterf(d, e)
```
```

dOut =

-7.0037
-0.4059
2.0028
8.9968

eOut =

0
0
0

info =

0

```
```function f08jf_example
d = [-6.99;
7.92;
2.34;
0.32];
e = [-0.44;
-2.63;
-1.18];
[dOut, eOut, info] = f08jf(d, e)
```
```

dOut =

-7.0037
-0.4059
2.0028
8.9968

eOut =

0
0
0

info =

0

```