F08 Chapter Contents
F08 Chapter Introduction
NAG Library Manual

# NAG Library Routine DocumentF08JEF (DSTEQR)

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

F08JEF (DSTEQR) computes all the eigenvalues and, optionally, all the eigenvectors of a real symmetric tridiagonal matrix, or of a real symmetric matrix which has been reduced to tridiagonal form.

## 2  Specification

 SUBROUTINE F08JEF ( COMPZ, N, D, E, Z, LDZ, WORK, INFO)
 INTEGER N, LDZ, INFO REAL (KIND=nag_wp) D(*), E(*), Z(LDZ,*), WORK(*) CHARACTER(1) COMPZ
The routine may be called by its LAPACK name dsteqr.

## 3  Description

F08JEF (DSTEQR) computes all the eigenvalues and, optionally, all the eigenvectors of a real symmetric tridiagonal matrix T. In other words, it can compute the spectral factorization of T as
 T=ZΛZT,
where Λ is a diagonal matrix whose diagonal elements are the eigenvalues λi, and Z is the orthogonal matrix whose columns are the eigenvectors zi. Thus
 Tzi=λizi,  i=1,2,…,n.
The routine may also be used to compute all the eigenvalues and eigenvectors of a real symmetric matrix A which has been reduced to tridiagonal form T:
 A =QTQT, where ​Q​ is orthogonal =QZΛQZT.
In this case, the matrix Q must be formed explicitly and passed to F08JEF (DSTEQR), which must be called with COMPZ='V'. The routines which must be called to perform the reduction to tridiagonal form and form Q are:
 full matrix F08FEF (DSYTRD) and F08FFF (DORGTR) full matrix, packed storage F08GEF (DSPTRD) and F08GFF (DOPGTR) band matrix F08HEF (DSBTRD) with VECT='V'.
F08JEF (DSTEQR) uses the implicitly shifted QR algorithm, switching between the QR and QL variants in order to handle graded matrices effectively (see Greenbaum and Dongarra (1980)). The eigenvectors are normalized so that zi2=1, but are determined only to within a factor ±1.
If only the eigenvalues of T are required, it is more efficient to call F08JFF (DSTERF) instead. If T is positive definite, small eigenvalues can be computed more accurately by F08JGF (DPTEQR).