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 Chapter IntroductionF08 — Least Squares and Eigenvalue Problems (LAPACK)

Scope of the Chapter

This chapter provides functions for the solution of linear least squares problems, eigenvalue problems and singular value problems, as well as associated computations. It provides functions for:
• – solution of linear least squares problems
• – solution of symmetric eigenvalue problems
• – solution of nonsymmetric eigenvalue problems
• – solution of singular value problems
• – solution of generalized symmetric-definite eigenvalue problems
• – solution of generalized nonsymmetric eigenvalue problems
• – solution of generalized singular value problems
• – solution of generalized linear least squares problems
• – matrix factorizations associated with the above problems
• – estimating condition numbers of eigenvalue and eigenvector problems
• – estimating the numerical rank of a matrix
• – solution of the Sylvester matrix equation
Functions are provided for both real and complex data.
For a general introduction to the solution of linear least squares problems, you should turn first to Chapter F04. The decision trees, at the end of Chapter F04, direct you to the most appropriate functions in Chapters F04 or F08. Chapters F04 and F08 contain Black Box (or driver) functions which enable standard linear least squares problems to be solved by a call to a single function.
For a general introduction to eigenvalue and singular value problems, you should turn first to Chapter F02. The decision trees, at the end of Chapter F02, direct you to the most appropriate functions in Chapters F02 or F08. Chapters F02 and F08 contain Black Box (or driver) functions which enable standard types of problem to be solved by a call to a single function. Often functions in Chapter F02 call Chapter F08 functions to perform the necessary computational tasks.
The functions in this chapter (Chapter F08) handle only dense, band, tridiagonal and Hessenberg matrices (not matrices with more specialised structures, or general sparse matrices). The tables in Section [Recommendations on Choice and Use of Available Functions] and the decision trees in Section [Decision Trees] direct you to the most appropriate functions in Chapter F08.
The functions in this chapter have all been derived from the LAPACK project (see Anderson et al. (1999)). They have been designed to be efficient on a wide range of high-performance computers, without compromising efficiency on conventional serial machines.
It is not expected that you will need to read all of the following sections, but rather you will pick out those sections relevant to your particular problem.

Background to the Problems

This section is only a brief introduction to the numerical solution of linear least squares problems, eigenvalue and singular value problems. Consult a standard textbook for a more thorough discussion, for example Golub and Van Loan (1996).

Linear Least Squares Problems

The linear least squares problem is
 minimize ‖b − Ax‖2, x
$minimize x ‖b-Ax‖2,$
(1)
where A$A$ is an m$m$ by n$n$ matrix, b$b$ is a given m$m$ element vector and x$x$ is an n$n$-element solution vector.
In the most usual case mn$m\ge n$ and rank(A) = n$\mathrm{rank}\left(A\right)=n$, so that A$A$ has full rank and in this case the solution to problem (1) is unique; the problem is also referred to as finding a least squares solution to an overdetermined system of linear equations.
When m < n$m and rank(A) = m$\mathrm{rank}\left(A\right)=m$, there are an infinite number of solutions x$x$ which exactly satisfy bAx = 0$b-Ax=0$. In this case it is often useful to find the unique solution x$x$ which minimizes x2${‖x‖}_{2}$, and the problem is referred to as finding a minimum norm solution to an underdetermined system of linear equations.
In the general case when we may have rank(A) < min (m,n)$\mathrm{rank}\left(A\right)<\mathrm{min}\phantom{\rule{0.125em}{0ex}}\left(m,n\right)$ – in other words, A$A$ may be rank-deficient – we seek the minimum norm least squares solution x$x$ which minimizes both x2${‖x‖}_{2}$ and bAx2${‖b-Ax‖}_{2}$.
This chapter (Chapter F08) contains driver functions to solve these problems with a single call, as well as computational functions that can be combined with functions in Chapter F07 to solve these linear least squares problems. Chapter F04 also contains Black Box functions to solve these linear least squares problems in standard cases. The next two sections discuss the factorizations that can be used in the solution of linear least squares problems.

Orthogonal Factorizations and Least Squares Problems

A number of functions are provided for factorizing a general rectangular m$m$ by n$n$ matrix A$A$, as the product of an orthogonal matrix (unitary if complex) and a triangular (or possibly trapezoidal) matrix.
A real matrix Q$Q$ is orthogonal if QTQ = I${Q}^{\mathrm{T}}Q=I$; a complex matrix Q$Q$ is unitary if QHQ = I${Q}^{\mathrm{H}}Q=I$. Orthogonal or unitary matrices have the important property that they leave the 2$2$-norm of a vector invariant, so that
 ‖x‖2 = ‖Qx‖2, $‖x‖2 =‖Qx‖2,$
if Q$Q$ is orthogonal or unitary. They usually help to maintain numerical stability because they do not amplify rounding errors.
Orthogonal factorizations are used in the solution of linear least squares problems. They may also be used to perform preliminary steps in the solution of eigenvalue or singular value problems, and are useful tools in the solution of a number of other problems.

QR factorization

The most common, and best known, of the factorizations is the QR$QR$ factorization given by
A = Q
 ( R ) 0
,   if ​mn,
$A =Q R 0 , if ​m≥n,$
where R$R$ is an n$n$ by n$n$ upper triangular matrix and Q$Q$ is an m$m$ by m$m$ orthogonal (or unitary) matrix. If A$A$ is of full rank n$n$, then R$R$ is nonsingular. It is sometimes convenient to write the factorization as
A = (Q1Q2)
 ( R ) 0
$A =(Q1Q2) R 0$
which reduces to
 A = Q1R, $A =Q1R,$
where Q1${Q}_{1}$ consists of the first n$n$ columns of Q$Q$, and Q2${Q}_{2}$ the remaining mn$m-n$ columns.
If m < n$m, R$R$ is trapezoidal, and the factorization can be written
 A = Q (R1R2) ,   if ​m < n, $A =Q (R1R2) , if ​m
where R1${R}_{1}$ is upper triangular and R2${R}_{2}$ is rectangular.
The QR$QR$ factorization can be used to solve the linear least squares problem (1) when mn$m\ge n$ and A$A$ is of full rank, since
‖b − Ax‖2 = ‖QTb − QTAx‖2 =
 ‖ (c1 − Rx) c2 ‖
2,
$‖ b-Ax ‖2=‖ QTb-QTAx ‖2=‖ c1-Rx c2 ‖2,$
where
c ≡ (c1) c2 =
 Q1T b Q2T b
= QTb;
$c≡ c1 c2 = Q1T b Q2T b =QTb;$
and c1${c}_{1}$ is an n$n$-element vector. Then x$x$ is the solution of the upper triangular system
 Rx = c1. $Rx=c1.$
The residual vector r$r$ is given by
r = bAx = Q
 ( 0 ) c2
.
$r =b-Ax=Q 0 c2 .$
The residual sum of squares r22${{‖r‖}_{2}}^{2}$ may be computed without forming r$r$ explicitly, since
 ‖r‖2 = ‖b − Ax‖2 = ‖c2‖2. $‖r‖2 =‖b-Ax‖2=‖c2‖2.$

LQ factorization

The LQ$LQ$ factorization is given by
A = (L0) Q = (L0)
 ( Q1 ) Q2
= LQ1,   if ​mn,
$A =(L 0) Q=(L 0) Q1 Q2 =LQ1, if ​m≤n,$
where L$L$ is m$m$ by m$m$ lower triangular, Q$Q$ is n$n$ by n$n$ orthogonal (or unitary), Q1${Q}_{1}$ consists of the first m$m$ rows of Q$Q$, and Q2${Q}_{2}$ the remaining nm$n-m$ rows.
The LQ$LQ$ factorization of A$A$ is essentially the same as the QR$QR$ factorization of AT${A}^{\mathrm{T}}$ (AH${A}^{\mathrm{H}}$ if A$A$ is complex), since
A = (L0) QAT = QT
 ( LT ) 0
.
$A =(L 0) Q⇔AT=QT LT 0 .$
The LQ$LQ$ factorization may be used to find a minimum norm solution of an underdetermined system of linear equations Ax = b$Ax=b$ where A$A$ is m$m$ by n$n$ with m < n$m and has rank m$m$. The solution is given by
x = QT
 ( L − 1b ) 0
.
$x =QT L-1b 0 .$

QR factorization with column pivoting

To solve a linear least squares problem (1) when A$A$ is not of full rank, or the rank of A$A$ is in doubt, we can perform either a QR$QR$ factorization with column pivoting or a singular value decomposition.
The QR$QR$ factorization with column pivoting is given by
A = Q
 ( R ) 0
PT,  mn,
$A =Q R 0 PT, m≥n,$
where Q$Q$ and R$R$ are as before and P$P$ is a (real) permutation matrix, chosen (in general) so that
 |r11| ≥ |r22| ≥ ⋯ ≥ |rnn| $|r11|≥|r22|≥⋯≥|rnn|$
and moreover, for each k$k$,
 |rkk| ≥ ‖Rk : j,j‖2,  j = k + 1, … ,n. $|rkk|≥‖Rk:j,j‖2, j=k+1,…,n.$
If we put
R =
 ( R11 R12 ) 0 R22
$R = R11 R12 0 R22$
where R11${R}_{11}$ is the leading k$k$ by k$k$ upper triangular sub-matrix of R$R$ then, in exact arithmetic, if rank(A) = k$\mathrm{rank}\left(A\right)=k$, the whole of the sub-matrix R22${R}_{22}$ in rows and columns k + 1$k+1$ to n$n$ would be zero. In numerical computation, the aim must be to determine an index k$k$, such that the leading sub-matrix R11${R}_{11}$ is well-conditioned, and R22${R}_{22}$ is negligible, so that
R =
 ( R11 R12 ) 0 R22
 ( R11 R12 ) 0 0
.
$R = R11 R12 0 R22 ≃ R11 R12 0 0 .$
Then k$k$ is the effective rank of A$A$. See Golub and Van Loan (1996) for a further discussion of numerical rank determination.
The so-called basic solution to the linear least squares problem (1) can be obtained from this factorization as
x = P
 ( R11 − 1ĉ1 ) 0
,
$x =P R11-1c^1 0 ,$
where 1${\stackrel{^}{c}}_{1}$ consists of just the first k$k$ elements of c = QTb$c={Q}^{\mathrm{T}}b$.

Complete orthogonal factorization

The Q R $QR$ factorization with column pivoting does not enable us to compute a minimum norm solution to a rank-deficient linear least squares problem, unless R12 = 0 ${R}_{12}=0$. However, by applying for further orthogonal (or unitary) transformations from the right to the upper trapezoidal matrix
 ( R11 R12 )
$\left(\begin{array}{cc}{R}_{11}& {R}_{12}\end{array}\right)$, R12 ${R}_{12}$ can be eliminated:
 ( R11 R12 )
Z =
 ( T11 0 )
.
$R11 R12 Z = T11 0 .$
This gives the complete orthogonal factorization
AP = Q
 ( T11 0 ) 0 0
ZT
$AP = Q T11 0 0 0 ZT$
from which the minimum norm solution can be obtained as
x = P Z
 ( T11 − 1 ĉ1 ) 0
.
$x = P Z T11-1 c^1 0 .$

Other factorizations

The QL$QL$ and RQ$RQ$ factorizations are given by
A = Q
 ( 0 ) L
,  if ​ m n ,
$A = Q 0 L , if ​ m ≥ n ,$
and
A =
 ( 0 R )
Q ,  if ​ m n .
$A = 0 R Q , if ​ m ≤ n .$
The factorizations are less commonly used than either the QR$QR$ or LQ$LQ$ factorizations described above, but have applications in, for example, the computation of generalized QR$QR$ factorizations.

The Singular Value Decomposition

The singular value decomposition (SVD) of an m$m$ by n$n$ matrix A$A$ is given by
 A = UΣVT,  (A = UΣVHin the complex case) $A =UΣVT, (A=UΣVHin the complex case)$
where U$U$ and V$V$ are orthogonal (unitary) and Σ$\Sigma$ is an m$m$ by n$n$ diagonal matrix with real diagonal elements, σi${\sigma }_{i}$, such that
 σ1 ≥ σ2 ≥ ⋯ ≥ σmin (m,n) ≥ 0. $σ1≥σ2≥⋯≥σmin(m,n)≥0.$
The σi${\sigma }_{i}$ are the singular values of A$A$ and the first min (m,n)$\mathrm{min}\phantom{\rule{0.125em}{0ex}}\left(m,n\right)$ columns of U$U$ and V$V$ are the left and right singular vectors of A$A$. The singular values and singular vectors satisfy
 Avi = σiui  and  ATui = σivi (or ​AHui = σivi) $Avi=σiui and ATui=σivi (or ​AHui=σivi)$
where ui${u}_{i}$ and vi${v}_{i}$ are the i$i$th columns of U$U$ and V$V$ respectively.
The computation proceeds in the following stages.
1. The matrix A$A$ is reduced to bidiagonal form A = U1BV1T$A={U}_{1}B{V}_{1}^{\mathrm{T}}$ if A$A$ is real (A = U1BV1H$A={U}_{1}B{V}_{1}^{\mathrm{H}}$ if A$A$ is complex), where U1${U}_{1}$ and V1${V}_{1}$ are orthogonal (unitary if A$A$ is complex), and B$B$ is real and upper bidiagonal when mn$m\ge n$ and lower bidiagonal when m < n$m, so that B$B$ is nonzero only on the main diagonal and either on the first superdiagonal (if mn$m\ge n$) or the first subdiagonal (if m < n$m).
2. The SVD of the bidiagonal matrix B$B$ is computed as B = U2Σ V2T $B={U}_{2}\Sigma {V}_{2}^{\mathrm{T}}$, where U2${U}_{2}$ and V2${V}_{2}$ are orthogonal and Σ$\Sigma$ is diagonal as described above. The singular vectors of A$A$ are then U = U1U2$U={U}_{1}{U}_{2}$ and V = V1V2$V={V}_{1}{V}_{2}$.
If mn$m\gg n$, it may be more efficient to first perform a QR$QR$ factorization of A$A$, and then compute the SVD of the n$n$ by n$n$ matrix R$R$, since if A = QR$A=QR$ and R = UΣVT$R=U\Sigma {V}^{\mathrm{T}}$, then the SVD of A$A$ is given by A = (QU)ΣVT$A=\left(QU\right)\Sigma {V}^{\mathrm{T}}$.
Similarly, if mn$m\ll n$, it may be more efficient to first perform an LQ$LQ$ factorization of A$A$.
This chapter supports two primary algorithms for computing the SVD of a bidiagonal matrix. They are:
 (i) the divide and conquer algorithm; (ii) the QR$QR$ algorithm.
The divide and conquer algorithm is much faster than the QR$QR$ algorithm if singular vectors of large matrices are required.

The Singular Value Decomposition and Least Squares Problems

The SVD may be used to find a minimum norm solution to a (possibly) rank-deficient linear least squares problem (1). The effective rank, k$k$, of A$A$ can be determined as the number of singular values which exceed a suitable threshold. Let Σ̂$\stackrel{^}{\Sigma }$ be the leading k$k$ by k$k$ sub-matrix of Σ$\Sigma$, and $\stackrel{^}{V}$ be the matrix consisting of the first k$k$ columns of V$V$. Then the solution is given by
 x = V̂Σ̂ − 1ĉ1, $x =V^Σ^-1c^1,$
where 1${\stackrel{^}{c}}_{1}$ consists of the first k$k$ elements of c = UTb = U2T U1T b$c={U}^{\mathrm{T}}b={U}_{2}^{\mathrm{T}}{U}_{1}^{\mathrm{T}}b$.

Generalized Linear Least Squares Problems

The simple type of linear least squares problem described in Section [Linear Least Squares Problems] can be generalized in various ways.
1. Linear least squares problems with equality constraints:
 find ​x​ to minimize ​S = ‖c − Ax‖22  subject to  Bx = d, $find ​x​ to minimize ​S=‖c-Ax‖22 subject to Bx=d,$
where A$A$ is m$m$ by n$n$ and B$B$ is p$p$ by n$n$, with pnm + p$p\le n\le m+p$. The equations Bx = d$Bx=d$ may be regarded as a set of equality constraints on the problem of minimizing S$S$. Alternatively the problem may be regarded as solving an overdetermined system of equations
 ( A ) B
x =
 ( c ) d
,
$A B x= c d ,$
where some of the equations (those involving B$B$) are to be solved exactly, and the others (those involving A$A$) are to be solved in a least squares sense. The problem has a unique solution on the assumptions that B$B$ has full row rank p$p$ and the matrix
 ( A ) B
$\left(\begin{array}{c}A\\ B\end{array}\right)$ has full column rank n$n$. (For linear least squares problems with inequality constraints, refer to Chapter E04.)
2. General Gauss–Markov linear model problems:
 minimize ​‖y‖2  subject to  d = Ax + By, $minimize ​‖y‖2 subject to d=Ax+By,$
where A$A$ is m$m$ by n$n$ and B$B$ is m$m$ by p$p$, with nmn + p$n\le m\le n+p$. When B = I$B=I$, the problem reduces to an ordinary linear least squares problem. When B$B$ is square and nonsingular, it is equivalent to a weighted linear least squares problem:
 find ​x​ to minimize ​‖B − 1(d − Ax)‖2. $find ​x​ to minimize ​‖B-1(d-Ax)‖2.$
The problem has a unique solution on the assumptions that A$A$ has full column rank n$n$, and the matrix (A,B)$\left(A,B\right)$ has full row rank m$m$. Unless B$B$ is diagonal, for numerical stability it is generally preferable to solve a weighted linear least squares problem as a general Gauss–Markov linear model problem.

Generalized Orthogonal Factorization and Generalized Linear Least Squares Problems

Generalized QR Factorization

The generalized QR$QR$ (GQR) factorization of an n$n$ by m$m$ matrix A$A$ and an n$n$ by p$p$ matrix B$B$ is given by the pair of factorizations
 A = QR   and   B = QTZ , $A = QR and B = QTZ ,$
where Q$Q$ and Z$Z$ are respectively n$n$ by n$n$ and p$p$ by p$p$ orthogonal matrices (or unitary matrices if A$A$ and B$B$ are complex). R$R$ has the form
R =
 m m ( R11 ) n − m 0
, if ​ n m ,
$R = mm(R11) n-m 0 , if ​ n ≥ m ,$
or
R =
 n m − n n ( R11 R12 )
, if ​ n < m ,
$R = nm-nn(R11R12) , if ​ n < m ,$
where R11 ${R}_{11}$ is upper triangular. T$T$ has the form
T =
 p − n n n ( 0 T12 )
, if ​ n p ,
$T = p-nnn(0T12) , if ​ n ≤ p ,$
or
T =
 p n − p ( T11 ) p T21
, if ​ n > p ,
$T = pn-p(T11) p T21 , if ​ n > p ,$
where T12 ${T}_{12}$ or T21 ${T}_{21}$ is upper triangular.
Note that if B$B$ is square and nonsingular, the GQR factorization of A$A$ and B$B$ implicitly gives the QR$QR$ factorization of the matrix B1 A ${B}^{-1}A$:
 B − 1 = ZT (T − 1R) $B-1 = ZT ( T-1 R )$
without explicitly computing the matrix inverse B1 ${B}^{-1}$ or the product B1 A ${B}^{-1}A$.
The GQR factorization can be used to solve the general (Gauss–Markov) linear model problem (GLM) (see Section [Generalized Linear Least Squares Problems], but note that A$A$ and B$B$ are dimensioned differently there as m$m$ by n$n$ and p$p$ by n$n$ respectively). Using the GQR factorization of A$A$ and B$B$, we rewrite the equation d = Ax + By $d=Ax+By$ as
 QTd = QTAx + QTBy = Rx + TZy.
$QTd = QTAx + QTBy = Rx + TZy.$
We partition this as
= mm(R11) n − m 0 x + p − n + mn − mm(T11T12) n − m 0 T22 (y1) y2
$d1 d2 = mm(R11) n-m 0 x + p-n+mn-mm(T11T12) n-m 0 T22 y1 y2$
 (d1) d2
where
 ( d1 ) d2
QTd ,  and
 ( y1 ) y2
Zy .
$d1 d2 ≡ QTd , and y1 y2 ≡ Zy .$
The GLM problem is solved by setting
 y1 = 0   and   y2 = T22 − 1 d2 $y1 = 0 and y2 = T22-1 d2$
from which we obtain the desired solutions
x = R111 (d1T12y2)   and   y = ZT
 ( 0 ) y2
.
$x = R11-1 ( d1 - T12 y2 ) and y = ZT 0 y2 .$

Generalized RQ Factorization

The generalized RQ$RQ$ (GRQ) factorization of an m$m$ by n$n$ matrix A$A$ and a p$p$ by n$n$ matrix B$B$ is given by the pair of factorizations
 A = R Q ,   B = Z T Q $A = R Q , B = Z T Q$
where Q$Q$ and Z$Z$ are respectively n$n$ by n$n$ and p$p$ by p$p$ orthogonal matrices (or unitary matrices if A$A$ and B$B$ are complex). R$R$ has the form
R =
 n − m m m ( 0 R12 )
