# NAG FL Interfacef08usf (zhbgst)

## ▸▿ Contents

Settings help

FL Name Style:

FL Specification Language:

## 1Purpose

f08usf reduces a complex Hermitian-definite generalized eigenproblem $Az=\lambda Bz$ to the standard form $Cy=\lambda y$, where $A$ and $B$ are band matrices, $A$ is a complex Hermitian matrix, and $B$ has been factorized by f08utf.

## 2Specification

Fortran Interface
 Subroutine f08usf ( vect, uplo, n, ka, kb, ab, ldab, bb, ldbb, x, ldx, work, info)
 Integer, Intent (In) :: n, ka, kb, ldab, ldbb, ldx Integer, Intent (Out) :: info Real (Kind=nag_wp), Intent (Out) :: rwork(n) Complex (Kind=nag_wp), Intent (In) :: bb(ldbb,*) Complex (Kind=nag_wp), Intent (Inout) :: ab(ldab,*), x(ldx,*) Complex (Kind=nag_wp), Intent (Out) :: work(n) Character (1), Intent (In) :: vect, uplo
#include <nag.h>
 void f08usf_ (const char *vect, const char *uplo, const Integer *n, const Integer *ka, const Integer *kb, Complex ab[], const Integer *ldab, const Complex bb[], const Integer *ldbb, Complex x[], const Integer *ldx, Complex work[], double rwork[], Integer *info, const Charlen length_vect, const Charlen length_uplo)
The routine may be called by the names f08usf, nagf_lapackeig_zhbgst or its LAPACK name zhbgst.

## 3Description

To reduce the complex Hermitian-definite generalized eigenproblem $Az=\lambda Bz$ to the standard form $Cy=\lambda y$, where $A$, $B$ and $C$ are banded, f08usf must be preceded by a call to f08utf which computes the split Cholesky factorization of the positive definite matrix $B$: $B={S}^{\mathrm{H}}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{H}}AX$, where $X={S}^{-1}Q$ and $Q$ is a unitary 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.

## 4References

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

## 5Arguments

1: $\mathbf{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: $\mathbf{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: $\mathbf{n}$Integer Input
On entry: $n$, the order of the matrices $A$ and $B$.
Constraint: ${\mathbf{n}}\ge 0$.
4: $\mathbf{ka}$Integer Input
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: $\mathbf{kb}$Integer Input
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: $\mathbf{ab}\left({\mathbf{ldab}},*\right)$Complex (Kind=nag_wp) array Input/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×n$ Hermitian 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: $\mathbf{ldab}$Integer Input
On entry: the first dimension of the array ab as declared in the (sub)program from which f08usf is called.
Constraint: ${\mathbf{ldab}}\ge {\mathbf{ka}}+1$.
8: $\mathbf{bb}\left({\mathbf{ldbb}},*\right)$Complex (Kind=nag_wp) array Input
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 f08utf.
9: $\mathbf{ldbb}$Integer Input
On entry: the first dimension of the array bb as declared in the (sub)program from which f08usf is called.
Constraint: ${\mathbf{ldbb}}\ge {\mathbf{kb}}+1$.
10: $\mathbf{x}\left({\mathbf{ldx}},*\right)$Complex (Kind=nag_wp) array Output
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×n$ matrix $X={S}^{-1}Q$, if ${\mathbf{vect}}=\text{'V'}$.
If ${\mathbf{vect}}=\text{'N'}$, x is not referenced.
11: $\mathbf{ldx}$Integer Input
On entry: the first dimension of the array x as declared in the (sub)program from which f08usf 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: $\mathbf{work}\left({\mathbf{n}}\right)$Complex (Kind=nag_wp) array Workspace
13: $\mathbf{rwork}\left({\mathbf{n}}\right)$Real (Kind=nag_wp) array Workspace
14: $\mathbf{info}$Integer Output
On exit: ${\mathbf{info}}=0$ unless the routine detects an error (see Section 6).

## 6Error 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.

## 7Accuracy

Forming the reduced matrix $C$ is a stable procedure. However it involves implicit multiplication by ${B}^{-1}$. When f08usf 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.

## 8Parallelism and Performance

f08usf 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 real floating-point operations is approximately $20{n}^{2}{k}_{B}$, when ${\mathbf{vect}}=\text{'N'}$, assuming $n\gg {k}_{A},{k}_{B}$; there are an additional $5{n}^{3}\left({k}_{B}/{k}_{A}\right)$ operations when ${\mathbf{vect}}=\text{'V'}$.
The real analogue of this routine is f08uef.

## 10Example

This example computes all the eigenvalues of $Az=\lambda Bz$, where
 $A = ( -1.13+0.00i 1.94-2.10i -1.40+0.25i 0.00+0.00i 1.94+2.10i -1.91+0.00i -0.82-0.89i -0.67+0.34i -1.40-0.25i -0.82+0.89i -1.87+0.00i -1.10-0.16i 0.00+0.00i -0.67-0.34i -1.10+0.16i 0.50+0.00i )$
and
 $B = ( 9.89+0.00i 1.08-1.73i 0.00+0.00i 0.00+0.00i 1.08+1.73i 1.69+0.00i -0.04+0.29i 0.00+0.00i 0.00+0.00i -0.04-0.29i 2.65+0.00i -0.33+2.24i 0.00+0.00i 0.00+0.00i -0.33-2.24i 2.17+0.00i ) .$
Here $A$ is Hermitian, $B$ is Hermitian positive definite, and $A$ and $B$ are treated as band matrices. $B$ must first be factorized by f08utf. The program calls f08usf to reduce the problem to the standard form $Cy=\lambda y$, then f08hsf to reduce $C$ to tridiagonal form, and f08jff to compute the eigenvalues.

### 10.1Program Text

Program Text (f08usfe.f90)

### 10.2Program Data

Program Data (f08usfe.d)

### 10.3Program Results

Program Results (f08usfe.r)