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: nag_lapack_zptcon (f07ju)

## Purpose

nag_lapack_zptcon (f07ju) computes the reciprocal condition number of a complex $n$ by $n$ Hermitian positive definite tridiagonal matrix $A$, using the $LD{L}^{\mathrm{H}}$ factorization returned by nag_lapack_zpttrf (f07jr).

## Syntax

[rcond, info] = f07ju(d, e, anorm, 'n', n)
[rcond, info] = nag_lapack_zptcon(d, e, anorm, 'n', n)

## Description

nag_lapack_zptcon (f07ju) should be preceded by a call to nag_lapack_zpttrf (f07jr), which computes a modified Cholesky factorization of the matrix $A$ as
 $A=LDLH ,$
where $L$ is a unit lower bidiagonal matrix and $D$ is a diagonal matrix, with positive diagonal elements. nag_lapack_zptcon (f07ju) then utilizes the factorization to compute ${‖{A}^{-1}‖}_{1}$ by a direct method, from which the reciprocal of the condition number of $A$, $1/\kappa \left(A\right)$ is computed as
 $1/κ1A=1 / A1 A-11 .$
$1/\kappa \left(A\right)$ is returned, rather than $\kappa \left(A\right)$, since when $A$ is singular $\kappa \left(A\right)$ is infinite.

## References

Higham N J (2002) Accuracy and Stability of Numerical Algorithms (2nd Edition) SIAM, Philadelphia

## Parameters

### Compulsory Input Parameters

1:     $\mathrm{d}\left(:\right)$ – double array
The dimension of the array d must be at least $\mathrm{max}\phantom{\rule{0.125em}{0ex}}\left(1,{\mathbf{n}}\right)$
Must contain the $n$ diagonal elements of the diagonal matrix $D$ from the $LD{L}^{\mathrm{H}}$ factorization of $A$.
2:     $\mathrm{e}\left(:\right)$ – complex array
The dimension of the array e must be at least $\mathrm{max}\phantom{\rule{0.125em}{0ex}}\left(1,{\mathbf{n}}-1\right)$
Must contain the $\left(n-1\right)$ subdiagonal elements of the unit lower bidiagonal matrix $L$. (e can also be regarded as the superdiagonal of the unit upper bidiagonal matrix $U$ from the ${U}^{\mathrm{H}}DU$ factorization of $A$.)
3:     $\mathrm{anorm}$ – double scalar
The $1$-norm of the original matrix $A$. anorm must be computed either before calling nag_lapack_zpttrf (f07jr) or else from a copy of the original matrix $A$.
Constraint: ${\mathbf{anorm}}\ge 0.0$.

### Optional Input Parameters

1:     $\mathrm{n}$int64int32nag_int scalar
Default: the dimension of the array d.
$n$, the order of the matrix $A$.
Constraint: ${\mathbf{n}}\ge 0$.

### Output Parameters

1:     $\mathrm{rcond}$ – double scalar
The reciprocal condition number, $1/{\kappa }_{1}\left(A\right)=1/\left({‖A‖}_{1}{‖{A}^{-1}‖}_{1}\right)$.
2:     $\mathrm{info}$int64int32nag_int scalar
${\mathbf{info}}=0$ unless the function detects an error (see Error Indicators and Warnings).

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

## Accuracy

The computed condition number will be the exact condition number for a closely neighbouring matrix.

The condition number estimation requires $\mathit{O}\left(n\right)$ floating-point operations.
See Section 15.6 of Higham (2002) for further details on computing the condition number of tridiagonal matrices.
The real analogue of this function is nag_lapack_dptcon (f07jg).

## Example

This example computes the condition number of the Hermitian positive definite tridiagonal matrix $A$ given by
 $A = 16.0i+00.0 16.0-16.0i 0.0i+0.0 0.0i+0.0 16.0+16.0i 41.0i+00.0 18.0+9.0i 0.0i+0.0 0.0i+00.0 18.0-09.0i 46.0i+0.0 1.0+4.0i 0.0i+00.0 0.0i+00.0 1.0-4.0i 21.0i+0.0 .$
```function f07ju_example

fprintf('f07ju example results\n\n');

% Hermitian tridiagonal A stored as two diagonals
d = [ 16            41          46            21];
e = [ 16 + 16i      18 - 9i      1 - 4i         ];

% Factorize
[df, ef, info] = f07jr( ...
d, e);

% Construct matrix an with same 1-norm
an = [0 e; d; e 0];
anorm = norm(an,1);

% Get reciprocal condition number
[rcond, info] = f07ju( ...
df, ef, anorm);

fprintf('Condition number of A = %7.2e\n',1/rcond);

```
```f07ju example results

Condition number of A = 9.21e+03
```