F08 Chapter Contents
F08 Chapter Introduction
NAG Library Manual

# NAG Library Routine DocumentF08UEF (DSBGST)

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

## 1  Purpose

F08UEF (DSBGST) reduces a real symmetric-definite generalized eigenproblem $Az=\lambda Bz$ to the standard form $Cy=\lambda y$, where $A$ and $B$ are band matrices, $A$ is a real symmetric matrix, and $B$ has been factorized by F08UFF (DPBSTF).

## 2  Specification

 SUBROUTINE F08UEF ( VECT, UPLO, N, KA, KB, AB, LDAB, BB, LDBB, X, LDX, WORK, INFO)
 INTEGER N, KA, KB, LDAB, LDBB, LDX, INFO REAL (KIND=nag_wp) AB(LDAB,*), BB(LDBB,*), X(LDX,*), WORK(2*N) CHARACTER(1) VECT, UPLO
The routine may be called by its LAPACK name dsbgst.

## 3  Description

To reduce the real symmetric-definite generalized eigenproblem $Az=\lambda Bz$ to the standard form $Cy=\lambda y$, where $A$, $B$ and $C$ are banded, F08UEF (DSBGST) must be preceded by a call to F08UFF (DPBSTF) which computes the split Cholesky factorization of the positive definite matrix $B$: $B={S}^{\mathrm{T}}S$. The split Cholesky factorization, compared with the ordinary Cholesky factorization, allows the work to be approximately halved.
This routine overwrites $A$ with $C={X}^{\mathrm{T}}AX$, where $X={S}^{-1}Q$ and $Q$ is a orthogonal matrix chosen (implicitly) to preserve the bandwidth of $A$. The routine also has an option to allow the accumulation of $X$, and then, if $z$ is an eigenvector of $C$, $Xz$ is an eigenvector of the original system.

## 4  References

Crawford C R (1973) Reduction of a band-symmetric generalized eigenvalue problem Comm. ACM 16 41–44
Kaufman L (1984) Banded eigenvalue solvers on vector machines ACM Trans. Math. Software 10 73–86

## 5  Arguments

1:     $\mathrm{VECT}$ – CHARACTER(1)Input
On entry: indicates whether $X$ is to be returned.
${\mathbf{VECT}}=\text{'N'}$
$X$ is not returned.
${\mathbf{VECT}}=\text{'V'}$
$X$ is returned.
Constraint: ${\mathbf{VECT}}=\text{'N'}$ or $\text{'V'}$.
2:     $\mathrm{UPLO}$ – CHARACTER(1)Input
On entry: indicates whether the upper or lower triangular part of $A$ is stored.
${\mathbf{UPLO}}=\text{'U'}$
The upper triangular part of $A$ is stored.
${\mathbf{UPLO}}=\text{'L'}$
The lower triangular part of $A$ is stored.
Constraint: ${\mathbf{UPLO}}=\text{'U'}$ or $\text{'L'}$.
3:     $\mathrm{N}$ – INTEGERInput
On entry: $n$, the order of the matrices $A$ and $B$.
Constraint: ${\mathbf{N}}\ge 0$.
4:     $\mathrm{KA}$ – INTEGERInput
On entry: if ${\mathbf{UPLO}}=\text{'U'}$, the number of superdiagonals, ${k}_{a}$, of the matrix $A$.
If ${\mathbf{UPLO}}=\text{'L'}$, the number of subdiagonals, ${k}_{a}$, of the matrix $A$.
Constraint: ${\mathbf{KA}}\ge 0$.
5:     $\mathrm{KB}$ – INTEGERInput
On entry: if ${\mathbf{UPLO}}=\text{'U'}$, the number of superdiagonals, ${k}_{b}$, of the matrix $B$.
If ${\mathbf{UPLO}}=\text{'L'}$, the number of subdiagonals, ${k}_{b}$, of the matrix $B$.
Constraint: ${\mathbf{KA}}\ge {\mathbf{KB}}\ge 0$.
6:     $\mathrm{AB}\left({\mathbf{LDAB}},*\right)$ – REAL (KIND=nag_wp) arrayInput/Output
Note: the second dimension of the array AB must be at least $\mathrm{max}\phantom{\rule{0.125em}{0ex}}\left(1,{\mathbf{N}}\right)$.
On entry: the upper or lower triangle of the $n$ by $n$ symmetric band matrix $A$.
The matrix is stored in rows $1$ to ${k}_{a}+1$, more precisely,
• if ${\mathbf{UPLO}}=\text{'U'}$, the elements of the upper triangle of $A$ within the band must be stored with element ${A}_{ij}$ in ${\mathbf{AB}}\left({k}_{a}+1+i-j,j\right)\text{​ for ​}\mathrm{max}\phantom{\rule{0.125em}{0ex}}\left(1,j-{k}_{a}\right)\le i\le j$;
• if ${\mathbf{UPLO}}=\text{'L'}$, the elements of the lower triangle of $A$ within the band must be stored with element ${A}_{ij}$ in ${\mathbf{AB}}\left(1+i-j,j\right)\text{​ for ​}j\le i\le \mathrm{min}\phantom{\rule{0.125em}{0ex}}\left(n,j+{k}_{a}\right)\text{.}$
On exit: the upper or lower triangle of AB is overwritten by the corresponding upper or lower triangle of $C$ as specified by UPLO.
7:     $\mathrm{LDAB}$ – INTEGERInput
On entry: the first dimension of the array AB as declared in the (sub)program from which F08UEF (DSBGST) is called.
Constraint: ${\mathbf{LDAB}}\ge {\mathbf{KA}}+1$.
8:     $\mathrm{BB}\left({\mathbf{LDBB}},*\right)$ – REAL (KIND=nag_wp) arrayInput
Note: the second dimension of the array BB must be at least $\mathrm{max}\phantom{\rule{0.125em}{0ex}}\left(1,{\mathbf{N}}\right)$.
On entry: the banded split Cholesky factor of $B$ as specified by UPLO, N and KB and returned by F08UFF (DPBSTF).
9:     $\mathrm{LDBB}$ – INTEGERInput
On entry: the first dimension of the array BB as declared in the (sub)program from which F08UEF (DSBGST) is called.
Constraint: ${\mathbf{LDBB}}\ge {\mathbf{KB}}+1$.
10:   $\mathrm{X}\left({\mathbf{LDX}},*\right)$ – REAL (KIND=nag_wp) arrayOutput
Note: the second dimension of the array X must be at least $\mathrm{max}\phantom{\rule{0.125em}{0ex}}\left(1,{\mathbf{N}}\right)$ if ${\mathbf{VECT}}=\text{'V'}$ and at least $1$ if ${\mathbf{VECT}}=\text{'N'}$.
On exit: the $n$ by $n$ matrix $X={S}^{-1}Q$, if ${\mathbf{VECT}}=\text{'V'}$.
If ${\mathbf{VECT}}=\text{'N'}$, X is not referenced.
11:   $\mathrm{LDX}$ – INTEGERInput
On entry: the first dimension of the array X as declared in the (sub)program from which F08UEF (DSBGST) is called.
Constraints:
• if ${\mathbf{VECT}}=\text{'V'}$, ${\mathbf{LDX}}\ge \mathrm{max}\phantom{\rule{0.125em}{0ex}}\left(1,{\mathbf{N}}\right)$;
• if ${\mathbf{VECT}}=\text{'N'}$, ${\mathbf{LDX}}\ge 1$.
12:   $\mathrm{WORK}\left(2×{\mathbf{N}}\right)$ – REAL (KIND=nag_wp) arrayWorkspace
13:   $\mathrm{INFO}$ – INTEGEROutput
On exit: ${\mathbf{INFO}}=0$ unless the routine detects an error (see Section 6).