,  if ​ mn ,
$R = n-mmm(0R12) , if ​ m≤n ,$
or
R =
 n m − n ( R11 ) n R21
,  if ​ m > n ,
$R = nm-n(R11) n R21 , if ​ m>n ,$
where R12 ${R}_{12}$ or R21 ${R}_{21}$ is upper triangular. T$T$ has the form
T =
 n n ( T11 ) p − n 0
,   if ​ pn ,
$T = nn(T11) p-n 0 , if ​ p≥n ,$
or
T =
 p n − p p ( T11 T12 )
,   if ​ p < n ,
$T = pn-pp(T11T12) , if ​ p
where T11 ${T}_{11}$ is upper triangular.
Note that if B$B$ is square and nonsingular, the GRQ factorization of A$A$ and B$B$ implicitly gives the RQ$RQ$ factorization of the matrix AB1 $A{B}^{-1}$:
 AB − 1 = (RT − 1) ZT $AB-1 = (RT-1) ZT$
without explicitly computing the matrix B1 ${B}^{-1}$ or the product AB1 $A{B}^{-1}$.
The GRQ factorization can be used to solve the linear equality-constrained least squares problem (LSE) (see Section [Generalized Linear Least Squares Problems]). We use the GRQ factorization of B$B$ and A$A$ (note that B$B$ and A$A$ have swapped roles), written as
 B = T Q   and   A = Z R Q . $B = T Q and A = Z R Q .$
We write the linear equality constraints Bx = d $Bx=d$ as
 T Q x = d , $T Q x = d ,$
which we partition as:
 n − p p p ( 0 T12 )
 ( x1 ) x2
= d   where
 ( x1 ) x2
Qx .
$n-ppp(0T12) x1 x2 = d where x1 x2 ≡ Qx .$
Therefore x2 ${x}_{2}$ is the solution of the upper triangular system
 T12 x2 = d . $T12 x2 = d .$
Furthermore,
 ‖Ax − c‖2 = ‖ZTAx − ZTc‖2 = ‖RQx − ZTc‖2
.
$‖Ax-c‖2 = ‖ ZT Ax - ZT c ‖2 = ‖ RQx - ZT c ‖2 .$
We partition this expression as:
 n − p p n − p ( R11 R12 ) p + m − n 0 R22
 ( x1 ) x2
 ( c1 ) c2
,
$n-ppn-p(R11R12) p+m-n 0 R22 x1 x2 - c1 c2 ,$
where
 ( c1 ) c2
ZTc
$\left(\begin{array}{c}{c}_{1}\\ {c}_{2}\end{array}\right)\equiv {Z}^{\mathrm{T}}c$.
To solve the LSE problem, we set
 R11 x1 + R12 x2 − c1 = 0 $R11 x1 + R12 x2 - c1 = 0$
which gives x1 ${x}_{1}$ as the solution of the upper triangular system
 R11 x1 = c1 − R12 x2 . $R11 x1 = c1 - R12 x2 .$
Finally, the desired solution is given by
x = QT
 ( x1 ) x2
.
$x = QT x1 x2 .$

Generalized Singular Value Decomposition (GSVD)

The generalized (or quotient) singular value decomposition of an m$m$ by n$n$ matrix A$A$ and a p$p$ by n$n$ matrix B$B$ is given by the pair of factorizations
 A = U Σ1 [0,R] QT   and   B = V Σ2 [0,R] QT . $A = U Σ1 [0,R] QT and B = V Σ2 [0,R] QT .$
The matrices in these factorizations have the following properties:
U$U$ is m$m$ by m$m$, V$V$ is p$p$ by p$p$, Q$Q$ is n$n$ by n$n$, and all three matrices are orthogonal. If A$A$ and B$B$ are complex, these matrices are unitary instead of orthogonal, and QT ${Q}^{\mathrm{T}}$ should be replaced by QH ${Q}^{\mathrm{H}}$ in the pair of factorizations.
R$R$ is r$r$ by r$r$, upper triangular and nonsingular. [0,R] $\left[0,R\right]$ is r$r$ by n$n$ (in other words, the 0$0$ is an r$r$ by nr$n-r$ zero matrix). The integer r$r$ is the rank of
 ( A ) B
$\left(\begin{array}{c}A\\ B\end{array}\right)$, and satisfies rn$r\le n$.
Σ1 ${\Sigma }_{1}$ is m$m$ by r$r$, Σ2 ${\Sigma }_{2}$ is p$p$ by r$r$, both are real, non-negative and diagonal, and Σ1T Σ1 + Σ2T Σ2 = I ${\Sigma }_{1}^{\mathrm{T}}{\Sigma }_{1}+{\Sigma }_{2}^{\mathrm{T}}{\Sigma }_{2}=I$. Write Σ1T Σ1 = diag(α12,,αr2) ${\Sigma }_{1}^{\mathrm{T}}{\Sigma }_{1}=\mathrm{diag}\left({\alpha }_{1}^{2},\dots ,{\alpha }_{r}^{2}\right)$ and Σ2T Σ2 = diag(β12,,βr2) ${\Sigma }_{2}^{\mathrm{T}}{\Sigma }_{2}=\mathrm{diag}\left({\beta }_{1}^{2},\dots ,{\beta }_{r}^{2}\right)$, where αi ${\alpha }_{i}$ and βi ${\beta }_{i}$ lie in the interval from 0$0$ to 1$1$. The ratios α1 / β1 ,, αr / βr ${\alpha }_{1}/{\beta }_{1},\dots ,{\alpha }_{r}/{\beta }_{r}$ are called the generalized singular values of the pair A$A$, B$B$. If βi = 0 ${\beta }_{i}=0$, then the generalized singular value αi / βi ${\alpha }_{i}/{\beta }_{i}$ is infinite.
Σ1 ${\Sigma }_{1}$ and Σ2 ${\Sigma }_{2}$ have the following detailed structures, depending on whether mr0 $m-r\ge 0$ or mr < 0 $m-r<0$. In the first case, mr0 $m-r\ge 0$, then
Σ1 =
 k l k ( I 0 ) l 0 C m − k − l 0 0
and   Σ2 =
 k l l ( 0 S ) p − l 0 0
.
$Σ1 = klk(I0) l 0 C m-k-l 0 0 and Σ2 = kll(0S) p-l 0 0 .$
Here l$l$ is the rank of B$B$, k = rl $k=r-l$, C$C$ and S$S$ are diagonal matrices satisfying C2 + S2 = I ${C}^{2}+{S}^{2}=I$, and S$S$ is nonsingular. We may also identify α1 = = αk = 1 ${\alpha }_{1}=\cdots ={\alpha }_{k}=1$, αk + i = cii ${\alpha }_{k+i}={c}_{ii}$, for i = 1,2,, l$i=1,2,\dots ,l$, β1 = = βk = 0 ${\beta }_{1}=\cdots ={\beta }_{k}=0$, and βk + i = sii ${\beta }_{k+i}={s}_{ii}$, for i = 1,2,, l $i=1,2,\dots ,l$. Thus, the first k$k$ generalized singular values α1 / β1 ,, αk / βk ${\alpha }_{1}/{\beta }_{1},\dots ,{\alpha }_{k}/{\beta }_{k}$ are infinite, and the remaining l$l$ generalized singular values are finite.
In the second case, when mr < 0 $m-r<0$,
Σ1 =
 k m − k k + l − m k ( I 0 0 ) m − k 0 C 0
$Σ1 = km-kk+l-mk(I00) m-k 0 C 0$
and
Σ2 =
 k m − k k + l − m m − k ( 0 S 0 ) k + l − m 0 0 I p − l 0 0 0
.
$Σ2 = km-kk+l-mm-k(0S0) k+l-m0 0 I p-l0 0 0 .$
Again, l$l$ is the rank of B$B$, k = rl $k=r-l$, C$C$ and S$S$ are diagonal matrices satisfying C2 + S2 = I ${C}^{2}+{S}^{2}=I$, and S$S$ is nonsingular, and we may identify α1 = = αk = 1 ${\alpha }_{1}=\cdots ={\alpha }_{k}=1$, αk + i = cii ${\alpha }_{k+i}={c}_{ii}$, for i = 1,2,, mk $i=1,2,\dots ,m-k$, αm + 1 = = αr = 0 ${\alpha }_{m+1}=\cdots ={\alpha }_{r}=0$, β1 = = βk = 0 ${\beta }_{1}=\cdots ={\beta }_{k}=0$, βk + i = sii ${\beta }_{k+i}={s}_{ii}$, for i = 1,2,, mk $i=1,2,\dots ,m-k$ and βm + 1 = = βr = 1 ${\beta }_{m+1}=\cdots ={\beta }_{r}=1$. Thus, the first k$k$ generalized singular values α1 / β1 ,, αk / βk ${\alpha }_{1}/{\beta }_{1},\dots ,{\alpha }_{k}/{\beta }_{k}$ are infinite, and the remaining l$l$ generalized singular values are finite.
Here are some important special case of the generalized singular value decomposition. First, if B$B$ is square and nonsingular, then r = n$r=n$ and the generalized singular value decomposition of A$A$ and B$B$ is equivalent to the singular value decomposition of AB1 $A{B}^{-1}$, where the singular values of AB1 $A{B}^{-1}$ are equal to the generalized singular values of the pair A$A$, B$B$:
 AB − 1 = (UΣ1RQT) (VΣ2RQT) − 1 = U (Σ1Σ2 − 1) VT . $AB-1 = ( U Σ1 R QT ) ( V Σ2 R QT ) -1 = U ( Σ1 Σ2-1 ) VT .$
Second, if the columns of (ATBT)T ${\left({A}^{\mathrm{T}}{B}^{\mathrm{T}}\right)}^{\mathrm{T}}$ are orthonormal, then r = n$r=n$, R = I$R=I$ and the generalized singular value decomposition of A$A$ and B$B$ is equivalent to the CS (Cosine–Sine) decomposition of (ATBT)T ${\left({A}^{\mathrm{T}}{B}^{\mathrm{T}}\right)}^{\mathrm{T}}$:
 ( A ) B
=
 ( U 0 ) 0 V
 ( Σ1 ) Σ2
QT .
$A B = U 0 0 V Σ1 Σ2 QT .$
Third, the generalized eigenvalues and eigenvectors of ATA λ BTB ${A}^{\mathrm{T}}A-\lambda {B}^{\mathrm{T}}B$ can be expressed in terms of the generalized singular value decomposition: Let
X = Q
 ( I 0 ) 0 R − 1
.
$X = Q I 0 0 R-1 .$
Then
XT AT AX =
 ( 0 0 ) 0 Σ1TΣ1
and   XT BT BX =
 ( 0 0 ) 0 Σ2TΣ2
.
$XT AT AX = 0 0 0 Σ1TΣ1 and XT BT BX = 0 0 0 Σ2TΣ2 .$
Therefore, the columns of X$X$ are the eigenvectors of ATA λ BTB ${A}^{\mathrm{T}}A-\lambda {B}^{\mathrm{T}}B$, and ‘nontrivial’ eigenvalues are the squares of the generalized singular values (see also Section [Generalized Symmetric-definite Eigenvalue Problems]). ‘Trivial’ eigenvalues are those corresponding to the leading nr$n-r$ columns of X$X$, which span the common null space of ATA ${A}^{\mathrm{T}}A$ and BTB ${B}^{\mathrm{T}}B$. The ‘trivial eigenvalues’ are not well defined.

Symmetric Eigenvalue Problems

The symmetric eigenvalue problem is to find the eigenvalues, λ$\lambda$, and corresponding eigenvectors, z0$z\ne 0$, such that
 Az = λz,  A = AT,   where ​A​ is real. $Az=λz, A=AT, where ​A​ is real.$
For the Hermitian eigenvalue problem we have
 Az = λ z,   A = AH,   where ​ A​ is complex. $Az=λ z, A=AH, where ​ A​ is complex.$
For both problems the eigenvalues λ$\lambda$ are real.
When all eigenvalues and eigenvectors have been computed, we write
 A = ZΛZT (or ​A = ZΛZH​ if complex), $A =ZΛZT (or ​A=ZΛZH​ if complex),$
where Λ$\Lambda$ is a diagonal matrix whose diagonal elements are the eigenvalues, and Z$Z$ is an orthogonal (or unitary) matrix whose columns are the eigenvectors. This is the classical spectral factorization of A$A$.
The basic task of the symmetric eigenproblem functions is to compute values of λ$\lambda$ and, optionally, corresponding vectors z$z$ for a given matrix A$A$. This computation proceeds in the following stages.
1. The real symmetric or complex Hermitian matrix A$A$ is reduced to real tridiagonal form T$T$. If A$A$ is real symmetric this decomposition is A = QTQT$A=QT{Q}^{\mathrm{T}}$ with Q$Q$ orthogonal and T$T$ symmetric tridiagonal. If A$A$ is complex Hermitian, the decomposition is A = QTQH$A=QT{Q}^{\mathrm{H}}$ with Q$Q$ unitary and T$T$, as before, real symmetric tridiagonal.
2. Eigenvalues and eigenvectors of the real symmetric tridiagonal matrix T$T$ are computed. If all eigenvalues and eigenvectors are computed, this is equivalent to factorizing T$T$ as T = SΛST$T=S\Lambda {S}^{\mathrm{T}}$, where S$S$ is orthogonal and Λ$\Lambda$ is diagonal. The diagonal entries of Λ$\Lambda$ are the eigenvalues of T$T$, which are also the eigenvalues of A$A$, and the columns of S$S$ are the eigenvectors of T$T$; the eigenvectors of A$A$ are the columns of Z = QS$Z=QS$, so that A = ZΛZT$A=Z\Lambda {Z}^{\mathrm{T}}$ (ZΛZH$Z\Lambda {Z}^{\mathrm{H}}$ when A$A$ is complex Hermitian).
This chapter supports four primary algorithms for computing eigenvalues and eigenvectors of real symmetric matrices and complex Hermitian matrices. They are:
 (i) the divide-and-conquer algorithm; (ii) the QR$QR$ algorithm; (iii) bisection followed by inverse iteration; (iv) the Relatively Robust Representation (RRR).
The divide-and-conquer algorithm is generally more efficient than the traditional QR$QR$ algorithm for computing all eigenvalues and eigenvectors, but the RRR algorithm tends to be fastest of all. For further information and references see Anderson et al. (1999).

Generalized Symmetric-definite Eigenvalue Problems

This section is concerned with the solution of the generalized eigenvalue problems Az = λBz$Az=\lambda Bz$, ABz = λz$ABz=\lambda z$, and BAz = λz$BAz=\lambda z$, where A$A$ and B$B$ are real symmetric or complex Hermitian and B$B$ is positive definite. Each of these problems can be reduced to a standard symmetric eigenvalue problem, using a Cholesky factorization of B$B$ as either B = LLT$B=L{L}^{\mathrm{T}}$ or B = UTU$B={U}^{\mathrm{T}}U$ (LLH$L{L}^{\mathrm{H}}$ or UHU${U}^{\mathrm{H}}U$ in the Hermitian case).
With B = LLT$B=L{L}^{\mathrm{T}}$, we have
 Az = λBz ⇒ (L − 1AL − T)(LTz) = λ(LTz). $Az=λBz⇒(L-1AL-T)(LTz)=λ(LTz).$
Hence the eigenvalues of Az = λBz$Az=\lambda Bz$ are those of Cy = λy$Cy=\lambda y$, where C$C$ is the symmetric matrix C = L1ALT$C={L}^{-1}A{L}^{-\mathrm{T}}$ and y = LTz$y={L}^{\mathrm{T}}z$. In the complex case C$C$ is Hermitian with C = L1ALH$C={L}^{-1}A{L}^{-\mathrm{H}}$ and y = LHz$y={L}^{\mathrm{H}}z$.
Table 1 summarises how each of the three types of problem may be reduced to standard form Cy = λy$Cy=\lambda y$, and how the eigenvectors z$z$ of the original problem may be recovered from the eigenvectors y$y$ of the reduced problem. The table applies to real problems; for complex problems, transposed matrices must be replaced by conjugate-transposes.
 Type of problem Factorization of B$B$ Reduction Recovery of eigenvectors 1. Az = λBz$Az=\lambda Bz$ B = LLT$B=L{L}^{\mathrm{T}}$, B = UTU$B={U}^{\mathrm{T}}U$ C = L − 1AL − T$C={L}^{-1}A{L}^{-\mathrm{T}}$, C = U − TAU − 1$C={U}^{-\mathrm{T}}A{U}^{-1}$ z = L − Ty$z={L}^{-\mathrm{T}}y$, z = U − 1y$z={U}^{-1}y$ 2. ABz = λz$ABz=\lambda z$ B = LLT$B=L{L}^{\mathrm{T}}$, B = UTU$B={U}^{\mathrm{T}}U$ C = LTAL$C={L}^{\mathrm{T}}AL$, C = UAUT$C=UA{U}^{\mathrm{T}}$ z = L − Ty$z={L}^{-\mathrm{T}}y$, z = U − 1y$z={U}^{-1}y$ 3. BAz = λz$BAz=\lambda z$ B = LLT$B=L{L}^{\mathrm{T}}$, B = UTU$B={U}^{\mathrm{T}}U$ C = LTAL$C={L}^{\mathrm{T}}AL$, C = UAUT$C=UA{U}^{\mathrm{T}}$ z = Ly$z=Ly$, z = UTy$z={U}^{\mathrm{T}}y$
Table 1
Reduction of generalized symmetric-definite eigenproblems to standard problems
When the generalized symmetric-definite problem has been reduced to the corresponding standard problem Cy = λy$Cy=\lambda y$, this may then be solved using the functions described in the previous section. No special functions are needed to recover the eigenvectors z$z$ of the generalized problem from the eigenvectors y$y$ of the standard problem, because these computations are simple applications of Level 2 or Level 3 BLAS

Packed Storage for Symmetric Matrices

Functions which handle symmetric matrices are usually designed so that they use either the upper or lower triangle of the matrix; it is not necessary to store the whole matrix. If either the upper or lower triangle is stored conventionally in the upper or lower triangle of a two-dimensional array, the remaining elements of the array can be used to store other useful data. However, that is not always convenient, and if it is important to economize on storage, the upper or lower triangle can be stored in a one-dimensional array of length n(n + 1) / 2$n\left(n+1\right)/2$; that is, the storage is almost halved.
This storage format is referred to as packed storage; it is described in Section [Packed storage] in the F07 Chapter Introduction.
Functions designed for packed storage are usually less efficient, especially on high-performance computers, so there is a trade-off between storage and efficiency.

Band Matrices

A band matrix is one whose elements are confined to a relatively small number of subdiagonals or superdiagonals on either side of the main diagonal. Algorithms can take advantage of bandedness to reduce the amount of work and storage required. The storage scheme for band matrices is described in Section [Band storage] in the F07 Chapter Introduction.
If the problem is the generalized symmetric definite eigenvalue problem Az = λBz$Az=\lambda Bz$ and the matrices A$A$ and B$B$ are additionally banded, the matrix C$C$ as defined in Section [Generalized Symmetric-definite Eigenvalue Problems] is, in general, full. We can reduce the problem to a banded standard problem by modifying the definition of C$C$ thus:
 C = XTAX,   where  X = U − 1Q  or ​L − TQ, $C =XTAX, where X=U-1Q or ​L-TQ,$
where Q$Q$ is an orthogonal matrix chosen to ensure that C$C$ has bandwidth no greater than that of A$A$.
A further refinement is possible when A$A$ and B$B$ are banded, which halves the amount of work required to form C$C$. Instead of the standard Cholesky factorization of B$B$ as UTU${U}^{\mathrm{T}}U$ or LLT$L{L}^{\mathrm{T}}$, we use a split Cholesky factorization B = STS$B={S}^{\mathrm{T}}S$, where
S =
 ( U11 ) M21 L22
$S = U11 M21 L22$
with U11${U}_{11}$ upper triangular and L22${L}_{22}$ lower triangular of order approximately n / 2$n/2$; S$S$ has the same bandwidth as B$B$.

Nonsymmetric Eigenvalue Problems

The nonsymmetric eigenvalue problem is to find the eigenvalues, λ$\lambda$, and corresponding eigenvectors, v0$v\ne 0$, such that
 Av = λv. $Av=λv.$
More precisely, a vector v$v$ as just defined is called a right eigenvector of A$A$, and a vector u0$u\ne 0$ satisfying
 uTA = λuT (uHA = λuH  when ​u​ is complex) $uTA=λuT (uHA=λuH when ​u​ is complex)$
is called a left eigenvector of A$A$.
A real matrix A$A$ may have complex eigenvalues, occurring as complex conjugate pairs.
This problem can be solved via the Schur factorization of A$A$, defined in the real case as
 A = ZTZT, $A =ZTZT,$
where Z$Z$ is an orthogonal matrix and T$T$ is an upper quasi-triangular matrix with 1$1$ by 1$1$ and 2$2$ by 2$2$ diagonal blocks, the 2$2$ by 2$2$ blocks corresponding to complex conjugate pairs of eigenvalues of A$A$. In the complex case, the Schur factorization is
 A = ZTZH, $A =ZTZH,$
