F08 Chapter Contents
F08 Chapter Introduction
NAG Library Manual

# NAG Library Routine DocumentF08JFF (DSTERF)

Note:  before using this routine, please read the Users' Note for your implementation to check the interpretation of bold italicised terms and other implementation-dependent details.

## 1  Purpose

F08JFF (DSTERF) computes all the eigenvalues of a real symmetric tridiagonal matrix.

## 2  Specification

 SUBROUTINE F08JFF ( N, D, E, INFO)
 INTEGER N, INFO REAL (KIND=nag_wp) D(*), E(*)
The routine may be called by its LAPACK name dsterf.

## 3  Description

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

## 4  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

## 5  Parameters

1:     N – INTEGERInput
On entry: $n$, the order of the matrix $T$.
Constraint: ${\mathbf{N}}\ge 0$.
2:     D($*$) – REAL (KIND=nag_wp) arrayInput/Output
Note: the dimension of the array D must be at least $\mathrm{max}\phantom{\rule{0.125em}{0ex}}\left(1,{\mathbf{N}}\right)$.
On entry: the diagonal elements of the tridiagonal matrix $T$.
On exit: the $n$ eigenvalues in ascending order, unless ${\mathbf{INFO}}>{\mathbf{0}}$ (in which case see Section 6).
3:     E($*$) – REAL (KIND=nag_wp) arrayInput/Output
Note: the dimension of the array E must be at least $\mathrm{max}\phantom{\rule{0.125em}{0ex}}\left(1,{\mathbf{N}}-1\right)$.
On entry: the off-diagonal elements of the tridiagonal matrix $T$.
On exit: E is overwritten.
4:     INFO – INTEGEROutput
On exit: ${\mathbf{INFO}}=0$ unless the routine detects an error (see Section 6).

## 6  Error Indicators and Warnings

${\mathbf{INFO}}<0$
If ${\mathbf{INFO}}=-i$, argument $i$ had an illegal value. An explanatory message is output, and execution of the program is terminated.
${\mathbf{INFO}}>0$
The algorithm has failed to find all the eigenvalues after a total of $30×{\mathbf{N}}$ iterations. If ${\mathbf{INFO}}=i$, then on exit $i$ elements of E have not converged to zero.

## 7  Accuracy

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

The total number of floating point operations is typically about $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 routine.

## 9  Example

This example computes all the eigenvalues of the symmetric tridiagonal matrix $T$, where
 $T = -6.99 -0.44 0.00 0.00 -0.44 7.92 -2.63 0.00 0.00 -2.63 2.34 -1.18 0.00 0.00 -1.18 0.32 .$

### 9.1  Program Text

Program Text (f08jffe.f90)

### 9.2  Program Data

Program Data (f08jffe.d)

### 9.3  Program Results

Program Results (f08jffe.r)