## 6  Error Indicators and Warnings

${\mathbf{INFO}}<0$
If ${\mathbf{INFO}}=-i$, argument $i$ had an illegal value. An explanatory message is output, and execution of the program is terminated.

## 7  Accuracy

Forming the reduced matrix $C$ is a stable procedure. However it involves implicit multiplication by ${B}^{-1}$. When F08UEF (DSBGST) is used as a step in the computation of eigenvalues and eigenvectors of the original problem, there may be a significant loss of accuracy if $B$ is ill-conditioned with respect to inversion.

## 8  Parallelism and Performance

F08UEF (DSBGST) makes calls to BLAS and/or LAPACK routines, which may be threaded within the vendor library used by this implementation. Consult the documentation for the vendor library for further information.
Please consult the X06 Chapter Introduction for information on how to control and interrogate the OpenMP environment used within this routine. Please also consult the Users' Note for your implementation for any additional implementation-specific information.

The total number of floating-point operations is approximately $6{n}^{2}{k}_{B}$, when ${\mathbf{VECT}}=\text{'N'}$, assuming $n\gg {k}_{A},{k}_{B}$; there are an additional $\left(3/2\right){n}^{3}\left({k}_{B}/{k}_{A}\right)$ operations when ${\mathbf{VECT}}=\text{'V'}$.
The complex analogue of this routine is F08USF (ZHBGST).

## 10  Example

This example computes all the eigenvalues of $Az=\lambda Bz$, where
 $A = 0.24 0.39 0.42 0.00 0.39 -0.11 0.79 0.63 0.42 0.79 -0.25 0.48 0.00 0.63 0.48 -0.03 and B= 2.07 0.95 0.00 0.00 0.95 1.69 -0.29 0.00 0.00 -0.29 0.65 -0.33 0.00 0.00 -0.33 1.17 .$
Here $A$ is symmetric, $B$ is symmetric positive definite, and $A$ and $B$ are treated as band matrices. $B$ must first be factorized by F08UFF (DPBSTF). The program calls F08UEF (DSBGST) to reduce the problem to the standard form $Cy=\lambda y$, then F08HEF (DSBTRD) to reduce $C$ to tridiagonal form, and F08JFF (DSTERF) to compute the eigenvalues.

### 10.1  Program Text

Program Text (f08uefe.f90)

### 10.2  Program Data

Program Data (f08uefe.d)

### 10.3  Program Results

Program Results (f08uefe.r)