where Z$Z$ is unitary and T$T$ is a complex upper triangular matrix.
The columns of Z$Z$ are called the Schur vectors. For each k$k$ (1kn$1\le k\le n$), the first k$k$ columns of Z$Z$ form an orthonormal basis for the invariant subspace corresponding to the first k$k$ eigenvalues on the diagonal of T$T$. Because this basis is orthonormal, it is preferable in many applications to compute Schur vectors rather than eigenvectors. It is possible to order the Schur factorization so that any desired set of k$k$ eigenvalues occupy the k$k$ leading positions on the diagonal of T$T$.
The two basic tasks of the nonsymmetric eigenvalue functions are to compute, for a given matrix A$A$, all n$n$ values of λ$\lambda$ and, if desired, their associated right eigenvectors v$v$ and/or left eigenvectors u$u$, and the Schur factorization.
These two basic tasks can be performed in the following stages.
1. A general matrix A$A$ is reduced to upper Hessenberg form H$H$ which is zero below the first subdiagonal. The reduction may be written A = QHQT$A=QH{Q}^{\mathrm{T}}$ with Q$Q$ orthogonal if A$A$ is real, or A = QHQH$A=QH{Q}^{\mathrm{H}}$ with Q$Q$ unitary if A$A$ is complex.
2. The upper Hessenberg matrix H$H$ is reduced to Schur form T$T$, giving the Schur factorization H = STST$H=ST{S}^{\mathrm{T}}$ (for H$H$ real) or H = STSH$H=ST{S}^{\mathrm{H}}$ (for H$H$ complex). The matrix S$S$ (the Schur vectors of H$H$) may optionally be computed as well. Alternatively S$S$ may be postmultiplied into the matrix Q$Q$ determined in stage 1$1$, to give the matrix Z = QS$Z=QS$, the Schur vectors of A$A$. The eigenvalues are obtained from the diagonal elements or diagonal blocks of T$T$.
3. Given the eigenvalues, the eigenvectors may be computed in two different ways. Inverse iteration can be performed on H$H$ to compute the eigenvectors of H$H$, and then the eigenvectors can be multiplied by the matrix Q$Q$ in order to transform them to eigenvectors of A$A$. Alternatively the eigenvectors of T$T$ can be computed, and optionally transformed to those of H$H$ or A$A$ if the matrix S$S$ or Z$Z$ is supplied.
The accuracy with which eigenvalues can be obtained can often be improved by balancing a matrix. This is discussed further in Section [Balancing and condition for the nonsymmetric eigenproblem] below.

Generalized Nonsymmetric Eigenvalue Problem

The generalized nonsymmetric eigenvalue problem is to find the eigenvalues, λ$\lambda$, and corresponding eigenvectors, v0$v\ne 0$, such that
 Av = λBv. $Av=λBv.$
More precisely, a vector v$v$ as just defined is called a right eigenvector of the matrix pair (A,B)$\left(A,B\right)$, and a vector u0$u\ne 0$ satisfying
 uTA = λuTB (uHA = λuHB​ when ​u​ is complex) $uTA=λuTB (uHA=λuHB​ when ​u​ is complex)$
is called a left eigenvector of the matrix pair (A,B)$\left(A,B\right)$.
If B$B$ is singular then the problem has one or more infinite eigenvalues λ = $\lambda =\infty$, corresponding to Bv = 0$Bv=0$. Note that if A$A$ is nonsingular, then the equivalent problem μAv = Bv$\mu Av=Bv$ is perfectly well defined and an infinite eigenvalue corresponds to μ = 0$\mu =0$. To deal with both finite (including zero) and infinite eigenvalues, the functions in this chapter do not compute λ$\lambda$ explicitly, but rather return a pair of numbers (α,β)$\left(\alpha ,\beta \right)$ such that if β0$\beta \ne 0$
 λ = α / β $λ =α/β$
and if α0$\alpha \ne 0$ and β = 0$\beta =0$ then λ = $\lambda =\infty$. β$\beta$ is always returned as real and non-negative. Of course, computationally an infinite eigenvalue may correspond to a small β$\beta$ rather than an exact zero.
For a given pair (A,B)$\left(A,B\right)$ the set of all the matrices of the form (AλB)$\left(A-\lambda B\right)$ is called a matrix pencil and λ$\lambda$ and v$v$ are said to be an eigenvalue and eigenvector of the pencil (AλB)$\left(A-\lambda B\right)$. If A$A$ and B$B$ are both singular and share a common null space then
 det(A − λB) ≡ 0 $det(A-λB)≡0$
so that the pencil (AλB)$\left(A-\lambda B\right)$ is singular for all λ$\lambda$. In other words any λ$\lambda$ can be regarded as an eigenvalue. In exact arithmetic a singular pencil will have α = β = 0$\alpha =\beta =0$ for some (α,β)$\left(\alpha ,\beta \right)$. Computationally if some pair (α,β)$\left(\alpha ,\beta \right)$ is small then the pencil is singular, or nearly singular, and no reliance can be placed on any of the computed eigenvalues. Singular pencils can also manifest themselves in other ways; see, in particular, Sections 2.3.5.2 and 4.11.1.4 of Anderson et al. (1999) for further details.
The generalized eigenvalue problem can be solved via the generalized Schur factorization of the pair (A,B)$\left(A,B\right)$ defined in the real case as
 A = QSZT,  B = QTZT, $A =QSZT, B=QTZT,$
where Q$Q$ and Z$Z$ are orthogonal, T$T$ is upper triangular with non-negative diagonal elements and S$S$ is upper quasi-triangular with 1$1$ by 1$1$ and 2$2$ by 2$2$ diagonal blocks, the 2$2$ by 2$2$ blocks corresponding to complex conjugate pairs of eigenvalues. In the complex case, the generalized Schur factorization is
 A = QSZH,  B = QTZH, $A =QSZH, B=QTZH,$
where Q$Q$ and Z$Z$ are unitary and S$S$ and T$T$ are upper triangular, with T$T$ having real non-negative diagonal elements. The columns of Q$Q$ and Z$Z$ are called respectively the left and right generalized Schur vectors and span pairs of deflating subspaces of A$A$ and B$B$, which are a generalization of invariant subspaces.
It is possible to order the generalized Schur factorization so that any desired set of k$k$ eigenvalues correspond to the k$k$ leading positions on the diagonals of the pair (S,T)$\left(S,T\right)$.
The two basic tasks of the generalized nonsymmetric eigenvalue functions are to compute, for a given pair (A,B)$\left(A,B\right)$, all n$n$ values of λ$\lambda$ and, if desired, their associated right eigenvectors v$v$ and/or left eigenvectors u$u$, and the generalized Schur factorization.
These two basic tasks can be performed in the following stages.
1. The matrix pair (A,B)$\left(A,B\right)$ is reduced to generalized upper Hessenberg form (H,R)$\left(H,R\right)$, where H$H$ is upper Hessenberg (zero below the first subdiagonal) and R$R$ is upper triangular. The reduction may be written as A = Q1HZ1T, B = Q1RZ1T$A={Q}_{1}H{Z}_{1}^{\mathrm{T}},B={Q}_{1}R{Z}_{1}^{\mathrm{T}}$ in the real case with Q1${Q}_{1}$ and Z1${Z}_{1}$ orthogonal, and A = Q1H Z1H , B = Q1R Z1H $A={Q}_{1}H{Z}_{1}^{\mathrm{H}},B={Q}_{1}R{Z}_{1}^{\mathrm{H}}$ in the complex case with Q1${Q}_{1}$ and Z1${Z}_{1}$ unitary.
2. The generalized upper Hessenberg form (H,R)$\left(H,R\right)$ is reduced to the generalized Schur form (S,T)$\left(S,T\right)$ using the generalized Schur factorization H = Q2S Z2T$H={Q}_{2}S{Z}_{2}^{\mathrm{T}}$, R = Q2T Z2T$R={Q}_{2}T{Z}_{2}^{\mathrm{T}}$ in the real case with Q2${Q}_{2}$ and Z2${Z}_{2}$ orthogonal, and H = Q2 SZ2H, R = Q2T Z2H$H={Q}_{2}S{Z}_{2}^{\mathrm{H}},R={Q}_{2}T{Z}_{2}^{\mathrm{H}}$ in the complex case. The generalized Schur vectors of (A,B)$\left(A,B\right)$ are given by Q = Q1Q2$Q={Q}_{1}{Q}_{2}$, Z = Z1Z2$Z={Z}_{1}{Z}_{2}$. The eigenvalues are obtained from the diagonal elements (or blocks) of the pair (S,T)$\left(S,T\right)$.
3. Given the eigenvalues, the eigenvectors of the pair (S,T)$\left(S,T\right)$ can be computed, and optionally transformed to those of (H,R)$\left(H,R\right)$ or (A,B)$\left(A,B\right)$.
The accuracy with which eigenvalues can be obtained can often be improved by balancing a matrix pair. This is discussed further in Section [Balancing the generalized eigenvalue problem] below.

The Sylvester Equation and the Generalized Sylvester Equation

The Sylvester equation is a matrix equation of the form
 AX + XB = C, $AX+XB=C,$
where A$A$, B$B$, and C$C$ are given matrices with A$A$ being m$m$ by m$m$, B$B$ an n$n$ by n$n$ matrix and C$C$, and the solution matrix X$X$, m$m$ by n$n$ matrices. The solution of a special case of this equation occurs in the computation of the condition number for an invariant subspace, but a combination of functions in this chapter allows the solution of the general Sylvester equation.
Functions are also provided for solving a special case of the generalized Sylvester equations
 AR − LB = C ,  DR − LE = F , $AR-LB=C , DR-LE=F ,$
where (A,D)$\left(A,D\right)$, (B,E)$\left(B,E\right)$ and (C,F)$\left(C,F\right)$ are given matrix pairs, and R$R$ and L$L$ are the solution matrices.

Error and Perturbation Bounds and Condition Numbers

In this section we discuss the effects of rounding errors in the solution process and the effects of uncertainties in the data, on the solution to the problem. A number of the functions in this chapter return information, such as condition numbers, that allow these effects to be assessed. First we discuss some notation used in the error bounds of later sections.
The bounds usually contain the factor p(n)$p\left(n\right)$ (or p(m,n)$p\left(m,n\right)$), which grows as a function of the matrix dimension n$n$ (or matrix dimensions m$m$ and n$n$). It measures how errors can grow as a function of the matrix dimension, and represents a potentially different function for each problem. In practice, it usually grows just linearly; p(n)10n$p\left(n\right)\le 10n$ is often true, although generally only much weaker bounds can be actually proved. We normally describe p(n)$p\left(n\right)$ as a ‘modestly growing’ function of n$n$. For detailed derivations of various p(n)$p\left(n\right)$, see Golub and Van Loan (1996) and Wilkinson (1965).
For linear equation (see Chapter F07) and least squares solvers, we consider bounds on the relative error x / x$‖x-\stackrel{^}{x}‖/‖x‖$ in the computed solution $\stackrel{^}{x}$, where x$x$ is the true solution. For eigenvalue problems we consider bounds on the error |λiλ̂i|$|{\lambda }_{i}-{\stackrel{^}{\lambda }}_{i}|$ in the i$i$th computed eigenvalue λ̂i${\stackrel{^}{\lambda }}_{i}$, where λi${\lambda }_{i}$ is the true i$i$th eigenvalue. For singular value problems we similarly consider bounds |σiσ̂i|$|{\sigma }_{i}-{\stackrel{^}{\sigma }}_{i}|$.
Bounding the error in computed eigenvectors and singular vectors i${\stackrel{^}{v}}_{i}$ is more subtle because these vectors are not unique: even though we restrict i2 = 1${‖{\stackrel{^}{v}}_{i}‖}_{2}=1$ and vi2 = 1${‖{v}_{i}‖}_{2}=1$, we may still multiply them by arbitrary constants of absolute value 1$1$. So to avoid ambiguity we bound the angular difference between i${\stackrel{^}{v}}_{i}$ and the true vector vi${v}_{i}$, so that
 θ(vi,v̂i) = acute angle between ​vi​ and ​v̂i = arccos|viHv̂i|.
$θ(vi,v^i) = acute angle between ​vi​ and ​v^i = arccos|viHv^i|.$
(2)
Here arccos(θ)$\mathrm{arccos}\left(\theta \right)$ is in the standard range: 0arccos(θ) < π$0\le \mathrm{arccos}\left(\theta \right)<\pi$. When θ(vi,i)$\theta \left({v}_{i},{\stackrel{^}{v}}_{i}\right)$ is small, we can choose a constant α$\alpha$ with absolute value 1$1$ so that αvii2θ(vi,i)${‖\alpha {v}_{i}-{\stackrel{^}{v}}_{i}‖}_{2}\approx \theta \left({v}_{i},{\stackrel{^}{v}}_{i}\right)$.
In addition to bounds for individual eigenvectors, bounds can be obtained for the spaces spanned by collections of eigenvectors. These may be much more accurately determined than the individual eigenvectors which span them. These spaces are called invariant subspaces in the case of eigenvectors, because if v$v$ is any vector in the space, Av$Av$ is also in the space, where A$A$ is the matrix. Again, we will use angle to measure the difference between a computed space $\stackrel{^}{S}$ and the true space S$S$:
θ(S,) = acute angle between ​S​ and ​
= max
 s ∈ S s ≠ 0
min
 ŝ ∈ Ŝ ŝ ≠ 0
θ(s,)   or   max
 ŝ ∈ Ŝ ŝ ≠ 0
min
 s ∈ S s ≠ 0
θ(s,)
$θ(S,S^) = acute angle between ​S​ and ​S^ = max s∈S s≠0 min s^∈S^ s^≠0 θ(s,s^) or max s^∈S^ s^≠0 min s∈S s≠0 θ(s,s^)$
(3)
θ(S,)$\theta \left(S,\stackrel{^}{S}\right)$ may be computed as follows. Let S$S$ be a matrix whose columns are orthonormal and spanS$\mathrm{span}S$. Similarly let $\stackrel{^}{S}$ be an orthonormal matrix with columns spanning $\stackrel{^}{S}$. Then
 θ(S,Ŝ) = arccosσmin(SHŜ). $θ(S,S^)=arccos⁡σmin(SHS^).$
Finally, we remark on the accuracy of the bounds when they are large. Relative errors like x / x$‖\stackrel{^}{x}-x‖/‖x‖$ and angular errors like θ(i,vi)$\theta \left({\stackrel{^}{v}}_{i},{v}_{i}\right)$ are only of interest when they are much less than 1$1$. Some stated bounds are not strictly true when they are close to 1$1$, but rigorous bounds are much more complicated and supply little extra information in the interesting case of small errors. These bounds are indicated by using the symbol $\lesssim$, or ‘approximately less than’, instead of the usual $\le$. Thus, when these bounds are close to 1 or greater, they indicate that the computed answer may have no significant digits at all, but do not otherwise bound the error.
A number of functions in this chapter return error estimates and/or condition number estimates directly. In other cases Anderson et al. (1999) gives code fragments to illustrate the computation of these estimates, and a number of the Chapter F08 example programs, for the driver functions, implement these code fragments.

Least squares problems

The conventional error analysis of linear least squares problems goes as follows. The problem is to find the x$x$ minimizing Axb2${‖Ax-b‖}_{2}$. Let $\stackrel{^}{x}$ be the solution computed using one of the methods described above. We discuss the most common case, where A$A$ is overdetermined (i.e., has more rows than columns) and has full rank.
Then the computed solution $\stackrel{^}{x}$ has a small normwise backward error. In other words $\stackrel{^}{x}$ minimizes (A + E)(b + f)2${‖\left(A+E\right)\stackrel{^}{x}-\left(b+f\right)‖}_{2}$, where
 max ((‖E‖2)/(‖A‖2),(‖f‖2)/(‖b‖2)) ≤ p(n)ε $max( ‖E‖2 ‖A‖2 , ‖f‖2 ‖b‖2 ) ≤ p(n)ε$
and p(n)$p\left(n\right)$ is a modestly growing function of n$n$ and ε$\epsilon$ is the machine precision. Let κ2(A) = σmax(A) / σmin(A)${\kappa }_{2}\left(A\right)={\sigma }_{\mathrm{max}}\left(A\right)/{\sigma }_{\mathrm{min}}\left(A\right)$, ρ = Axb2$\rho ={‖Ax-b‖}_{2}$, and sin(θ) = ρ / b2$\mathrm{sin}\left(\theta \right)=\rho /{‖b‖}_{2}$. Then if p(n)ε$p\left(n\right)\epsilon$ is small enough, the error x$\stackrel{^}{x}-x$ is bounded by
 (‖x − x̂‖2)/(‖x‖2) ≲ p(n)ε {(2κ2(A))/(cos(θ)) + tan(θ)κ22(A)} . $‖x-x^‖2 ‖x‖2 ≲p(n)ε {2κ2(A) cos(θ) +tan(θ)κ22(A)} .$
If A$A$ is rank-deficient, the problem can be regularized by treating all singular values less than a user-specified threshold as exactly zero. See Golub and Van Loan (1996) for error bounds in this case, as well as for the underdetermined case.
The solution of the overdetermined, full-rank problem may also be characterised as the solution of the linear system of equations
 ( I A ) AT 0
 ( r ) x
=
 ( b ) 0
.
$I A AT 0 r x = b 0 .$
By solving this linear system (see Chapter F07) component-wise error bounds can also be obtained Arioli et al. (1989).

The singular value decomposition

The usual error analysis of the SVD algorithm is as follows (see Golub and Van Loan (1996)).
The computed SVD, Σ̂T$\stackrel{^}{U}\stackrel{^}{\Sigma }{\stackrel{^}{V}}^{\mathrm{T}}$, is nearly the exact SVD of A + E$A+E$, i.e., A + E = ( + δ)Σ̂( + δ)$A+E=\left(\stackrel{^}{U}+\delta \stackrel{^}{U}\right)\stackrel{^}{\Sigma }\left(\stackrel{^}{V}+\delta \stackrel{^}{V}\right)$ is the true SVD, so that + δ$\stackrel{^}{U}+\delta \stackrel{^}{U}$ and + δ$\stackrel{^}{V}+\delta \stackrel{^}{V}$ are both orthogonal, where E2 / A2p(m,n)ε${‖E‖}_{2}/{‖A‖}_{2}\le p\left(m,n\right)\epsilon$, δp(m,n)ε$‖\delta \stackrel{^}{U}‖\le p\left(m,n\right)\epsilon$, and δp(m,n)ε$‖\delta \stackrel{^}{V}‖\le p\left(m,n\right)\epsilon$. Here p(m,n)$p\left(m,n\right)$ is a modestly growing function of m$m$ and n$n$ and ε$\epsilon$ is the machine precision. Each computed singular value σ̂i${\stackrel{^}{\sigma }}_{i}$ differs from the true σi${\sigma }_{i}$ by an amount satisfying the bound
 |σ̂i − σi| ≤ p(m,n)εσ1. $|σ^i-σi|≤p(m,n)εσ1.$
Thus large singular values (those near σ1${\sigma }_{1}$) are computed to high relative accuracy and small ones may not be.
The angular difference between the computed left singular vector i${\stackrel{^}{u}}_{i}$ and the true ui${u}_{i}$ satisfies the approximate bound
 θ(ûi,ui) ≲ (p(m,n)ε‖A‖2)/(gapi) $θ(u^i,ui)≲p(m,n)ε‖A‖2gapi$
where
 gapi = min |σi − σj| j ≠ i
$gap i = min j≠i |σi-σj|$
is the absolute gap between σi${\sigma }_{i}$ and the nearest other singular value. Thus, if σi${\sigma }_{i}$ is close to other singular values, its corresponding singular vector ui${u}_{i}$ may be inaccurate. The same bound applies to the computed right singular vector i${\stackrel{^}{v}}_{i}$ and the true vector vi${v}_{i}$. The gaps may be easily obtained from the computed singular values.
Let $\stackrel{^}{\mathbit{S}}$ be the space spanned by a collection of computed left singular vectors {i,iI}$\left\{{\stackrel{^}{u}}_{i},i\in \mathbit{I}\right\}$, where I$\mathbit{I}$ is a subset of the integers from 1$1$ to n$n$. Let S$\mathbit{S}$ be the corresponding true space. Then
 θ(Ŝ,S) ≲ (p(m,n)ε‖A‖2)/(gapI). $θ(S^,S)≲p(m,n)ε‖A‖2 gapI .$
where
 gapI = min {|σi − σj|  for ​i ∈ I,j ∉ I} $gapI=min{|σi-σj| for ​ i∈I,j∉I}$
