# NAG FL Interfacef08ssf (zhegst)

## ▸▿ Contents

Settings help

FL Name Style:

FL Specification Language:

## 1Purpose

f08ssf reduces a complex Hermitian-definite generalized eigenproblem $Az=\lambda Bz$, $ABz=\lambda z$ or $BAz=\lambda z$ to the standard form $Cy=\lambda y$, where $A$ is a complex Hermitian matrix and $B$ has been factorized by f07frf.

## 2Specification

Fortran Interface
 Subroutine f08ssf ( uplo, n, a, lda, b, ldb, info)
 Integer, Intent (In) :: itype, n, lda, ldb Integer, Intent (Out) :: info Complex (Kind=nag_wp), Intent (Inout) :: a(lda,*), b(ldb,*) Character (1), Intent (In) :: uplo
#include <nag.h>
 void f08ssf_ (const Integer *itype, const char *uplo, const Integer *n, Complex a[], const Integer *lda, Complex b[], const Integer *ldb, Integer *info, const Charlen length_uplo)
The routine may be called by the names f08ssf, nagf_lapackeig_zhegst or its LAPACK name zhegst.

## 3Description

To reduce the complex Hermitian-definite generalized eigenproblem $Az=\lambda Bz$, $ABz=\lambda z$ or $BAz=\lambda z$ to the standard form $Cy=\lambda y$, f08ssf must be preceded by a call to f07frf which computes the Cholesky factorization of $B$; $B$ must be positive definite.
The different problem types are specified by the argument itype, as indicated in the table below. The table shows how $C$ is computed by the routine, and also how the eigenvectors $z$ of the original problem can be recovered from the eigenvectors of the standard form.
itype Problem uplo $\mathbit{B}$ $\mathbit{C}$ $\mathbit{z}$
$1$ $Az=\lambda Bz$ 'U'
'L'
${U}^{\mathrm{H}}U$
$L{L}^{\mathrm{H}}$
${U}^{-\mathrm{H}}A{U}^{-1}$
${L}^{-1}A{L}^{-\mathrm{H}}$
${U}^{-1}y$
${L}^{-\mathrm{H}}y$
$2$ $ABz=\lambda z$ 'U'
'L'
${U}^{\mathrm{H}}U$
$L{L}^{\mathrm{H}}$
$UA{U}^{\mathrm{H}}$
${L}^{\mathrm{H}}AL$
${U}^{-1}y$
${L}^{-\mathrm{H}}y$
$3$ $BAz=\lambda z$ 'U'
'L'
${U}^{\mathrm{H}}U$
$L{L}^{\mathrm{H}}$
$UA{U}^{\mathrm{H}}$
${L}^{\mathrm{H}}AL$
${U}^{\mathrm{H}}y$
$Ly$

## 4References

Golub G H and Van Loan C F (1996) Matrix Computations (3rd Edition) Johns Hopkins University Press, Baltimore

## 5Arguments

1: $\mathbf{itype}$Integer Input
On entry: indicates how the standard form is computed.
${\mathbf{itype}}=1$
• if ${\mathbf{uplo}}=\text{'U'}$, $C={U}^{-\mathrm{H}}A{U}^{-1}$;
• if ${\mathbf{uplo}}=\text{'L'}$, $C={L}^{-1}A{L}^{-\mathrm{H}}$.
${\mathbf{itype}}=2$ or $3$
• if ${\mathbf{uplo}}=\text{'U'}$, $C=UA{U}^{\mathrm{H}}$;
• if ${\mathbf{uplo}}=\text{'L'}$, $C={L}^{\mathrm{H}}AL$.
Constraint: ${\mathbf{itype}}=1$, $2$ or $3$.
2: $\mathbf{uplo}$Character(1) Input
On entry: indicates whether the upper or lower triangular part of $A$ is stored and how $B$ has been factorized.
${\mathbf{uplo}}=\text{'U'}$
The upper triangular part of $A$ is stored and $B={U}^{\mathrm{H}}U$.
${\mathbf{uplo}}=\text{'L'}$
The lower triangular part of $A$ is stored and $B=L{L}^{\mathrm{H}}$.
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{a}\left({\mathbf{lda}},*\right)$Complex (Kind=nag_wp) array Input/Output
Note: the second dimension of the array a must be at least $\mathrm{max}\phantom{\rule{0.125em}{0ex}}\left(1,{\mathbf{n}}\right)$.
On entry: the $n×n$ Hermitian matrix $A$.
• If ${\mathbf{uplo}}=\text{'U'}$, the upper triangular part of $A$ must be stored and the elements of the array below the diagonal are not referenced.
• If ${\mathbf{uplo}}=\text{'L'}$, the lower triangular part of $A$ must be stored and the elements of the array above the diagonal are not referenced.
On exit: the upper or lower triangle of a is overwritten by the corresponding upper or lower triangle of $C$ as specified by itype and uplo.
5: $\mathbf{lda}$Integer Input
On entry: the first dimension of the array a as declared in the (sub)program from which f08ssf is called.
Constraint: ${\mathbf{lda}}\ge \mathrm{max}\phantom{\rule{0.125em}{0ex}}\left(1,{\mathbf{n}}\right)$.
6: $\mathbf{b}\left({\mathbf{ldb}},*\right)$Complex (Kind=nag_wp) array Input
Note: the second dimension of the array b must be at least $\mathrm{max}\phantom{\rule{0.125em}{0ex}}\left(1,{\mathbf{n}}\right)$.
On entry: the Cholesky factor of $B$ as specified by uplo and returned by f07frf.
7: $\mathbf{ldb}$Integer Input
On entry: the first dimension of the array b as declared in the (sub)program from which f08ssf is called.
Constraint: ${\mathbf{ldb}}\ge \mathrm{max}\phantom{\rule{0.125em}{0ex}}\left(1,{\mathbf{n}}\right)$.
8: $\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}$ (if ${\mathbf{itype}}=1$) or $B$ (if ${\mathbf{itype}}=2$ or $3$). When f08ssf 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. See the document for f08snf for further details.

## 8Parallelism and Performance

f08ssf 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 $4{n}^{3}$.
The real analogue of this routine is f08sef.

## 10Example

This example computes all the eigenvalues of $Az=\lambda Bz$, where
 $A = ( -7.36+0.00i 0.77-0.43i -0.64-0.92i 3.01-6.97i 0.77+0.43i 3.49+0.00i 2.19+4.45i 1.90+3.73i -0.64+0.92i 2.19-4.45i 0.12+0.00i 2.88-3.17i 3.01+6.97i 1.90-3.73i 2.88+3.17i -2.54+0.00i )$
and
 $B = ( 3.23+0.00i 1.51-1.92i 1.90+0.84i 0.42+2.50i 1.51+1.92i 3.58+0.00i -0.23+1.11i -1.18+1.37i 1.90-0.84i -0.23-1.11i 4.09+0.00i 2.33-0.14i 0.42-2.50i -1.18-1.37i 2.33+0.14i 4.29+0.00i ) .$
Here $B$ is Hermitian positive definite and must first be factorized by f07frf. The program calls f08ssf to reduce the problem to the standard form $Cy=\lambda y$; then f08fsf to reduce $C$ to tridiagonal form, and f08jff to compute the eigenvalues.

### 10.1Program Text

Program Text (f08ssfe.f90)

### 10.2Program Data

Program Data (f08ssfe.d)

### 10.3Program Results

Program Results (f08ssfe.r)