is the absolute gap between the singular values in I$\mathbit{I}$ and the nearest other singular value. Thus, a cluster of close singular values which is far away from any other singular value may have a well determined space $\stackrel{^}{\mathbit{S}}$ even if its individual singular vectors are ill-conditioned. The same bound applies to a set of right singular vectors {i,iI}$\left\{{\stackrel{^}{v}}_{i},i\in \mathbit{I}\right\}$.
In the special case of bidiagonal matrices, the singular values and singular vectors may be computed much more accurately (see Demmel and Kahan (1990)). A bidiagonal matrix B$B$ has nonzero entries only on the main diagonal and the diagonal immediately above it (or immediately below it). Reduction of a dense matrix to bidiagonal form B$B$ can introduce additional errors, so the following bounds for the bidiagonal case do not apply to the dense case.
Using the functions in this chapter, each computed singular value of a bidiagonal matrix is accurate to nearly full relative accuracy, no matter how tiny it is, so that
 |σ̂i − σi| ≤ p(m,n)εσi. $|σ^i-σi|≤p(m,n)εσi.$
The computed left singular vector i${\stackrel{^}{u}}_{i}$ has an angular error at most about
 θ(ûi,ui) ≲ (p(m,n)ε)/(relgapi) $θ(u^i,ui)≲p(m,n)εrelgapi$
where
 relgapi = min |σi − σj| / (σi + σj) j ≠ i
$relgapi= min j≠i |σi-σj| / (σi+σj)$
is the relative gap between σi${\sigma }_{i}$ and the nearest other singular value. The same bound applies to the right singular vector i${\stackrel{^}{v}}_{i}$ and vi${v}_{i}$. Since the relative gap may be much larger than the absolute gap, this error bound may be much smaller than the previous one. The relative gaps may be easily obtained from the computed singular values.

The symmetric eigenproblem

The usual error analysis of the symmetric eigenproblem is as follows (see Parlett (1998)).
The computed eigendecomposition Λ̂T$\stackrel{^}{Z}\stackrel{^}{\Lambda }{\stackrel{^}{Z}}^{\mathrm{T}}$ is nearly the exact eigendecomposition of A + E$A+E$, i.e., A + E = ( + δ)Λ̂( + δ)T$A+E=\left(\stackrel{^}{Z}+\delta \stackrel{^}{Z}\right)\stackrel{^}{\Lambda }{\left(\stackrel{^}{Z}+\delta \stackrel{^}{Z}\right)}^{\mathrm{T}}$ is the true eigendecomposition so that + δ$\stackrel{^}{Z}+\delta \stackrel{^}{Z}$ is orthogonal, where E2 / A2p(n)ε${‖E‖}_{2}/{‖A‖}_{2}\le p\left(n\right)\epsilon$ and δ2p(n)ε${‖\delta \stackrel{^}{Z}‖}_{2}\le p\left(n\right)\epsilon$ and p(n)$p\left(n\right)$ is a modestly growing function of n$n$ and ε$\epsilon$ is the machine precision. Each computed eigenvalue λ̂i${\stackrel{^}{\lambda }}_{i}$ differs from the true λi${\lambda }_{i}$ by an amount satisfying the bound
 |λ̂i − λi| ≤ p(n)ε‖A‖2. $|λ^i-λi|≤p(n)ε‖A‖2.$
Thus large eigenvalues (those near maxi  |λi| = A2 $\underset{i}{\mathrm{max}}\phantom{\rule{0.25em}{0ex}}|{\lambda }_{i}|={‖A‖}_{2}$) are computed to high relative accuracy and small ones may not be.
The angular difference between the computed unit eigenvector i${\stackrel{^}{z}}_{i}$ and the true zi${z}_{i}$ satisfies the approximate bound
 θ(ẑi,zi) ≲ (p(n)ε‖A‖2)/(gapi) $θ(z^i,zi)≲p(n)ε‖A‖2gapi$
if p(n)ε$p\left(n\right)\epsilon$ is small enough, where
 gapi = min |λi − λj| j ≠ i
$gapi= min j≠i |λi-λj|$
is the absolute gap between λi${\lambda }_{i}$ and the nearest other eigenvalue. Thus, if λi${\lambda }_{i}$ is close to other eigenvalues, its corresponding eigenvector zi${z}_{i}$ may be inaccurate. The gaps may be easily obtained from the computed eigenvalues.
Let $\stackrel{^}{\mathbit{S}}$ be the invariant subspace spanned by a collection of eigenvectors {i,iI}$\left\{{\stackrel{^}{z}}_{i},i\in \mathbit{I}\right\}$, where I$\mathbit{I}$ is a subset of the integers from 1$1$ to n$n$. Let S$\mathbit{S}$ be the corresponding true subspace. Then
 θ(Ŝ,S) ≲ (p(n)ε‖A‖2)/(gapI) $θ(S^,S)≲p(n)ε‖A‖2 gapI$
where
 gapI = min {|λi − λj|  for ​i ∈ I,j ∉ I} $gapI=min{|λi-λj| for ​ i∈I,j∉I}$
is the absolute gap between the eigenvalues in I$\mathbit{I}$ and the nearest other eigenvalue. Thus, a cluster of close eigenvalues which is far away from any other eigenvalue may have a well determined invariant subspace $\stackrel{^}{\mathbit{S}}$ even if its individual eigenvectors are ill-conditioned.
In the special case of a real symmetric tridiagonal matrix T$T$, functions in this chapter can compute the eigenvalues and eigenvectors much more accurately. See Anderson et al. (1999) for further details.

The generalized symmetric-definite eigenproblem

The three types of problem to be considered are AλB$A-\lambda B$, ABλI$AB-\lambda I$ and BAλI$BA-\lambda I$. In each case A$A$ and B$B$ are real symmetric (or complex Hermitian) and B$B$ is positive definite. We consider each case in turn, assuming that functions in this chapter are used to transform the generalized problem to the standard symmetric problem, followed by the solution of the symmetric problem. In all cases
 gapi = min |λi − λj| j ≠ i
$gapi= min j≠i |λi-λj|$
is the absolute gap between λi${\lambda }_{i}$ and the nearest other eigenvalue.
1. AλB$A-\lambda B$. The computed eigenvalues λ̂i${\stackrel{^}{\lambda }}_{i}$ can differ from the true eigenvalues λi${\lambda }_{i}$ by an amount
 |λ̂i − λi| ≲ p(n)ε‖B − 1‖2‖A‖2. $|λ^i-λi|≲p(n)ε‖B-1‖2‖A‖2.$
The angular difference between the computed eigenvector i${\stackrel{^}{z}}_{i}$ and the true eigenvector zi${z}_{i}$ is
 θ (ẑi,zi) ≲ ( p(n) ε ‖B − 1‖2 ‖A‖2 (κ2(B)) 1 / 2 )/(gapi) . $θ (z^i,zi) ≲ p(n) ε ‖B-1‖2 ‖A‖2 ( κ2(B) ) 1/2 gapi .$
2. ABλI$AB-\lambda I$ or BAλI$BA-\lambda I$. The computed eigenvalues λ̂i${\stackrel{^}{\lambda }}_{i}$ can differ from the true eigenvalues λi${\lambda }_{i}$ by an amount
 |λ̂i − λi| ≲ p(n)ε‖B‖2‖A‖2. $|λ^i-λi|≲p(n)ε‖B‖2‖A‖2.$
The angular difference between the computed eigenvector i${\stackrel{^}{z}}_{i}$ and the true eigenvector zi${z}_{i}$ is
 θ (ẑi,zi) ≲ (p(n) ε ‖B‖2 ‖A‖2 (κ2(B)) 1 / 2 )/(gapi) . $θ (z^i,zi) ≲ p(n) ε ‖B‖2 ‖A‖2 ( κ2(B) ) 1/2 gapi .$
These error bounds are large when B$B$ is ill-conditioned with respect to inversion (κ2(B)${\kappa }_{2}\left(B\right)$ is large). It is often the case that the eigenvalues and eigenvectors are much better conditioned than indicated here. One way to get tighter bounds is effective when the diagonal entries of B$B$ differ widely in magnitude, as for example with a graded matrix.
1. AλB$A-\lambda B$. Let D = diag(b111 / 2,,bnn1 / 2) $D=\mathrm{diag}\left({b}_{11}^{-1/2},\dots ,{b}_{nn}^{-1/2}\right)$ be a diagonal matrix. Then replace B$B$ by DBD$DBD$ and A$A$ by DAD$DAD$ in the above bounds.
2. ABλI$AB-\lambda I$ or BAλI$BA-\lambda I$. Let D = diag(b111 / 2,,bnn1 / 2)$D=\mathrm{diag}\left({b}_{11}^{-1/2},\dots ,{b}_{nn}^{-1/2}\right)$ be a diagonal matrix. Then replace B$B$ by DBD$DBD$ and A$A$ by D1AD1${D}^{-1}A{D}^{-1}$ in the above bounds.
Further details can be found in Anderson et al. (1999).

The nonsymmetric eigenproblem

The nonsymmetric eigenvalue problem is more complicated than the symmetric eigenvalue problem. In this section, we just summarise the bounds. Further details can be found in Anderson et al. (1999).
We let λ̂i${\stackrel{^}{\lambda }}_{i}$ be the i$i$th computed eigenvalue and λi${\lambda }_{i}$ the i$i$th true eigenvalue. Let i${\stackrel{^}{v}}_{i}$ be the corresponding computed right eigenvector, and vi${v}_{i}$ the true right eigenvector (so Avi = λi vi$A{v}_{i}={\lambda }_{i}{v}_{i}$). If I$\mathbit{I}$ is a subset of the integers from 1$1$ to n$n$, we let λI${\lambda }_{\mathbit{I}}$ denote the average of the selected eigenvalues: λI = (iI λi) / (iI 1)${\lambda }_{\mathbit{I}}=\left(\sum _{i\in \mathbit{I}}\phantom{\rule{0.25em}{0ex}}{\lambda }_{i}\right)/\left(\sum _{i\in \mathbit{I}}\phantom{\rule{0.25em}{0ex}}1\right)$, and similarly for λ̂I${\stackrel{^}{\lambda }}_{\mathbit{I}}$. We also let SI${\mathbit{S}}_{\mathbit{I}}$ denote the subspace spanned by {vi,iI}$\left\{{v}_{i},i\in \mathbit{I}\right\}$; it is called a right invariant subspace because if v$v$ is any vector in SI${\mathbit{S}}_{\mathbit{I}}$ then Av$Av$ is also in SI${\mathbit{S}}_{\mathbit{I}}$. I${\stackrel{^}{\mathbit{S}}}_{\mathbit{I}}$ is the corresponding computed subspace.
The algorithms for the nonsymmetric eigenproblem are normwise backward stable: they compute the exact eigenvalues, eigenvectors and invariant subspaces of slightly perturbed matrices (A + E) E $\left(A+E\right)E$, where E p (n) ε A $‖E‖\le p\left(n\right)\epsilon ‖A‖$. Some of the bounds are stated in terms of E2${‖E‖}_{2}$ and others in terms of EF${‖E‖}_{F}$; one may use p(n)ε$p\left(n\right)\epsilon$ for either quantity.
Functions are provided so that, for each (λ̂i,i${\stackrel{^}{\lambda }}_{i},{\stackrel{^}{v}}_{i}$) pair the two values si${s}_{i}$ and sepi${\mathit{sep}}_{i}$, or for a selected subset I$\mathbit{I}$ of eigenvalues the values sI${s}_{\mathbit{I}}$ and sepI${\mathit{sep}}_{\mathbit{I}}$ can be obtained, for which the error bounds in Table 2 are true for sufficiently small E$‖E‖$, (which is why they are called asymptotic):
 Simple eigenvalue |λ̂i − λi| ≲ ‖E‖2 / si$|{\stackrel{^}{\lambda }}_{i}-{\lambda }_{i}|\lesssim {‖E‖}_{2}/{s}_{i}$ Eigenvalue cluster |λ̂I − λI| ≲ ‖E‖2 / sI$|{\stackrel{^}{\lambda }}_{\mathbit{I}}-{\lambda }_{\mathbit{I}}|\lesssim {‖E‖}_{2}/{s}_{\mathbit{I}}$ Eigenvector θ(v̂i,vi) ≲ ‖E‖F / sepi$\theta \left({\stackrel{^}{v}}_{i},{v}_{i}\right)\lesssim {‖E‖}_{F}/{\mathit{sep}}_{i}$ Invariant subspace θ(ŜI,SI) ≲ ‖E‖F / sepI$\theta \left({\stackrel{^}{S}}_{\mathbit{I}},{S}_{\mathbit{I}}\right)\lesssim {‖E‖}_{F}/{\mathit{sep}}_{\mathbit{I}}$
Table 2
Asymptotic error bounds for the nonsymmetric eigenproblem
If the problem is ill-conditioned, the asymptotic bounds may only hold for extremely small E$‖E‖$. The global error bounds of Table 3 are guaranteed to hold for all EF < s × sep / 4${‖E‖}_{F}:
 Simple eigenvalue |λ̂i − λi| ≤ n‖E‖2 / si$|{\stackrel{^}{\lambda }}_{i}-{\lambda }_{i}|\le n{‖E‖}_{2}/{s}_{i}$ Holds for all E$E$ Eigenvalue cluster |λ̂I − λI| ≤ 2‖E‖2 / sI$|{\stackrel{^}{\lambda }}_{\mathbit{I}}-{\lambda }_{\mathbit{I}}|\le 2{‖E‖}_{2}/{s}_{\mathbit{I}}$ Requires ‖E‖F < sI × sepI / 4${‖E‖}_{F}<{s}_{\mathbit{I}}×{\mathit{sep}}_{\mathbit{I}}/4$ Eigenvector θ(v̂i,vi) ≤ arctan(2‖E‖F / (sepi − 4‖E‖F / si))$\theta \left({\stackrel{^}{v}}_{i},{v}_{i}\right)\le \mathrm{arctan}\left(2{‖E‖}_{F}/\left({\mathit{sep}}_{i}-4{‖E‖}_{F}/{s}_{i}\right)\right)$ Requires ‖E‖F < si × sepi / 4${‖E‖}_{F}<{s}_{i}×{\mathit{sep}}_{i}/4$ Invariant subspace θ(ŜI,SI) ≤ arctan(2‖E‖F / (sepI − 4‖E‖F / sI))$\theta \left({\stackrel{^}{S}}_{\mathbit{I}},{S}_{\mathbit{I}}\right)\le \mathrm{arctan}\left(2{‖E‖}_{F}/\left({\mathit{sep}}_{\mathbit{I}}-4{‖E‖}_{F}/{s}_{\mathbit{I}}\right)\right)$ Requires ‖E‖F < sI × sepI / 4${‖E‖}_{F}<{s}_{\mathbit{I}}×{\mathit{sep}}_{\mathbit{I}}/4$
Table 3
Global error bounds for the nonsymmetric eigenproblem

Balancing and condition for the nonsymmetric eigenproblem

There are two preprocessing steps one may perform on a matrix A$A$ in order to make its eigenproblem easier. The first is permutation, or reordering the rows and columns to make A$A$ more nearly upper triangular (closer to Schur form): A = PAPT${A}^{\prime }=PA{P}^{\mathrm{T}}$, where P$P$ is a permutation matrix. If A${A}^{\prime }$ is permutable to upper triangular form (or close to it), then no floating point operations (or very few) are needed to reduce it to Schur form. The second is scaling by a diagonal matrix D$D$ to make the rows and columns of A${A}^{\prime }$ more nearly equal in norm: A = DAD1${A}^{\prime \prime }=D{A}^{\prime }{D}^{-1}$. Scaling can make the matrix norm smaller with respect to the eigenvalues, and so possibly reduce the inaccuracy contributed by roundoff (see Chapter 11 of Wilkinson and Reinsch (1971)). We refer to these two operations as balancing.
Permuting has no effect on the condition numbers or their interpretation as described previously. Scaling, however, does change their interpretation and further details can be found in Anderson et al. (1999).

The generalized nonsymmetric eigenvalue problem

The algorithms for the generalized nonsymmetric eigenvalue problem are normwise backward stable: they compute the exact eigenvalues (as the pairs (α,β)$\left(\alpha ,\beta \right)$), eigenvectors and deflating subspaces of slightly perturbed pairs (A + E,B + F)$\left(A+E,B+F\right)$, where
 ‖(E,F)‖F ≤ p(n)ε‖(A,B)‖F. $‖(E,F)‖F≤p(n)ε‖(A,B)‖F.$
Asymptotic and global error bounds can be obtained, which are generalizations of those given in Tables 2 and 3. See Section 4.11 of Anderson et al. (1999) for details. Functions are provided to compute estimates of reciprocal conditions numbers for eigenvalues and eigenspaces.

Balancing the generalized eigenvalue problem

As with the standard nonsymmetric eigenvalue problem, there are two preprocessing steps one may perform on a matrix pair (A,B)$\left(A,B\right)$ in order to make its eigenproblem easier; permutation and scaling, which together are referred to as balancing, as indicated in the following two steps.
1. The balancing function first attempts to permute A$A$ and B$B$ to block upper triangular form by a similarity transformation:
$PAPT=F= F11 F12 F13 F22 F23 F33 , PBPT=G= G11 G12 G13 G22 G23 G33 ,$
 PAPT = F = ( F11 F12 F13 F22 F23 F33 ),
 PBPT = G = ( G11 G12 G13 G22 G23 G33 ),
where P$P$ is a permutation matrix, F11${F}_{11}$, F33${F}_{33}$, G11${G}_{11}$ and G33${G}_{33}$ are upper triangular. Then the diagonal elements of the matrix (F11,G11)$\left({F}_{11},{G}_{11}\right)$ and (G33,H33)$\left({G}_{33},{H}_{33}\right)$ are generalized eigenvalues of (A,B)$\left(A,B\right)$. The rest of the generalized eigenvalues are given by the matrix pair (F22,G22)$\left({F}_{22},{G}_{22}\right)$. Subsequent operations to compute the eigenvalues of (A,B)$\left(A,B\right)$ need only be applied to the matrix (F22,G22)$\left({F}_{22},{G}_{22}\right)$; this can save a significant amount of work if (F22,G22)$\left({F}_{22},{G}_{22}\right)$ is smaller than the original matrix pair (A,B)$\left(A,B\right)$. If no suitable permutation exists (as is often the case), then there is no gain in efficiency or accuracy.
2. The balancing function applies a diagonal similarity transformation to (F,G)$\left(F,G\right)$, to make the rows and columns of (F22,G22)$\left({F}_{22},{G}_{22}\right)$ as close as possible in the norm:
$DFD-1= I D22 I F11 F12 F13 F22 F23 F33 I D22-1 I , DGD-1= I D22 I G11 G12 G13 G22 G23 G33 I D22-1 I .$
 DFD − 1 = ( I D22 I ) ( F11 F12 F13 F22 F23 F33 ) ( I D22 − 1 I ),
 DGD − 1 = ( I D22 I ) ( G11 G12 G13 G22 G23 G33 ) ( I D22 − 1 I ) .
This transformation usually improves the accuracy of computed generalized eigenvalues and eigenvectors. However, there are exceptional occasions when this transformation increases the norm of the pencil; in this case accuracy could be lower with diagonal balancing.
See Anderson et al. (1999) for further details.

Other problems

Error bounds for other problems such as the generalized linear least squares problem and generalized singular value decomposition can be found in Anderson et al. (1999).

Block Partitioned Algorithms

A number of the functions in this chapter use what is termed a block partitioned algorithm. This means that at each major step of the algorithm a block of rows or columns is updated, and much of the computation is performed by matrix-matrix operations on these blocks. The matrix-matrix operations are performed by calls to the Level 3 BLAS which are the key to achieving high performance on many modern computers. In the case of the QR$QR$ algorithm for reducing an upper Hessenberg matrix to Schur form, a multishift strategy is used in order to improve performance. See Golub and Van Loan (1996) or Anderson et al. (1999) for more about block partitioned algorithms and the multishift strategy.
The performance of a block partitioned algorithm varies to some extent with the block size – that is, the number of rows or columns per block. This is a machine-dependent parameter, which is set to a suitable value when the library is implemented on each range of machines. You do not normally need to be aware of what value is being used. Different block sizes may be used for different functions. Values in the range 16$16$ to 64$64$ are typical.
On more conventional machines there is often no advantage from using a block partitioned algorithm, and then the functions use an unblocked algorithm (effectively a block size of 1$1$), relying solely on calls to the Level 2 BLAS

Recommendations on Choice and Use of Available Functions

Available Functions

The tables in the following sub-sections show the functions which are provided for performing different computations on different types of matrices. Each entry in the table gives the NAG function name and the LAPACK double precision name .
Black box (or driver) functions are provided for the solution of most problems. In a number of cases there are simple drivers, which just return the solution to the problem, as well as expert drivers, which return additional information, such as condition number estimates, and may offer additional facilities such as balancing. The following sub-sections give tables for the driver functions.

Driver functions

Linear least squares problems (LLS)
 Operation real complex solve LLS using QR$QR$ or LQ$LQ$ factorization solve LLS using complete orthogonal factorization solve LLS using SVD solve LLS using divide-and-conquer SVD nag_lapack_dgels (f08aa) nag_lapack_dgelsy (f08ba) nag_lapack_dgelss (f08ka) nag_lapack_dgelsd (f08kc) nag_lapack_zgels (f08an) nag_lapack_zgelsy (f08bn) nag_lapack_zgelss (f08kn) nag_lapack_zgelsd (f08kq)
Generalized linear least squares problems (LSE and GLM)
 Operation real complex solve LSE problem using GRQ solve GLM problem using GQR nag_lapack_dgglse (f08za) nag_lapack_dggglm (f08zb) nag_lapack_zgglse (f08zn) nag_lapack_zggglm (f08zp)
Symmetric eigenvalue problems (SEP)
 Function and storage scheme real complex simple driver divide-and-conquer driver expert driver RRR driver nag_lapack_dsyev (f08fa) nag_lapack_dsyevd (f08fc) nag_lapack_dsyevx (f08fb) nag_lapack_dsyevr (f08fd) nag_lapack_zheev (f08fn) nag_lapack_zheevd (f08fq) nag_lapack_zheevx (f08fp) nag_lapack_zheevr (f08fr) packed storage simple driver divide-and-conquer driver expert driver nag_lapack_dspev (f08ga) nag_lapack_dspevd (f08gc) nag_lapack_dspevx (f08gb) nag_lapack_zhpev (f08gn) nag_lapack_zhpevd (f08gq) nag_lapack_zhpevx (f08gp) band matrix simple driver divide-and-conquer driver expert driver nag_lapack_dsbev (f08ha) nag_lapack_dsbevd (f08hc) nag_lapack_dsbevx (f08hb) nag_lapack_zhbev (f08hn) nag_lapack_zhbevd (f08hq) nag_lapack_zhbevx (f08hp) tridiagonal matrix simple driver divide-and-conquer driver expert driver RRR driver nag_lapack_dstev (f08ja) nag_lapack_dstevd (f08jc) nag_lapack_dstevx (f08jb) nag_lapack_dstevr (f08jd)
Nonsymmetric eigenvalue problem (NEP)
 Function and storage scheme real complex simple driver for Schur factorization expert driver for Schur factorization simple driver for eigenvalues/vectors expert driver for eigenvalues/vectors nag_lapack_dgees (f08pa) nag_lapack_dgeesx (f08pb) nag_lapack_dgeev (f08na) nag_lapack_dgeevx (f08nb) nag_lapack_zgees (f08pn) nag_lapack_zgeesx (f08pp) nag_lapack_zgeev (f08nn) nag_lapack_zgeevx (f08np)
Singular value decomposition (SVD)
 Function and storage scheme real complex simple driver divide-and-conquer driver simple driver for one-sided Jacobi SVD expert driver for one-sided Jacobi SVD nag_lapack_dgesvd (f08kb) nag_lapack_dgesdd (f08kd) nag_lapack_dgesvj (f08kj) nag_lapack_dgejsv (f08kh) nag_lapack_zgesvd (f08kp) nag_lapack_zgesdd (f08kr)
Generalized symmetric definite eigenvalue problems (GSEP)
 Function and storage scheme real complex simple driver divide-and-conquer driver expert driver nag_lapack_dsygv (f08sa) nag_lapack_dsygvd (f08sc) nag_lapack_dsygvx (f08sb) nag_lapack_zhegv (f08sn) nag_lapack_zhegvd (f08sq) nag_lapack_zhegvx (f08sp) packed storage simple driver divide-and-conquer driver expert driver nag_lapack_dspgv (f08ta) nag_lapack_dspgvd (f08tc) nag_lapack_dspgvx (f08tb) nag_lapack_zhpgv (f08tn) nag_lapack_zhpgvd (f08tq) nag_lapack_zhpgvx (f08tp) band matrix simple driver divide-and-conquer driver expert driver nag_lapack_dsbgv (f08ua) nag_lapack_dsbgvd (f08uc) nag_lapack_dsbgvx (f08ub) nag_lapack_zhbgv (f08un) nag_lapack_zhbgvd (f08uq) nag_lapack_zhbgvx (f08up)
Generalized nonsymmetric eigenvalue problem (GNEP)
 Function and storage scheme real complex simple driver for Schur factorization expert driver for Schur factorization simple driver for eigenvalues/vectors expert driver for eigenvalues/vectors nag_lapack_dgges (f08xa) nag_lapack_dggesx (f08xb) nag_lapack_dggev (f08wa) nag_lapack_dggevx (f08wb) nag_lapack_zgges (f08xn) nag_lapack_zggesx (f08xp) nag_lapack_zggev (f08wn) nag_lapack_zggevx (f08wp)
Generalized singular value decomposition (GSVD)
 Function and storage scheme real complex singular values/vectors nag_lapack_dggsvd (f08va) nag_lapack_zggsvd (f08vn)

Computational functions

It is possible to solve problems by calling two or more functions in sequence. Some common sequences of functions are indicated in the tables in the following sub-sections; an asterisk ( * $*$) against a function name means that the sequence of calls is illustrated in the example program for that function.
Orthogonal factorizations
Functions are provided for QR$QR$ factorization (with and without column pivoting), and for LQ$LQ$, QL$QL$ and RQ$RQ$ factorizations (without pivoting only), of a general real or complex rectangular matrix. A function is also provided for the RQ$RQ$ factorization of a real or complex upper trapezoidal matrix. (LAPACK refers to this as the RZ$RZ$ factorization.)
The factorization functions do not form the matrix Q$Q$ explicitly, but represent it as a product of elementary reflectors (see Section [Representation of orthogonal or unitary matrices]). Additional functions are provided to generate all or part of Q$Q$ explicitly if it is required, or to apply Q$Q$ in its factored form to another matrix (specifically to compute one of the matrix products QC$QC$, QTC${Q}^{\mathrm{T}}C$, CQ$CQ$ or CQT$C{Q}^{\mathrm{T}}$ with QT${Q}^{\mathrm{T}}$ replaced by QH${Q}^{\mathrm{H}}$ if C$C$ and Q$Q$ are complex).
 Factorize without pivoting Factorize with pivoting Generate matrix Q$\mathbit{Q}$ Apply matrix Q$\mathbit{Q}$ QR$QR$ factorization, real matrices nag_lapack_dgeqrf (f08ae) nag_lapack_dgeqp3 (f08bf) nag_lapack_dorgqr (f08af) nag_lapack_dormqr (f08ag) LQ$LQ$ factorization, real matrices nag_lapack_dgelqf (f08ah) nag_lapack_dorglq (f08aj) nag_lapack_dormlq (f08ak) QL$QL$ factorization, real matrices nag_lapack_dgeqlf (f08ce) nag_lapack_dorgql (f08cf) nag_lapack_dormql (f08cg) RQ$RQ$ factorization, real matrices nag_lapack_dgerqf (f08ch) nag_lapack_dorgrq (f08cj) nag_lapack_dormrq (f08ck) RQ$RQ$ factorization, real upper trapezoidal matrices nag_lapack_dtzrzf (f08bh) nag_lapack_dormrz (f08bk) QR$QR$ factorization, complex matrices nag_lapack_zgeqrf (f08as) nag_lapack_zgeqp3 (f08bt) nag_lapack_zungqr (f08at) nag_lapack_zunmqr (f08au) LQ$LQ$ factorization, complex matrices nag_lapack_zgelqf (f08av) nag_lapack_zunglq (f08aw) nag_lapack_zunmlq (f08ax) QL$QL$ factorization, complex matrices nag_lapack_zgeqlf (f08cs) nag_lapack_zungql (f08ct) nag_lapack_zunmql (f08cu) RQ$RQ$ factorization, complex matrices nag_lapack_zgerqf (f08cv) nag_lapack_zungrq (f08cw) nag_lapack_zunmrq (f08cx) RQ$RQ$ factorization, complex upper trapezoidal matrices nag_lapack_ztzrzf (f08bv) nag_lapack_zunmrz (f08bx)
To solve linear least squares problems, as described in Sections [ factorization] or [ factorization with column pivoting], functions based on the QR$QR$ factorization can be used:
 real data, full-rank problem nag_lapack_dgeqrf (f08ae)*, nag_lapack_dormqr (f08ag) complex data, full-rank problem nag_lapack_zgeqrf (f08as)*, nag_lapack_zunmqr (f08au) real data, rank-deficient problem nag_lapack_dgeqp3 (f08bf)*, nag_lapack_dormqr (f08ag) complex data, rank-deficient problem nag_lapack_zgeqp3 (f08bt)*, nag_lapack_zunmqr (f08au)
To find the minimum norm solution of under-determined systems of linear equations, as described in Section [ factorization], functions based on the LQ$LQ$ factorization can be used:
 real data, full-rank problem nag_lapack_dgelqf (f08ah)*, nag_lapack_dormlq (f08ak) complex data, full-rank problem nag_lapack_zgelqf (f08av)*, nag_lapack_zunmlq (f08ax)
Generalized orthogonal factorizations
Functions are provided for the generalized QR$QR$ and RQ$RQ$ factorizations of real and complex matrix pairs.
 Factorize Generalized QR$QR$ factorization, real matrices nag_lapack_dggqrf (f08ze) Generalized RQ$RQ$ factorization, real matrices nag_lapack_dggrqf (f08zf) Generalized QR$QR$ factorization, complex matrices nag_lapack_zggqrf (f08zs) Generalized RQ$RQ$ factorization, complex matrices nag_lapack_zggrqf (f08zt)
Singular value problems
Functions are provided to reduce a general real or complex rectangular matrix A$A$ to real bidiagonal form B$B$ by an orthogonal transformation A = QBPT$A=QB{P}^{\mathrm{T}}$ (or by a unitary transformation A = QBPH$A=QB{P}^{\mathrm{H}}$ if A$A$ is complex). Different functions allow a full matrix A$A$ to be stored conventionally (see Section [Conventional storage]), or a band matrix to use band storage (see Section [Band storage] in the F07 Chapter Introduction).
The functions for reducing full matrices do not form the matrix Q$Q$ or P$P$ explicitly; additional functions are provided to generate all or part of them, or to apply them to another matrix, as with the functions for orthogonal factorizations. Explicit generation of Q$Q$ or P$P$ is required before using the bidiagonal QR$QR$ algorithm to compute left or right singular vectors of A$A$.
The functions for reducing band matrices have options to generate Q$Q$ or P$P$ if required.
Further functions are provided to compute all or part of the singular value decomposition of a real bidiagonal matrix; the same functions can be used to compute the singular value decomposition of a real or complex matrix that has been reduced to bidiagonal form.
 Reduce to bidiagonal form Generate matrix Q$\mathbit{Q}$ or PT${\mathbit{P}}^{\mathrm{T}}$ Apply matrix Q$\mathbit{Q}$ or P$\mathbit{P}$ Reduce band matrix to bidiagonal form SVD of bidiagonal form (QR$\mathbit{QR}$ algorithm) SVD of bidiagonal form (divide and conquer) real matrices nag_lapack_dgebrd (f08ke) nag_lapack_dorgbr (f08kf) nag_lapack_dormbr (f08kg) nag_lapack_dgbbrd (f08le) nag_lapack_dbdsqr (f08me) nag_lapack_dbdsdc (f08md) complex matrices nag_lapack_zgebrd (f08ks) nag_lapack_zungbr (f08kt) nag_lapack_zunmbr (f08ku) nag_lapack_zgbbrd (f08ls) nag_lapack_zbdsqr (f08ms)
Given the singular values, nag_lapack_ddisna (f08fl) is provided to compute the reciprocal condition numbers for the left or right singular vectors of a real or complex matrix.
To compute the singular values and vectors of a rectangular matrix, as described in Section [The Singular Value Decomposition], use the following sequence of calls:
Rectangular matrix (standard storage)
 real matrix, singular values and vectors nag_lapack_dgebrd (f08ke), nag_lapack_dorgbr (f08kf)*, nag_lapack_dbdsqr (f08me) complex matrix, singular values and vectors nag_lapack_zgebrd (f08ks), nag_lapack_zungbr (f08kt)*, nag_lapack_zbdsqr (f08ms)
Rectangular matrix (banded)
 real matrix, singular values and vectors nag_lapack_dgbbrd (f08le), nag_lapack_dorgbr (f08kf), nag_lapack_dbdsqr (f08me) complex matrix, singular values and vectors nag_lapack_zgbbrd (f08ls), nag_lapack_zungbr (f08kt), nag_lapack_zbdsqr (f08ms)
To use the singular value decomposition to solve a linear least squares problem, as described in Section [The Singular Value Decomposition and Least Squares Problems], the following functions are required:
Generalized singular value decomposition
Functions are provided to compute the generalized SVD of a real or complex matrix pair (A,B)$\left(A,B\right)$ in upper trapezoidal form. Functions are also provided to reduce a general real or complex matrix pair to the required upper trapezoidal form.
 Reduce to trapezoidal form Generalized SVD of trapezoidal form real matrices nag_lapack_dggsvp (f08ve) nag_lapack_dtgsja (f08ye) complex matrices nag_lapack_zggsvp (f08vs) nag_lapack_ztgsja (f08ys)
Symmetric eigenvalue problems
Functions are provided to reduce a real symmetric or complex Hermitian matrix A$A$ to real tridiagonal form T$T$ by an orthogonal similarity transformation A = QTQT$A=QT{Q}^{\mathrm{T}}$ (or by a unitary transformation A = QTQH$A=QT{Q}^{\mathrm{H}}$ if A$A$ is complex). Different functions allow a full matrix A$A$ to be stored conventionally (see Section [Conventional storage] in the F07 Chapter Introduction) or in packed storage (see Section [Packed storage] in the F07 Chapter Introduction); or a band matrix to use band storage (see Section [Band storage] in the F07 Chapter Introduction).
The functions for reducing full matrices do not form the matrix Q$Q$ explicitly; additional functions are provided to generate Q$Q$, or to apply it to another matrix, as with the functions for orthogonal factorizations. Explicit generation of Q$Q$ is required before using the QR$QR$ algorithm to find all the eigenvectors of A$A$; application of Q$Q$ to another matrix is required after eigenvectors of T$T$ have been found by inverse iteration, in order to transform them to eigenvectors of A$A$.
The functions for reducing band matrices have an option to generate Q$Q$ if required.
 Reduce to tridiagonal form Generate matrix Q$\mathbit{Q}$ Apply matrix Q$\mathbit{Q}$ real symmetric matrices nag_lapack_dsytrd (f08fe) nag_lapack_dorgtr (f08ff) nag_lapack_dormtr (f08fg) real symmetric matrices (packed storage) nag_lapack_dsptrd (f08ge) nag_lapack_dopgtr (f08gf) nag_lapack_dopmtr (f08gg) real symmetric band matrices nag_lapack_dsbtrd (f08he) complex Hermitian matrices nag_lapack_zhetrd (f08fs) nag_lapack_zungtr (f08ft) nag_lapack_zunmtr (f08fu) complex Hermitian matrices (packed storage) nag_lapack_zhptrd (f08gs) nag_lapack_zupgtr (f08gt) nag_lapack_zupmtr (f08gu) complex Hermitian band matrices nag_lapack_zhbtrd (f08hs)
Given the eigenvalues, nag_lapack_ddisna (f08fl) is provided to compute the reciprocal condition numbers for the eigenvectors of a real symmetric or complex Hermitian matrix.
A variety of functions are provided to compute eigenvalues and eigenvectors of the real symmetric tridiagonal matrix T$T$, some computing all eigenvalues and eigenvectors, some computing selected eigenvalues and eigenvectors. The same functions can be used to compute eigenvalues and eigenvectors of a real symmetric or complex Hermitian matrix which has been reduced to tridiagonal form.
Eigenvalues and eigenvectors of real symmetric tridiagonal matrices:
The original (non-reduced) matrix is Real or Complex Hermitian
 all eigenvalues (root-free QR$QR$ algorithm) nag_lapack_dsterf (f08jf) all eigenvalues (root-free QR$QR$ algorithm called by divide-and-conquer) nag_lapack_dstevd (f08jc) or nag_lapack_dstedc (f08jh) all eigenvalues (RRR) nag_lapack_dstegr (f08jl) selected eigenvalues (bisection) nag_lapack_dstebz (f08jj)
The original (non-reduced) matrix is Real
 all eigenvalues and eigenvectors (QR$QR$ algorithm) nag_lapack_dsteqr (f08je) all eigenvalues and eigenvectors (divide-and-conquer) nag_lapack_dstevd (f08jc) or nag_lapack_dstedc (f08jh) all eigenvalues and eigenvectors (RRR) nag_lapack_dstegr (f08jl) all eigenvalues and eigenvectors (positive definite case) nag_lapack_dpteqr (f08jg) selected eigenvectors (inverse iteration) nag_lapack_dstein (f08jk)
The original (non-reduced) matrix is Complex Hermitian
 all eigenvalues and eigenvectors (QR$QR$ algorithm) nag_lapack_zsteqr (f08js) all eigenvalues and eigenvectors (divide and conquer) nag_lapack_zstedc (f08jv) all eigenvalues and eigenvectors (RRR) nag_lapack_zstegr (f08jy) all eigenvalues and eigenvectors (positive definite case) nag_lapack_zpteqr (f08ju) selected eigenvectors (inverse iteration) nag_lapack_zstein (f08jx)
The following sequences of calls may be used to compute various combinations of eigenvalues and eigenvectors, as described in Section [Symmetric Eigenvalue Problems].
Sequences for computing eigenvalues and eigenvectors
Real Symmetric matrix (standard storage)
 all eigenvalues and eigenvectors (using divide-and-conquer) nag_lapack_dsyevd (f08fc) all eigenvalues and eigenvectors (using QR$QR$ algorithm) nag_lapack_dsytrd (f08fe), nag_lapack_dorgtr (f08ff)*, nag_lapack_dsteqr (f08je) all eigenvalues and eigenvectors (RRR) nag_lapack_dsytrd (f08fe), nag_lapack_dormtr (f08fg), nag_lapack_dstegr (f08jl) selected eigenvalues and eigenvectors (bisection and inverse iteration) nag_lapack_dsytrd (f08fe), nag_lapack_dormtr (f08fg), nag_lapack_dstebz (f08jj), nag_lapack_dstein (f08jk)*
Real Symmetric matrix (packed storage)
 all eigenvalues and eigenvectors (using divide-and-conquer) nag_lapack_dspevd (f08gc) all eigenvalues and eigenvectors (using QR$QR$ algorithm) nag_lapack_dsptrd (f08ge), nag_lapack_dopgtr (f08gf)*, nag_lapack_dsteqr (f08je) all eigenvalues and eigenvectors (RRR) nag_lapack_dsptrd (f08ge), nag_lapack_dopmtr (f08gg), nag_lapack_dstegr (f08jl) selected eigenvalues and eigenvectors (bisection and inverse iteration) nag_lapack_dsptrd (f08ge), nag_lapack_dopmtr (f08gg), nag_lapack_dstebz (f08jj), nag_lapack_dstein (f08jk)*
Real Symmetric banded matrix
 all eigenvalues and eigenvectors (using divide-and-conquer) nag_lapack_dsbevd (f08hc) all eigenvalues and eigenvectors (using QR$QR$ algorithm) nag_lapack_dsbtrd (f08he)*, nag_lapack_dsteqr (f08je)
Complex Hermitian matrix (standard storage)
 all eigenvalues and eigenvectors (using divide-and-conquer) nag_lapack_zheevd (f08fq) all eigenvalues and eigenvectors (using QR$QR$ algorithm) nag_lapack_zhetrd (f08fs), nag_lapack_zungtr (f08ft)*, nag_lapack_zsteqr (f08js) all eigenvalues and eigenvectors (RRR) nag_lapack_zhetrd (f08fs), nag_lapack_zunmtr (f08fu), nag_lapack_zstegr (f08jy) selected eigenvalues and eigenvectors (bisection and inverse iteration) nag_lapack_zhetrd (f08fs), nag_lapack_zunmtr (f08fu), nag_lapack_dstebz (f08jj), nag_lapack_zstein (f08jx)*
Complex Hermitian matrix (packed storage)
 all eigenvalues and eigenvectors (using divide-and-conquer) nag_lapack_zhpevd (f08gq) all eigenvalues and eigenvectors (using QR$QR$ algorithm) nag_lapack_zhptrd (f08gs), nag_lapack_zupgtr (f08gt)*, nag_lapack_zsteqr (f08js) all eigenvalues and eigenvectors (RRR) nag_lapack_zhptrd (f08gs), nag_lapack_zupmtr (f08gu) and nag_lapack_zstegr (f08jy) selected eigenvalues and eigenvectors (bisection and inverse iteration) nag_lapack_zhptrd (f08gs), nag_lapack_zupmtr (f08gu), nag_lapack_dstebz (f08jj), nag_lapack_zstein (f08jx)*
Complex Hermitian banded matrix
 all eigenvalues and eigenvectors (using divide-and-conquer) nag_lapack_zhbevd (f08hq) all eigenvalues and eigenvectors (using QR$QR$ algorithm) nag_lapack_zhbtrd (f08hs)*, nag_lapack_zsteqr (f08js)
Generalized symmetric-definite eigenvalue problems
Functions are provided for reducing each of the problems Ax = λBx$Ax=\lambda Bx$, ABx = λx$ABx=\lambda x$ or BAx = λx$BAx=\lambda x$ to an equivalent standard eigenvalue problem Cy = λy$Cy=\lambda y$. Different functions allow the matrices to be stored either conventionally or in packed storage. The positive definite matrix B$B$ must first be factorized using a function from Chapter F07. There is also a function which reduces the problem Ax = λBx$Ax=\lambda Bx$ where A$A$ and B$B$ are banded, to an equivalent banded standard eigenvalue problem; this uses a split Cholesky factorization for which a function in Chapter F08 is provided.
 Reduce to standard problem Reduce to standard problem (packed storage) Reduce to standard problem (band matrices) real symmetric matrices nag_lapack_dsygst (f08se) nag_lapack_dspgst (f08te) nag_lapack_dsbgst (f08ue) complex Hermitian matrices nag_lapack_zhegst (f08ss) nag_lapack_zhpgst (f08ts) nag_lapack_zhbgst (f08us)
The equivalent standard problem can then be solved using the functions discussed in Section [Symmetric eigenvalue problems]. For example, to compute all the eigenvalues, the following functions must be called:
 real symmetric-definite problem nag_lapack_dpotrf (f07fd), nag_lapack_dsygst (f08se)*, nag_lapack_dsytrd (f08fe), nag_lapack_dsterf (f08jf) real symmetric-definite problem, packed storage nag_lapack_dpptrf (f07gd), nag_lapack_dspgst (f08te)*, nag_lapack_dsptrd (f08ge), nag_lapack_dsterf (f08jf) real symmetric-definite banded problem nag_lapack_dpbstf (f08uf)*, nag_lapack_dsbgst (f08ue)*, nag_lapack_dsbtrd (f08he), nag_lapack_dsterf (f08jf) complex Hermitian-definite problem nag_lapack_zpotrf (f07fr), nag_lapack_zhegst (f08ss)*, nag_lapack_zhetrd (f08fs), nag_lapack_dsterf (f08jf) complex Hermitian-definite problem, packed storage nag_lapack_zpptrf (f07gr), nag_lapack_zhpgst (f08ts)*, nag_lapack_zhptrd (f08gs), nag_lapack_dsterf (f08jf) complex Hermitian-definite banded problem nag_lapack_zpbstf (f08ut)*, nag_lapack_zhbgst (f08us)*, nag_lapack_zhbtrd (f08hs), nag_lapack_dsterf (f08jf)
If eigenvectors are computed, the eigenvectors of the equivalent standard problem must be transformed back to those of the original generalized problem, as indicated in Section [Generalized Symmetric-definite Eigenvalue Problems]; functions from may be used for this.
Nonsymmetric eigenvalue problems
Functions are provided to reduce a general real or complex matrix A$A$ to upper Hessenberg form H$H$ by an orthogonal similarity transformation A = QHQT$A=QH{Q}^{\mathrm{T}}$ (or by a unitary transformation A = QHQH$A=QH{Q}^{\mathrm{H}}$ if A$A$ is complex).
These functions do not form the matrix Q$Q$ explicitly; additional functions are provided to generate Q$Q$, or to apply it to another matrix, as with the functions for orthogonal factorizations. Explicit generation of Q$Q$ is required before using the QR$QR$ algorithm on H$H$ to compute the Schur vectors; application of Q$Q$ to another matrix is needed after eigenvectors of H$H$ have been computed by inverse iteration, in order to transform them to eigenvectors of A$A$.
Functions are also provided to balance the matrix before reducing it to Hessenberg form, as described in Section [Balancing and condition for the nonsymmetric eigenproblem]. Companion functions are required to transform Schur vectors or eigenvectors of the balanced matrix to those of the original matrix.
 Reduce to Hessenberg form Generate matrix Q$\mathbit{Q}$ Apply matrix Q$\mathbit{Q}$ Balance Back­transform vectors after balancing real matrices nag_lapack_dgehrd (f08ne) nag_lapack_dorghr (f08nf) nag_lapack_dormhr (f08ng) nag_lapack_dgebal (f08nh) nag_lapack_dgebak (f08nj) complex matrices nag_lapack_zgehrd (f08ns) nag_lapack_zunghr (f08nt) nag_lapack_zunmhr (f08nu) nag_lapack_zgebal (f08nv) nag_lapack_zgebak (f08nw)
Functions are provided to compute the eigenvalues and all or part of the Schur factorization of an upper Hessenberg matrix. Eigenvectors may be computed either from the upper Hessenberg form by inverse iteration, or from the Schur form by back-substitution; these approaches are equally satisfactory for computing individual eigenvectors, but the latter may provide a more accurate basis for a subspace spanned by several eigenvectors.
Additional functions estimate the sensitivities of computed eigenvalues and eigenvectors, as discussed in Section [The nonsymmetric eigenproblem].
 Eigenvalues and Schur factorization (QR$\mathbit{QR}$ algorithm) Eigenvectors from Hessenberg form (inverse iteration) Eigenvectors from Schur factorization Sensitivities of eigenvalues and eigenvectors real matrices nag_lapack_dhseqr (f08pe) nag_lapack_dhsein (f08pk) nag_lapack_dtrevc (f08qk) nag_lapack_dtrsna (f08ql) complex matrices nag_lapack_zhseqr (f08ps) nag_lapack_zhsein (f08px) nag_lapack_ztrevc (f08qx) nag_lapack_ztrsna (f08qy)
Finally functions are provided for reordering the Schur factorization, so that eigenvalues appear in any desired order on the diagonal of the Schur form. The functions nag_lapack_dtrexc (f08qf) and nag_lapack_ztrexc (f08qt) simply swap two diagonal elements or blocks, and may need to be called repeatedly to achieve a desired order. The functions nag_lapack_dtrsen (f08qg) and nag_lapack_ztrsen (f08qu) perform the whole reordering process for the important special case where a specified cluster of eigenvalues is to appear at the top of the Schur form; if the Schur vectors are reordered at the same time, they yield an orthonormal basis for the invariant subspace corresponding to the specified cluster of eigenvalues. These functions can also compute the sensitivities of the cluster of eigenvalues and the invariant subspace.
 Reorder Schur factorization Reorder Schur factorization, find basis for invariant subspace and estimate sensitivities real matrices nag_lapack_dtrexc (f08qf) nag_lapack_dtrsen (f08qg) complex matrices nag_lapack_ztrexc (f08qt) nag_lapack_ztrsen (f08qu)
The following sequences of calls may be used to compute various combinations of eigenvalues, Schur vectors and eigenvectors, as described in Section [Nonsymmetric Eigenvalue Problems]:
 real matrix, all eigenvalues and Schur factorization nag_lapack_dgehrd (f08ne), nag_lapack_dorghr (f08nf)*, nag_lapack_dhseqr (f08pe) real matrix, all eigenvalues and selected eigenvectors nag_lapack_dgehrd (f08ne), nag_lapack_dormhr (f08ng), nag_lapack_dhseqr (f08pe), nag_lapack_dhsein (f08pk) real matrix, all eigenvalues and eigenvectors (with balancing) nag_lapack_dgebal (f08nh)*, nag_lapack_dgehrd (f08ne), nag_lapack_dorghr (f08nf), nag_lapack_dgebak (f08nj), nag_lapack_dhseqr (f08pe), nag_lapack_dhsein (f08pk) complex matrix, all eigenvalues and Schur factorization nag_lapack_zgehrd (f08ns), nag_lapack_zunghr (f08nt)*, nag_lapack_zhseqr (f08ps) complex matrix, all eigenvalues and selected eigenvectors nag_lapack_zgehrd (f08ns), nag_lapack_zunmhr (f08nu), nag_lapack_zhseqr (f08ps), nag_lapack_zhsein (f08px)* complex matrix, all eigenvalues and eigenvectors (with balancing) nag_lapack_zgebal (f08nv)*, nag_lapack_zgehrd (f08ns), nag_lapack_zunghr (f08nt), nag_lapack_zgebak (f08nw), nag_lapack_zhseqr (f08ps), nag_lapack_zhsein (f08px)
Generalized nonsymmetric eigenvalue problems
Functions are provided to reduce a real or complex matrix pair (A1,R1)$\left({A}_{1},{R}_{1}\right)$, where A1${A}_{1}$ is general and R1${R}_{1}$ is upper triangular, to generalized upper Hessenberg form by orthogonal transformations A1 = Q1HZ1T${A}_{1}={Q}_{1}H{Z}_{1}^{\mathrm{T}}$, R1 = Q1RZ1T${R}_{1}={Q}_{1}R{Z}_{1}^{\mathrm{T}}$, (or by unitary transformations A1 = Q1HZ1H${A}_{1}={Q}_{1}H{Z}_{1}^{\mathrm{H}}$, R = Q1R1Z1H$R={Q}_{1}{R}_{1}{Z}_{1}^{\mathrm{H}}$, in the complex case). These functions can optionally return Q1${Q}_{1}$ and/or Z1${Z}_{1}$. Note that to transform a general matrix pair (A,B)$\left(A,B\right)$ to the form (A1,R1)$\left({A}_{1},{R}_{1}\right)$ a QR$QR$ factorization of B$B$ (B = R1$B=\stackrel{~}{Q}{R}_{1}$) should first be performed and the matrix A1${A}_{1}$ obtained as A1 = TA${A}_{1}={\stackrel{~}{Q}}^{\mathrm{T}}A$ (see Section [Orthogonal factorizations] above).
Functions are also provided to balance a general matrix pair before reducing it to generalized Hessenberg form, as described in Section [Balancing the generalized eigenvalue problem]. Companion functions are provided to transform vectors of the balanced pair to those of the original matrix pair.
 Reduce to generalized Hessenberg form Balance Backtransform vectors after balancing real matrices nag_lapack_dgghrd (f08we) nag_lapack_dggbal (f08wh) nag_lapack_dggbak (f08wj) complex matrices nag_lapack_zgghrd (f08ws) nag_lapack_zggbal (f08wv) nag_lapack_zggbak (f08ww)
Functions are provided to compute the eigenvalues (as the pairs (α,β)$\left(\alpha ,\beta \right)$) and all or part of the generalized Schur factorization of a generalized upper Hessenberg matrix pair. Eigenvectors may be computed from the generalized Schur form by back-substitution.
Additional functions estimate the sensitivities of computed eigenvalues and eigenvectors.
 Eigenvalues and generalized Schur factorization (QZ$\mathbit{QZ}$ algorithm) Eigenvectors from generalized Schur factorization Sensitivities of eigenvalues and eigenvectors real matrices nag_lapack_dhgeqz (f08xe) nag_lapack_dtgevc (f08yk) nag_lapack_dtgsna (f08yl) complex matrices nag_lapack_zhgeqz (f08xs) nag_lapack_ztgevc (f08yx) nag_lapack_ztgsna (f08yy)
Finally, functions are provided for reordering the generalized Schur factorization so that eigenvalues appear in any desired order on the diagonal of the generalized Schur form. nag_lapack_dtgexc (f08yf) and nag_lapack_ztgexc (f08yt) simply swap two diagonal elements or blocks, and may need to be called repeatedly to achieve a desired order. nag_lapack_dtgsen (f08yg) and nag_lapack_ztgsen (f08yu) perform the whole reordering process for the important special case where a specified cluster of eigenvalues is to appear at the top of the generalized Schur form; if the Schur vectors are reordered at the same time, they yield an orthonormal basis for the deflating subspace corresponding to the specified cluster of eigenvalues. These functions can also compute the sensitivities of the cluster of eigenvalues and the deflating subspace.
 Reorder generalized Schur factorization Reorder generalized Schur factorization, find basis for deflating subspace and estimate sensitivites real matrices nag_lapack_dtgexc (f08yf) nag_lapack_dtgsen (f08yg) complex matrices nag_lapack_ztgexc (f08yt) nag_lapack_ztgsen (f08yu)
The following sequences of calls may be used to compute various combinations of eigenvalues, generalized Schur vectors and eigenvectors
 real matrix pair, all eigenvalues (with balancing) nag_lapack_dgeqrf (f08ae), nag_lapack_dormqr (f08ag), nag_lapack_dgghrd (f08we), nag_lapack_dggbal (f08wh), nag_lapack_dhgeqz (f08xe)* real matrix pair, all eigenvalues and generalized Schur factorization nag_lapack_dgeqrf (f08ae), nag_lapack_dorgqr (f08af), nag_lapack_dormqr (f08ag), nag_lapack_dgghrd (f08we), nag_lapack_dhgeqz (f08xe) real matrix pair, all eigenvalues and eigenvectors (with balancing) nag_lapack_dgeqrf (f08ae), nag_lapack_dorgqr (f08af), nag_lapack_dormqr (f08ag), nag_lapack_dgghrd (f08we), nag_lapack_dggbal (f08wh), nag_lapack_dhgeqz (f08xe), nag_lapack_dtgevc (f08yk)*, nag_lapack_dggbak (f08wj) complex matrix pair, all eigenvalues (with balancing) nag_lapack_zgeqrf (f08as), nag_lapack_zunmqr (f08au), nag_lapack_zgghrd (f08ws), nag_lapack_zggbal (f08wv), nag_lapack_zhgeqz (f08xs)* complex matrix pair, all eigenvalues and generalized Schur factorization nag_lapack_zgeqrf (f08as), nag_lapack_zungqr (f08at), nag_lapack_zunmqr (f08au), nag_lapack_zgghrd (f08ws), nag_lapack_zhgeqz (f08xs) complex matrix pair, all eigenvalues and eigenvectors (with balancing) nag_lapack_zgeqrf (f08as), nag_lapack_zungqr (f08at), nag_lapack_zunmqr (f08au), nag_lapack_zgghrd (f08ws), nag_lapack_zggbal (f08wv), nag_lapack_zhgeqz (f08xs), nag_lapack_ztgevc (f08yx)*, nag_lapack_zggbak (f08ww)
The Sylvester equation and the generalized Sylvester equation
Functions are provided to solve the real or complex Sylvester equation AX ± XB = C$AX±XB=C$, where A$A$ and B$B$ are upper quasi-triangular if real, or upper triangular if complex. To solve the general form of the Sylvester equation in which A$A$ and B$B$ are general square matrices, A$A$ and B$B$ must be reduced to upper (quasi-) triangular form by the Schur factorization, using functions described in Section [Nonsymmetric eigenvalue problems]. For more details, see the documents for the functions listed below.
 Solve the Sylvester equation real matrices nag_lapack_dtrsyl (f08qh) complex matrices nag_lapack_ztrsyl (f08qv)
Functions are also provided to solve the real or complex generalized Sylvester equations
 AR − LB = C ,   ​ DR − LE = F , $AR-LB=C , ​ DR-LE=F ,$
where the pairs (A,D)$\left(A,D\right)$ and (B,E)$\left(B,E\right)$ are in generalized Schur form. To solve the general form of the generalized Sylvester equation in which (A,D)$\left(A,D\right)$ and (B,E)$\left(B,E\right)$ are general matrix pairs, (A,D)$\left(A,D\right)$ and (B,E)$\left(B,E\right)$ must first be reduced to generalized Schur form.
 Solve the generalized Sylvester equation real matrices nag_lapack_dtgsyl (f08yh) complex matrices nag_lapack_ztgsyl (f08yv)

Matrix Storage Schemes

In this chapter the following storage schemes are used for matrices:
• – conventional storage in a two-dimensional array;
• – packed storage for symmetric or Hermitian matrices;
• – packed storage for orthogonal or unitary matrices;
• – band storage for general, symmetric or Hermitian band matrices;
• – storage of bidiagonal, symmetric or Hermitian tridiagonal matrices in two one-dimensional arrays.
These storage schemes are compatible with those used in Chapter F07, but different schemes for packed, band and tridiagonal storage are used in a few older functions in Chapters F01, F02, F03 and F04.

Conventional storage

Please see Section [Conventional storage] in the F07 Chapter Introduction for full details.

Packed storage

Please see Section [Packed storage] in the F07 Chapter Introduction for full details.

Band storage

Please see Section [Band storage] in the F07 Chapter Introduction for full details.

Tridiagonal and bidiagonal matrices

A symmetric tridiagonal or bidiagonal matrix is stored in two one-dimensional arrays, one of length n$n$ containing the diagonal elements, and one of length n1$n-1$ containing the off-diagonal elements. (Older functions in Chapter F02 store the off-diagonal elements in elements 2 : n$2:n$ of a vector of length n$n$.)

Real diagonal elements of complex matrices

Please see Section [Real diagonal elements of complex matrices] in the F07 Chapter Introduction for full details.

Representation of orthogonal or unitary matrices

A real orthogonal or complex unitary matrix (usually denoted Q$Q$) is often represented in the NAG Toolbox as a product of elementary reflectors – also referred to as elementary Householder matrices (usually denoted Hi${H}_{i}$). For example,
 Q = H1H2 ⋯ Hk. $Q =H1H2⋯Hk.$
You need not be aware of the details, because functions are provided to work with this representation, either to generate all or part of Q$Q$ explicitly, or to multiply a given matrix by Q$Q$ or QT${Q}^{\mathrm{T}}$ (QH${Q}^{\mathrm{H}}$ in the complex case) without forming Q$Q$ explicitly.
Nevertheless, the following further details may occasionally be useful.
An elementary reflector (or elementary Householder matrix) H$H$ of order n$n$ is a unitary matrix of the form
 H = I − τvvH $H=I-τvvH$ (4)
where τ$\tau$ is a scalar, and v$v$ is an n$n$-element vector, with |τ|2v22 = 2 × Re(τ)${|\tau |}^{2}{{‖v‖}_{2}}^{2}=2×\mathrm{Re}\left(\tau \right)$; v$v$ is often referred to as the Householder vector. Often v$v$ has several leading or trailing zero elements, but for the purpose of this discussion assume that H$H$ has no such special structure.
There is some redundancy in the representation (4)$\left(4\right)$, which can be removed in various ways. The representation used in Chapter F08 and in LAPACK (which differs from those used in some of the functions in Chapters F01, F02 and F04) sets v1 = 1${v}_{1}=1$; hence v1${v}_{1}$ need not be stored. In real arithmetic, 1τ2$1\le \tau \le 2$, except that τ = 0$\tau =0$ implies H = I$H=I$.
In complex arithmetic, τ$\tau$ may be complex, and satisfies 1Re(τ)2$1\le \mathrm{Re}\left(\tau \right)\le 2$ and |τ1|1$|\tau -1|\le 1$. Thus a complex H$H$ is not Hermitian (as it is in other representations), but it is unitary, which is the important property. The advantage of allowing τ$\tau$ to be complex is that, given an arbitrary complex vector x,H$x,H$ can be computed so that
 HHx = β(1,0, … ,0)T $HHx=β(1,0,…,0)T$
with real β$\beta$. This is useful, for example, when reducing a complex Hermitian matrix to real symmetric tridiagonal form, or a complex rectangular matrix to real bidiagonal form.

Parameter Conventions

Option parameters

Most functions in this chapter have one or more option parameters, of type string. The descriptions in Section 5 of the function documents refer only to upper case values (for example uplo = 'U'$\mathrm{uplo}=\text{'U'}$ or uplo = 'L'$\mathrm{uplo}=\text{'L'}$); however in every case, the corresponding lower case characters may be supplied (with the same meaning). Any other value is illegal.
A longer character string can be passed as the actual parameter, making the calling program more readable, but only the first character is significant. (This is a feature of Fortran 77.) For example:
```[a, d, e, tau, info] = f08fe('Upper', a);
```

Problem dimensions

It is permissible for the problem dimensions (for example, m or n) to be passed as zero, in which case the computation (or part of it) is skipped. Negative dimensions are regarded as an error.

Decision Trees

The following decision trees are principally for the computation (general purpose) functions. See Section [Linear least squares problems (LLS)] for tables of the driver (black box) functions.

Tree 1: Real Symmetric Eigenvalue Problems

 Are eigenvalues only required? _yes Are all the eigenvalues required? _yes Is A$A$ tridiagonal? _yes nag_lapack_dstevd (f08jc) or nag_lapack_dsterf (f08jf) | | no| | | Is A$A$ band matrix? _yes (nag_lapack_dsbtrd (f08he) and nag_lapack_dsterf (f08jf)) or nag_lapack_dsbevd (f08hc) | | no| | | Is one triangle of A$A$ stored as a linear array? _yes (nag_lapack_dsptrd (f08ge) and nag_lapack_dsterf (f08jf)) or nag_lapack_dspevd (f08gc) | | no| | | (nag_lapack_dsytrd (f08fe) and nag_lapack_dsterf (f08jf)) or nag_lapack_dsyev (f08fa) or nag_lapack_dsyevd (f08fc) | no| | Is A$A$ tridiagonal? _yes nag_lapack_dstebz (f08jj) | no| | Is A$A$ a band matrix? _yes nag_lapack_dsbtrd (f08he) and nag_lapack_dstebz (f08jj) | no| | Is one triangle of A$A$ stored as a linear array? _yes nag_lapack_dsptrd (f08ge) and nag_lapack_dstebz (f08jj) | no| | (nag_lapack_dsytrd (f08fe) and nag_lapack_dstebz (f08jj)) or nag_lapack_dsyevx (f08fb) no| Are all eigenvalues and eigenvectors required? _yes Is A$A$ tridiagonal? _yes nag_lapack_dsteqr (f08je), nag_lapack_dstevd (f08jc), nag_lapack_dstedc (f08jh) or nag_lapack_dstegr (f08jl) | no| | Is A$A$ a band matrix? _yes (nag_lapack_dsbtrd (f08he) and nag_lapack_dsteqr (f08je)) or nag_lapack_dsbevd (f08hc) | no| | Is one triangle of A$A$ stored as a linear array? _yes (nag_lapack_dsptrd (f08ge), nag_lapack_dopgtr (f08gf) and nag_lapack_dsteqr (f08je)) or nag_lapack_dspevd (f08gc) | no| | (nag_lapack_dsytrd (f08fe), nag_lapack_dorgtr (f08ff) and nag_lapack_dsteqr (f08je)) or nag_lapack_dsyev (f08fa) or nag_lapack_dsyevd (f08fc) no| Is A$A$ tridiagonal? _yes nag_lapack_dstebz (f08jj) and nag_lapack_dstein (f08jk) no| Is one triangle of A$A$ stored as a linear array? _yes nag_lapack_dsptrd (f08ge), nag_lapack_dstebz (f08jj), nag_lapack_dstein (f08jk) and nag_lapack_dopmtr (f08gg) no| (nag_lapack_dsytrd (f08fe), nag_lapack_dstebz (f08jj), nag_lapack_dstein (f08jk) and nag_lapack_dormtr (f08fg)) or nag_lapack_dsyevx (f08fb)

Tree 2: Real Generalized Symmetric-definite Eigenvalue Problems

 Are eigenvalues only required? _yes Are all the eigenvalues required? _yes Are A$A$ and B$B$ band matrices? _yes nag_lapack_dpbstf (f08uf), nag_lapack_dsbgst (f08ue), nag_lapack_dsbtrd (f08he) and nag_lapack_dsterf (f08jf) | | no| | | Are A$A$ and B$B$ stored with one triangle as a linear array? _yes nag_lapack_dpptrf (f07gd), nag_lapack_dspgst (f08te), nag_lapack_dsptrd (f08ge) and nag_lapack_dsterf (f08jf) | | no| | | nag_lapack_dpotrf (f07fd), nag_lapack_dsygst (f08se), nag_lapack_dsytrd (f08fe) and nag_lapack_dsterf (f08jf) | no| | Are A$A$ and B$B$ band matrices? _yes nag_lapack_dpbstf (f08uf), nag_lapack_dsbgst (f08ue), nag_lapack_dsbtrd (f08he) and nag_lapack_dstebz (f08jj) | no| | Are A$A$ and B$B$ stored with one triangle as a linear array? _yes nag_lapack_dpptrf (f07gd), nag_lapack_dspgst (f08te), nag_lapack_dsptrd (f08ge) and nag_lapack_dstebz (f08jj) | no| | nag_lapack_dpotrf (f07fd), nag_lapack_dsygst (f08se), nag_lapack_dsptrd (f08ge) and nag_lapack_dstebz (f08jj) no| Are all eigenvalues and eigenvectors required? _yes Are A$A$ and B$B$ stored with one triangle as a linear array? _yes nag_lapack_dpptrf (f07gd), nag_lapack_dspgst (f08te), nag_lapack_dsptrd (f08ge), nag_lapack_dopgtr (f08gf) and nag_lapack_dsteqr (f08je) | no| | nag_lapack_dpotrf (f07fd), nag_lapack_dsygst (f08se), nag_lapack_dsytrd (f08fe), nag_lapack_dorgtr (f08ff) and nag_lapack_dsteqr (f08je) no| Are A$A$ and B$B$ band matrices? _yes nag_lapack_dpbstf (f08uf), nag_lapack_dsbgst (f08ue), nag_lapack_dsbtrd (f08he) and nag_lapack_dstein (f08jk) no| Are A$A$ and B$B$ stored with one triangle as a linear array? _yes nag_lapack_dpptrf (f07gd), nag_lapack_dspgst (f08te), nag_lapack_dsptrd (f08ge), nag_lapack_dstebz (f08jj), nag_lapack_dstein (f08jk) and nag_lapack_dopmtr (f08gg) no| nag_lapack_dpotrf (f07fd), nag_lapack_dsygst (f08se), nag_lapack_dsytrd (f08fe), nag_lapack_dstebz (f08jj), nag_lapack_dstein (f08jk) and nag_lapack_dormtr (f08fg)
Note: the functions for band matrices only handle the problem Ax = λBx$Ax=\lambda Bx$; the other functions handle all three types of problems (Ax = λBx$Ax=\lambda Bx$, ABx = λx$ABx=\lambda x$ or BAx = λx$BAx=\lambda x$) except that, if the problem is BAx = λx$BAx=\lambda x$ and eigenvectors are required, must be used instead of instead of .

Tree 3: Real Nonsymmetric Eigenvalue Problems

 Are eigenvalues required? _yes Is A$A$ an upper Hessenberg matrix? _yes nag_lapack_dhseqr (f08pe) | no| | nag_lapack_dgeev (f08na) or nag_lapack_dgeevx (f08nb) or (nag_lapack_dgebal (f08nh), nag_lapack_dgehrd (f08ne) and nag_lapack_dhseqr (f08pe)) no| Is the Schur factorization of A$A$ required? _yes Is A$A$ an upper Hessenberg matrix? _yes nag_lapack_dhseqr (f08pe) | no| | nag_lapack_dgeevx (f08nb) or (nag_lapack_dgehrd (f08ne), nag_lapack_dorghr (f08nf), nag_lapack_dhseqr (f08pe) or nag_lapack_dgebak (f08nj)) no| Are all eigenvectors required? _yes Is A$A$ an upper Hessenberg matrix? _yes nag_lapack_dhseqr (f08pe) or nag_lapack_dtrevc (f08qk) | no| | nag_lapack_dgeev (f08na) or nag_lapack_dgeevx (f08nb) or (nag_lapack_dgebal (f08nh), nag_lapack_dgehrd (f08ne), nag_lapack_dorghr (f08nf), nag_lapack_dhseqr (f08pe), nag_lapack_dtrevc (f08qk) or nag_lapack_dgebak (f08nj)) no| Is A$A$ an upper Hessenberg matrix? _yes nag_lapack_dhseqr (f08pe) or nag_lapack_dhsein (f08pk) no| nag_lapack_dgebal (f08nh), nag_lapack_dgehrd (f08ne), nag_lapack_dhseqr (f08pe), nag_lapack_dhsein (f08pk), nag_lapack_dormhr (f08ng) or nag_lapack_dgebak (f08nj)

Tree 4: Real Generalized Nonsymmetric Eigenvalue Problems

 Are eigenvalues only required? _yes Are A$A$ and B$B$ in generalized upper Hessenberg form? _yes nag_lapack_dhgeqz (f08xe) | no| | nag_lapack_dggbal (f08wh), nag_lapack_dgeqrf (f08ae), nag_lapack_dormqr (f08ag), nag_lapack_dgghrd (f08we) and nag_lapack_dhgeqz (f08xe) no| Is the generalized Schur factorization of A$A$ and B$B$ required? _yes Are A$A$ and B$B$ in generalized upper Hessenberg form? _yes nag_lapack_dhgeqz (f08xe) | no| | nag_lapack_dgeqrf (f08ae), nag_lapack_dormqr (f08ag), nag_lapack_dorgqr (f08af), nag_lapack_dgghrd (f08we), nag_lapack_dhgeqz (f08xe) and nag_lapack_dtgevc (f08yk) no| Are A$A$ and B$B$ in generalized upper Hessenberg form? _yes nag_lapack_dhgeqz (f08xe) and nag_lapack_dtgevc (f08yk) no| nag_lapack_dggbal (f08wh), nag_lapack_dgeqrf (f08ae), nag_lapack_dormqr (f08ag), nag_lapack_dorgqr (f08af), nag_lapack_dgghrd (f08we), nag_lapack_dhgeqz (f08xe), nag_lapack_dtgevc (f08yk) and nag_lapack_dggbak (f08wj)

Tree 5: Complex Hermitian Eigenvalue Problems

 Are eigenvalues only required? _yes Are all the eigenvalues required? _yes Is A$A$ a band matrix? _yes (nag_lapack_zhbtrd (f08hs) and nag_lapack_dsterf (f08jf)) or nag_lapack_zhbevd (f08hq) | | no| | | Is one triangle of A$A$ stored as a linear array? _yes (nag_lapack_zhptrd (f08gs) and nag_lapack_dsterf (f08jf)) or nag_lapack_zhpevd (f08gq) | | no| | | (nag_lapack_zhetrd (f08fs) and nag_lapack_dsterf (f08jf)) or nag_lapack_zheevd (f08fq) | no| | Is A$A$ a band matrix? _yes nag_lapack_zhbtrd (f08hs) and nag_lapack_dstebz (f08jj) | no| | Is one triangle of A$A$ stored as a linear array? _yes nag_lapack_zhptrd (f08gs) and nag_lapack_dstebz (f08jj) | no| | nag_lapack_zhetrd (f08fs) and nag_lapack_dstebz (f08jj) no| Are all eigenvalues and eigenvectors required? _yes Is A$A$ a band matrix? _yes (nag_lapack_zhbtrd (f08hs) and nag_lapack_zsteqr (f08js)) or nag_lapack_zhbevd (f08hq) | no| | Is one triangle of A$A$ stored as a linear array? _yes (nag_lapack_zhptrd (f08gs), nag_lapack_zupgtr (f08gt) and nag_lapack_zsteqr (f08js)) or nag_lapack_zhpevd (f08gq) | no| | (nag_lapack_zhetrd (f08fs), nag_lapack_zungtr (f08ft) and nag_lapack_zsteqr (f08js)) or nag_lapack_zheevd (f08fq) no| Is one triangle of A$A$ stored as a linear array? _yes nag_lapack_zhptrd (f08gs), nag_lapack_dstebz (f08jj), nag_lapack_zstein (f08jx) and nag_lapack_zupmtr (f08gu) no| nag_lapack_zhetrd (f08fs), nag_lapack_dstebz (f08jj), nag_lapack_zstein (f08jx) and nag_lapack_zunmtr (f08fu)

Tree 6: Complex Generalized Hermitian-definite Eigenvalue Problems

 Are eigenvalues only required? _yes Are all eigenvalues required? _yes Are A$A$ and B$B$ stored with one triangle as a linear array? _yes nag_lapack_zpptrf (f07gr), nag_lapack_zhpgst (f08ts), nag_lapack_zhptrd (f08gs) and nag_lapack_dsterf (f08jf) | | no| | | nag_lapack_zpotrf (f07fr), nag_lapack_zhegst (f08ss), nag_lapack_zhetrd (f08fs) and nag_lapack_dsterf (f08jf) | no| | Are A$A$ and B$B$ stored with one triangle as a linear array? _yes nag_lapack_zpptrf (f07gr), nag_lapack_zhpgst (f08ts), nag_lapack_zhptrd (f08gs) and nag_lapack_dstebz (f08jj) | no| | nag_lapack_zpotrf (f07fr), nag_lapack_zhegst (f08ss), nag_lapack_zhptrd (f08gs) and nag_lapack_dstebz (f08jj) no| Are all eigenvalues and eigenvectors required? _yes Are A$A$ and B$B$ stored with one triangle as a linear array? _yes nag_lapack_zpptrf (f07gr), nag_lapack_zhpgst (f08ts), nag_lapack_zhptrd (f08gs) and nag_lapack_zupgtr (f08gt) | no| | nag_lapack_zpotrf (f07fr), nag_lapack_zhegst (f08ss), nag_lapack_zhetrd (f08fs), nag_lapack_zungtr (f08ft) and nag_lapack_zsteqr (f08js) no| Are A$A$ and B$B$ stored with one triangle as a linear array? _yes nag_lapack_zpptrf (f07gr), nag_lapack_zhpgst (f08ts), nag_lapack_zhptrd (f08gs), nag_lapack_dstebz (f08jj), nag_lapack_zstein (f08jx) and nag_lapack_zupmtr (f08gu) no| nag_lapack_zpotrf (f07fr), nag_lapack_zhegst (f08ss), nag_lapack_zhetrd (f08fs), nag_lapack_dstebz (f08jj), nag_lapack_zstein (f08jx) and nag_lapack_zunmtr (f08fu)

Tree 7: Complex non-Hermitian Eigenvalue Problems

 Are eigenvalues only required? _yes Is A$A$ an upper Hessenberg matrix? _yes nag_lapack_zhseqr (f08ps) | no| | nag_lapack_zgebal (f08nv), nag_lapack_zgehrd (f08ns) and nag_lapack_zhseqr (f08ps) no| Is the Schur factorization of A$A$ required? _yes Is A$A$ an upper Hessenberg matrix? _yes nag_lapack_zhseqr (f08ps) | no| | nag_lapack_zgehrd (f08ns), nag_lapack_zunghr (f08nt), nag_lapack_zhseqr (f08ps) and nag_lapack_zgebak (f08nw) no| Are all eigenvectors required? _yes Is A$A$ an upper Hessenberg matrix? _yes nag_lapack_zhseqr (f08ps) and nag_lapack_ztrevc (f08qx) | no| | nag_lapack_zgebal (f08nv), nag_lapack_zgehrd (f08ns), nag_lapack_zunghr (f08nt), nag_lapack_zhseqr (f08ps), nag_lapack_ztrevc (f08qx) and nag_lapack_zgebak (f08nw) no| Is A$A$ an upper Hessenberg matrix? _yes nag_lapack_zhseqr (f08ps) and nag_lapack_zhsein (f08px) no| nag_lapack_zgebal (f08nv), nag_lapack_zgehrd (f08ns), nag_lapack_zhseqr (f08ps), nag_lapack_zhsein (f08px), nag_lapack_zunmhr (f08nu) and nag_lapack_zgebak (f08nw)

Tree 8: Complex Generalized non-Hermitian Eigenvalue Problems

 Are eigenvalues only required? _yes Are A$A$ and B$B$ in generalized upper Hessenberg form? _yes nag_lapack_zhgeqz (f08xs) | no| | nag_lapack_zggbal (f08wv), nag_lapack_zgeqrf (f08as), nag_lapack_zunmqr (f08au), nag_lapack_zgghrd (f08ws) and nag_lapack_zhgeqz (f08xs) no| Is the generalized Schur factorization of A$A$ and B$B$ required? _yes Are A$A$ and B$B$ in generalized upper Hessenberg form? _yes nag_lapack_zhgeqz (f08xs) | no| | nag_lapack_zgeqrf (f08as), nag_lapack_zunmqr (f08au), nag_lapack_zungqr (f08at), nag_lapack_zgghrd (f08ws), nag_lapack_zhgeqz (f08xs) and nag_lapack_ztgevc (f08yx) no| Are A$A$ and B$B$ in generalized upper Hessenberg form? _yes nag_lapack_zhgeqz (f08xs) and nag_lapack_ztgevc (f08yx) no| nag_lapack_zggbal (f08wv), nag_lapack_zgeqrf (f08as), nag_lapack_zunmqr (f08au), nag_lapack_zungqr (f08at), nag_lapack_zgghrd (f08ws), nag_lapack_zhgeqz (f08xs), nag_lapack_ztgevc (f08yx) and nag_lapack_zggbak (f08ww)

Tree 9

 Is A$A$ a complex matrix? _yes Is A$A$ banded? _yes nag_lapack_zgbbrd (f08ls) and nag_lapack_zbdsqr (f08ms) | no| | Are singular values only required? _yes nag_lapack_zgebrd (f08ks) and nag_lapack_zbdsqr (f08ms) | no| | nag_lapack_zgebrd (f08ks), nag_lapack_zungbr (f08kt) and nag_lapack_zbdsqr (f08ms) no| Is A$A$ bidiagonal? _yes nag_lapack_dbdsqr (f08me) no| Is A$A$ banded? _yes nag_lapack_dgbbrd (f08le) and nag_lapack_dbdsqr (f08me) no| Are singular values only required? _yes nag_lapack_dgebrd (f08ke) and nag_lapack_dbdsqr (f08me) no| nag_lapack_dgebrd (f08ke), nag_lapack_dorgbr (f08kf) and nag_lapack_dbdsqr (f08me)

Functionality Index

 Backtransformation of eigenvectors from those of balanced forms,
 complex matrix nag_lapack_zgebak (f08nw)
 real matrix nag_lapack_dgebak (f08nj)
 Backtransformation of generalized eigenvectors from those of balanced forms,
 complex matrix nag_lapack_zggbak (f08ww)
 real matrix nag_lapack_dggbak (f08wj)
 Balancing,
 complex general matrix nag_lapack_zgebal (f08nv)
 complex general matrix pair nag_lapack_zggbal (f08wv)
 real general matrix nag_lapack_dgebal (f08nh)
 real general matrix pair nag_lapack_dggbal (f08wh)
 Eigenvalue problems for condensed forms of matrices,
 complex Hermitian matrix,
 eigenvalues and eigenvectors,
 band matrix,
 all eigenvalues and eigenvectors by a divide-and-conquer algorithm, using packed storage nag_lapack_zhbevd (f08hq)
 all eigenvalues and eigenvectors by root-free QR algorithm nag_lapack_zhbev (f08hn)
 all eigenvalues and eigenvectors by root-free QR algorithm or selected eigenvalues and eigenvectors by bisection and inverse iteration nag_lapack_zhbevx (f08hp)
 general matrix,
 all eigenvalues and eigenvectors by a divide-and-conquer algorithm nag_lapack_zheevd (f08fq)
 all eigenvalues and eigenvectors by a divide-and-conquer algorithm, using packed storage nag_lapack_zhpevd (f08gq)
 all eigenvalues and eigenvectors by root-free QR algorithm nag_lapack_zheev (f08fn)
 all eigenvalues and eigenvectors by root-free QR algorithm, using packed storage nag_lapack_zhpev (f08gn)
 all eigenvalues and eigenvectors by root-free QR algorithm or selected eigenvalues and eigenvectors by bisection and inverse iteration nag_lapack_zheevx (f08fp)
 all eigenvalues and eigenvectors by root-free QR algorithm or selected eigenvalues and eigenvectors by bisection and inverse iteration, using packed storage nag_lapack_zhpevx (f08gp)
 all eigenvalues and eigenvectors using Relatively Robust Representations or selected eigenvalues and eigenvectors by bisection and inverse iteration nag_lapack_zheevr (f08fr)
 eigenvalues only,
 band matrix,
 all eigenvalues by the Pal–Walker–Kahan variant of the QL or QR algorithm nag_lapack_zhbev (f08hn)
 all eigenvalues by the Pal–Walker–Kahan variant of the QL or QR algorithm, or selected eigenvalues by bisection nag_lapack_zhbevx (f08hp)
 all eigenvalues by the Pal–Walker–Kahan variant of the QL or QR algorithm, using packed storage nag_lapack_zhbevd (f08hq)
 general matrix,
 all eigenvalues by the Pal–Walker–Kahan variant of the QL or QR algorithm nag_lapack_zheev (f08fn)
 all eigenvalues by the Pal–Walker–Kahan variant of the QL or QR algorithm, or selected eigenvalues by bisection nag_lapack_zheevx (f08fp)
 all eigenvalues by the Pal–Walker–Kahan variant of the QL or QR algorithm, or selected eigenvalues by bisection, using packed storage nag_lapack_zhpevx (f08gp)
 all eigenvalues by the Pal–Walker–Kahan variant of the QL or QR algorithm, using packed storage nag_lapack_zhpev (f08gn)
 complex upper Hessenberg matrix, reduced from complex general matrix,
 eigenvalues and Schur factorization nag_lapack_zhseqr (f08ps)
 selected right and/or left eigenvectors by inverse iteration nag_lapack_zhsein (f08px)
 real bidiagonal matrix,
 singular value decomposition,
 after reduction from complex general matrix nag_lapack_zbdsqr (f08ms)
 after reduction from real general matrix nag_lapack_dbdsqr (f08me)
 after reduction from real general matrix, using divide-and-conquer nag_lapack_dbdsdc (f08md)
 real symmetric matrix,
 eigenvalues and eigenvectors,
 band matrix,
 all eigenvalues and eigenvectors by a divide-and-conquer algorithm nag_lapack_dsbevd (f08hc)
 all eigenvalues and eigenvectors by root-free QR algorithm nag_lapack_dsbev (f08ha)
 all eigenvalues and eigenvectors by root-free QR algorithm or selected eigenvalues and eigenvectors by bisection and inverse iteration nag_lapack_dsbevx (f08hb)
 general matrix,
 all eigenvalues and eigenvectors by a divide-and-conquer algorithm nag_lapack_dsyevd (f08fc)
 all eigenvalues and eigenvectors by a divide-and-conquer algorithm, using packed storage nag_lapack_dspevd (f08gc)
 all eigenvalues and eigenvectors by root-free QR algorithm nag_lapack_dsyev (f08fa)
 all eigenvalues and eigenvectors by root-free QR algorithm, using packed storage nag_lapack_dspev (f08ga)
 all eigenvalues and eigenvectors by root-free QR algorithm or selected eigenvalues and eigenvectors by bisection and inverse iteration nag_lapack_dsyevx (f08fb)
 all eigenvalues and eigenvectors by root-free QR algorithm or selected eigenvalues and eigenvectors by bisection and inverse iteration, using packed storage nag_lapack_dspevx (f08gb)
 all eigenvalues and eigenvectors using Relatively Robust Representations or selected eigenvalues and eigenvectors by bisection and inverse iteration nag_lapack_dsyevr (f08fd)
 eigenvalues only,
 band matrix,
 all eigenvalues by the Pal–Walker–Kahan variant of the QL or QR algorithm nag_lapack_dsbev (f08ha)
 all eigenvalues by the Pal–Walker–Kahan variant of the QL or QR algorithm, or selected eigenvalues by bisection nag_lapack_dsbevx (f08hb)
 general matrix,
 all eigenvalues by the Pal–Walker–Kahan variant of the QL or QR algorithm nag_lapack_dsyev (f08fa)
 all eigenvalues by the Pal–Walker–Kahan variant of the QL or QR algorithm, or selected eigenvalues by bisection nag_lapack_dsyevx (f08fb)
 all eigenvalues by the Pal–Walker–Kahan variant of the QL or QR algorithm, or selected eigenvalues by bisection, using packed storage nag_lapack_dspevx (f08gb)
 all eigenvalues by the Pal–Walker–Kahan variant of the QL or QR algorithm, using packed storage nag_lapack_dspev (f08ga)
 real symmetric tridiagonal matrix,
 eigenvalues and eigenvectors,
 after reduction from complex Hermitian matrix,
 all eigenvalues and eigenvectors nag_lapack_zsteqr (f08js)
 all eigenvalues and eigenvectors, positive definite matrix nag_lapack_zpteqr (f08ju)
 all eigenvalues and eigenvectors, using divide-and-conquer nag_lapack_zstedc (f08jv)
 all eigenvalues and eigenvectors, using Relatively Robust Representations nag_lapack_zstegr (f08jy)
 selected eigenvectors by inverse iteration nag_lapack_zstein (f08jx)
 all eigenvalues and eigenvectors nag_lapack_dsteqr (f08je)
 all eigenvalues and eigenvectors, by divide-and-conquer nag_lapack_dstedc (f08jh)
 all eigenvalues and eigenvectors, positive definite matrix nag_lapack_dpteqr (f08jg)
 all eigenvalues and eigenvectors, using Relatively Robust Representations nag_lapack_dstegr (f08jl)
 all eigenvalues and eigenvectors by a divide-and-conquer algorithm nag_lapack_dstevd (f08jc)
 all eigenvalues and eigenvectors by root-free QR algorithm nag_lapack_dstev (f08ja)
 all eigenvalues and eigenvectors by root-free QR algorithm or selected eigenvalues and eigenvectors by bisection and inverse iteration nag_lapack_dstevx (f08jb)
 all eigenvalues and eigenvectors using Relatively Robust Representations or selected eigenvalues and eigenvectors by bisection and inverse iteration nag_lapack_dstevr (f08jd)
 selected eigenvectors by inverse iteration nag_lapack_dstein (f08jk)
 eigenvalues only,
 all eigenvalues by root-free QR algorithm nag_lapack_dsterf (f08jf)
 all eigenvalues by the Pal–Walker–Kahan variant of the QL or QR algorithm nag_lapack_dstev (f08ja)
 all eigenvalues by the Pal–Walker–Kahan variant of the QL or QR algorithm, or selected eigenvalues by bisection nag_lapack_dstevx (f08jb)
 selected eigenvalues by bisection nag_lapack_dstebz (f08jj)
 real upper Hessenberg matrix, reduced from real general matrix,
 eigenvalues and Schur factorization nag_lapack_dhseqr (f08pe)
 selected right and/or left eigenvectors by inverse iteration nag_lapack_dhsein (f08pk)
 Eigenvalue problems for nonsymmetric matrices,
 complex matrix,
 all eigenvalues, Schur form, Schur vectors and reciprocal condition numbers nag_lapack_zgeesx (f08pp)
 all eigenvalues, Schur form and Schur vectors nag_lapack_zgees (f08pn)
 all eigenvalues and left/right eigenvectors nag_lapack_zgeev (f08nn)
 all eigenvalues and left/right eigenvectors, plus balancing transformation and reciprocal condition numbers nag_lapack_zgeevx (f08np)
 real matrix,
 all eigenvalues, real Schur form, Schur vectors and reciprocal condition numbers nag_lapack_dgeesx (f08pb)
 all eigenvalues, real Schur form and Schur vectors nag_lapack_dgees (f08pa)
 all eigenvalues and left/right eigenvectors nag_lapack_dgeev (f08na)
 all eigenvalues and left/right eigenvectors, plus balancing transformation and reciprocal condition numbers nag_lapack_dgeevx (f08nb)
 Eigenvalues and generalized Schur factorization,
 complex generalized upper Hessenberg form nag_lapack_zhgeqz (f08xs)
 real generalized upper Hessenberg form nag_lapack_dhgeqz (f08xe)
 General Gauss–Markov linear model,
 solves a complex general Gauss–Markov linear model problem nag_lapack_zggglm (f08zp)
 solves a real general Gauss–Markov linear model problem nag_lapack_dggglm (f08zb)
 Generalized eigenvalue problems for condensed forms of matrices,
 complex Hermitian-definite eigenproblems,
 banded matrices,
 all eigenvalues and eigenvectors by a divide-and-conquer algorithm nag_lapack_zhbgvd (f08uq)
 all eigenvalues and eigenvectors by reduction to tridiagonal form nag_lapack_zhbgv (f08un)
 selected eigenvalues and eigenvectors by reduction to tridiagonal form nag_lapack_zhbgvx (f08up)
 general matrices,
 all eigenvalues and eigenvectors by a divide-and-conquer algorithm nag_lapack_zhegvd (f08sq)
 all eigenvalues and eigenvectors by a divide-and-conquer algorithm, packed storage format nag_lapack_zhpgvd (f08tq)
 all eigenvalues and eigenvectors by reduction to tridiagonal form nag_lapack_zhegv (f08sn)
 all eigenvalues and eigenvectors by reduction to tridiagonal form, packed storage format nag_lapack_zhpgv (f08tn)
 selected eigenvalues and eigenvectors by reduction to tridiagonal form nag_lapack_zhegvx (f08sp)
 selected eigenvalues and eigenvectors by reduction to tridiagonal form, packed storage format nag_lapack_zhpgvx (f08tp)
 real symmetric-definite eigenproblems,
 banded matrices,
 all eigenvalues and eigenvectors by a divide-and-conquer algorithm nag_lapack_dsbgvd (f08uc)
 all eigenvalues and eigenvectors by reduction to tridiagonal form nag_lapack_dsbgv (f08ua)
 selected eigenvalues and eigenvectors by reduction to tridiagonal form nag_lapack_dsbgvx (f08ub)
 general matrices,
 all eigenvalues and eigenvectors by a divide-and-conquer algorithm nag_lapack_dsygvd (f08sc)
 all eigenvalues and eigenvectors by a divide-and-conquer algorithm, packed storage format nag_lapack_dspgvd (f08tc)
 all eigenvalues and eigenvectors by reduction to tridiagonal form nag_lapack_dsygv (f08sa)
 all eigenvalues and eigenvectors by reduction to tridiagonal form, packed storage format nag_lapack_dspgv (f08ta)
 selected eigenvalues and eigenvectors by reduction to tridiagonal form nag_lapack_dsygvx (f08sb)
 selected eigenvalues and eigenvectors by reduction to tridiagonal form, packed storage format nag_lapack_dspgvx (f08tb)
 Generalized eigenvalue problems for nonsymmetric matrix pairs,
 complex nonsymmetric matrix pairs,
 all eigenvalues, generalized Schur form, Schur vectors and reciprocal condition numbers nag_lapack_zggesx (f08xp)
 all eigenvalues, generalized Schur form and Schur vectors nag_lapack_zgges (f08xn)
 all eigenvalues and left/right eigenvectors nag_lapack_zggev (f08wn)
 all eigenvalues and left/right eigenvectors, plus the balancing transformation and reciprocal condition numbers nag_lapack_zggevx (f08wp)
 real nonsymmetric matrix pairs,
 all eigenvalues, generalized real Schur form and left/right Schur vectors nag_lapack_dgges (f08xa)
 all eigenvalues, generalized real Schur form and left/right Schur vectors, plus reciprocal condition numbers nag_lapack_dggesx (f08xb)
 all eigenvalues and left/right eigenvectors nag_lapack_dggev (f08wa)
 all eigenvalues and left/right eigenvectors, plus the balancing transformation and reciprocal condition numbers nag_lapack_dggevx (f08wb)
 Generalized QR factorization,
 complex matrices nag_lapack_zggqrf (f08zs)
 real matrices nag_lapack_dggqrf (f08ze)
 Generalized RQ factorization,
 complex matrices nag_lapack_zggrqf (f08zt)
 real matrices nag_lapack_dggrqf (f08zf)
 Generalized singular value decomposition,
 after reduction from complex general matrix,
 complex triangular or trapezoidal matrix pair nag_lapack_ztgsja (f08ys)
 after reduction from real general matrix,
 real triangular or trapezoidal matrix pair nag_lapack_dtgsja (f08ye)
 complex matrix pair nag_lapack_zggsvd (f08vn)
 real matrix pair nag_lapack_dggsvd (f08va)
 reduction of a pair of general matrices to triangular or trapezoidal form,
 complex matrices nag_lapack_zggsvp (f08vs)
 real matrices nag_lapack_dggsvp (f08ve)
 least squares problems,
 complex matrices,
 apply orthogonal matrix nag_lapack_zunmrz (f08bx)
 minimum norm solution using a complete orthogonal factorization nag_lapack_zgelsy (f08bn)
 minimum norm solution using the singular value decomposition nag_lapack_zgelss (f08kn)
 minimum norm solution using the singular value decomposition (divide-and-conquer) nag_lapack_zgelsd (f08kq)
 reduction of upper trapezoidal matrix to upper triangular form nag_lapack_ztzrzf (f08bv)
 real matrices,
 apply orthogonal matrix nag_lapack_dormrz (f08bk)
 minimum norm solution using a complete orthogonal factorization nag_lapack_dgelsy (f08ba)
 minimum norm solution using the singular value decomposition nag_lapack_dgelss (f08ka)
 minimum norm solution using the singular value decomposition (divide-and-conquer) nag_lapack_dgelsd (f08kc)
 reduction of upper trapezoidal matrix to upper triangular form nag_lapack_dtzrzf (f08bh)
 least squares problems with linear equality constraints,
 complex matrices,
 minimum norm solution subject to linear equality constraints using a generalized RQ factorization nag_lapack_zgglse (f08zn)
 real matrices,
 minimum norm solution subject to linear equality constraints using a generalized RQ factorization nag_lapack_dgglse (f08za)
 Left and right eigenvectors of a pair of matrices,
 complex upper triangular matrices nag_lapack_ztgevc (f08yx)
 real quasi-triangular matrices nag_lapack_dtgevc (f08yk)
 LQ factorization and related operations,
 complex matrices,
 apply unitary matrix nag_lapack_zunmlq (f08ax)
 factorization nag_lapack_zgelqf (f08av)
 form all or part of unitary matrix nag_lapack_zunglq (f08aw)
 real matrices,
 apply orthogonal matrix nag_lapack_dormlq (f08ak)
 factorization nag_lapack_dgelqf (f08ah)
 form all or part of orthogonal matrix nag_lapack_dorglq (f08aj)
 Operations on eigenvectors of a real symmetric or complex Hermitian matrix, or singular vectors of a general matrix,
 estimate condition numbers nag_lapack_ddisna (f08fl)
 Operations on generalized Schur factorization of a general matrix pair,
 complex matrix,
 estimate condition numbers of eigenvalues and/or eigenvectors nag_lapack_ztgsna (f08yy)
 re-order Schur factorization nag_lapack_ztgexc (f08yt)
 re-order Schur factorization, compute generalized eigenvalues and condition numbers nag_lapack_ztgsen (f08yu)
 real matrix,
 estimate condition numbers of eigenvalues and/or eigenvectors nag_lapack_dtgsna (f08yl)
 re-order Schur factorization nag_lapack_dtgexc (f08yf)
 re-order Schur factorization, compute generalized eigenvalues and condition numbers nag_lapack_dtgsen (f08yg)
 Operations on Schur factorization of a general matrix,
 complex matrix,
 compute left and/or right eigenvectors nag_lapack_ztrevc (f08qx)
 estimate sensitivities of eigenvalues and/or eigenvectors nag_lapack_ztrsna (f08qy)
 re-order Schur factorization nag_lapack_ztrexc (f08qt)
 re-order Schur factorization, compute basis of invariant subspace, and estimate sensitivities nag_lapack_ztrsen (f08qu)
 real matrix,
 compute left and/or right eigenvectors nag_lapack_dtrevc (f08qk)
 estimate sensitivities of eigenvalues and/or eigenvectors nag_lapack_dtrsna (f08ql)
 re-order Schur factorization nag_lapack_dtrexc (f08qf)
 re-order Schur factorization, compute basis of invariant subspace, and estimate sensitivities nag_lapack_dtrsen (f08qg)
 Overdetermined and underdetermined linear systems,
 complex matrices,
 solves an overdetermined or undetermined complex linear system nag_lapack_zgels (f08an)
 real matrices,
 solves an overdetermined or undetermined real linear system nag_lapack_dgels (f08aa)
 QL factorization and related operations,
 complex matrices,
 apply unitary matrix nag_lapack_zunmql (f08cu)
 factorization nag_lapack_zgeqlf (f08cs)
 form all or part of unitary matrix nag_lapack_zungql (f08ct)
 real matrices,
 apply orthogonal matrix nag_lapack_dormql (f08cg)
 factorization nag_lapack_dgeqlf (f08ce)
 form all or part of orthogonal matrix nag_lapack_dorgql (f08cf)
 QR factorization and related operations,
 complex matrices,
 apply unitary matrix nag_lapack_zunmqr (f08au)
 factorization nag_lapack_zgeqrf (f08as)
 factorization,
 with column pivoting, using BLAS-3 nag_lapack_zgeqp3 (f08bt)
 factorization, with column pivoting nag_lapack_zgeqpf (f08bs)
 form all or part of unitary matrix nag_lapack_zungqr (f08at)
 real matrices,
 apply orthogonal matrix nag_lapack_dormqr (f08ag)
 factorization nag_lapack_dgeqrf (f08ae)
 factorization,
 with column pivoting, using BLAS-3 nag_lapack_dgeqp3 (f08bf)
 factorization, with column pivoting nag_lapack_dgeqpf (f08be)
 form all or part of orthogonal matrix nag_lapack_dorgqr (f08af)
 Reduction of a pair of general matrices to generalized upper Hessenberg form,
 orthogonal reduction, real matrices nag_lapack_dgghrd (f08we)
 unitary reduction, complex matrices nag_lapack_zgghrd (f08ws)
 Reduction of eigenvalue problems to condensed forms, and related operations,
 complex general matrix to upper Hessenberg form,
 apply orthogonal matrix nag_lapack_zunmhr (f08nu)
 form orthogonal matrix nag_lapack_zunghr (f08nt)
 reduce to Hessenberg form nag_lapack_zgehrd (f08ns)
 complex Hermitian band matrix to real symmetric tridiagonal form nag_lapack_zhbtrd (f08hs)
 complex Hermitian matrix to real symmetric tridiagonal form,
 apply unitary matrix nag_lapack_zunmtr (f08fu)
 apply unitary matrix, packed storage nag_lapack_zupmtr (f08gu)
 form unitary matrix nag_lapack_zungtr (f08ft)
 form unitary matrix, packed storage nag_lapack_zupgtr (f08gt)
 reduce to tridiagonal form nag_lapack_zhetrd (f08fs)
 reduce to tridiagonal form, packed storage nag_lapack_zhptrd (f08gs)
 complex rectangular band matrix to real upper bidiagonal form nag_lapack_zgbbrd (f08ls)
 complex rectangular matrix to real bidiagonal form,
 apply unitary matrix nag_lapack_zunmbr (f08ku)
 form unitary matrix nag_lapack_zungbr (f08kt)
 reduce to bidiagonal form nag_lapack_zgebrd (f08ks)
 real general matrix to upper Hessenberg form,
 apply orthogonal matrix nag_lapack_dormhr (f08ng)
 form orthogonal matrix nag_lapack_dorghr (f08nf)
 reduce to Hessenberg form nag_lapack_dgehrd (f08ne)
 real rectangular band matrix to upper bidiagonal form nag_lapack_dgbbrd (f08le)
 real rectangular matrix to bidiagonal form,
 apply orthogonal matrix nag_lapack_dormbr (f08kg)
 form orthogonal matrix nag_lapack_dorgbr (f08kf)
 reduce to bidiagonal form nag_lapack_dgebrd (f08ke)
 real symmetric band matrix to symmetric tridiagonal form nag_lapack_dsbtrd (f08he)
 real symmetric matrix to symmetric tridiagonal form,
 apply orthogonal matrix nag_lapack_dormtr (f08fg)
 apply orthogonal matrix, packed storage nag_lapack_dopmtr (f08gg)
 form orthogonal matrix nag_lapack_dorgtr (f08ff)
 form orthogonal matrix, packed storage nag_lapack_dopgtr (f08gf)
 reduce to tridiagonal form nag_lapack_dsytrd (f08fe)
 reduce to tridiagonal form, packed storage nag_lapack_dsptrd (f08ge)
 Reduction of generalized eigenproblems to standard eigenproblems,
 complex Hermitian-definite banded generalized eigenproblem Ax = λBx nag_lapack_zhbgst (f08us)
 complex Hermitian-definite generalized eigenproblem Ax = λBx, ABx = λx or BAx = λx nag_lapack_zhegst (f08ss)
 complex Hermitian-definite generalized eigenproblem Ax = λBx, ABx = λx or BAx = λx, packed storage nag_lapack_zhpgst (f08ts)
 real symmetric-definite banded generalized eigenproblem Ax = λBx nag_lapack_dsbgst (f08ue)
 real symmetric-definite generalized eigenproblem Ax = λBx, ABx = λx or BAx = λx nag_lapack_dsygst (f08se)
 real symmetric-definite generalized eigenproblem Ax = λBx, ABx = λx or BAx = λx, packed storage nag_lapack_dspgst (f08te)
 RQ factorization and related operations,
 complex matrices,
 apply unitary matrix nag_lapack_zunmrq (f08cx)
 factorization nag_lapack_zgerqf (f08cv)
 form all or part of unitary matrix nag_lapack_zungrq (f08cw)
 real matrices,
 apply orthogonal matrix nag_lapack_dormrq (f08ck)
 factorization nag_lapack_dgerqf (f08ch)
 form all or part of orthogonal matrix nag_lapack_dorgrq (f08cj)
 Singular value decomposition,
 complex matrix,
 using a divide-and-conquer algorithm nag_lapack_zgesdd (f08kr)
 using bidiagonal QR iteration nag_lapack_zgesvd (f08kp)
 real matrix,
 preconditioned Jacobi SVD using fast scaled rotations and de Rijks pivoting nag_lapack_dgejsv (f08kh)
 using a divide-and-conquer algorithm nag_lapack_dgesdd (f08kd)
 using bidiagonal QR iteration nag_lapack_dgesvd (f08kb)
 using fast scaled rotation and de Rijks pivoting nag_lapack_dgesvj (f08kj)
 Solve generalized Sylvester equation,
 complex matrices nag_lapack_ztgsyl (f08yv)
 real matrices nag_lapack_dtgsyl (f08yh)
 Solve reduced form of Sylvester matrix equation,
 complex matrices nag_lapack_ztrsyl (f08qv)
 real matrices nag_lapack_dtrsyl (f08qh)
 Split Cholesky factorization,
 complex Hermitian positive definite band matrix nag_lapack_zpbstf (f08ut)
 real symmetric positive definite band matrix nag_lapack_dpbstf (f08uf)

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
Arioli M, Duff I S and de Rijk P P M (1989) On the augmented system approach to sparse least squares problems Numer. Math. 55 667–684
Demmel J W and Kahan W (1990) Accurate singular values of bidiagonal matrices SIAM J. Sci. Statist. Comput. 11 873–912
Golub G H and Van Loan C F (1996) Matrix Computations (3rd Edition) Johns Hopkins University Press, Baltimore
Moler C B and Stewart G W (1973) An algorithm for generalized matrix eigenproblems SIAM J. Numer. Anal. 10 241–256
Parlett B N (1998) The Symmetric Eigenvalue Problem SIAM, Philadelphia
Stewart G W and Sun J-G (1990) Matrix Perturbation Theory Academic Press, London
Ward R C (1981) Balancing the generalized eigenvalue problem SIAM J. Sci. Stat. Comp. 2 141–152
Wilkinson J H (1965) The Algebraic Eigenvalue Problem Oxford University Press, Oxford
Wilkinson J H and Reinsch C (1971) Handbook for Automatic Computation II, Linear Algebra Springer–Verlag