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 $n$ by n $n$ Hermitian positive definite tridiagonal matrix A $A$, using the LDLH $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 $A$ as
 A = LDLH , $A=LDLH ,$
where L $L$ is a unit lower bidiagonal matrix and D $D$ is a diagonal matrix, with positive diagonal elements. nag_lapack_zptcon (f07ju) then utilizes the factorization to compute A11 ${‖{A}^{-1}‖}_{1}$ by a direct method, from which the reciprocal of the condition number of A $A$, 1 / κ(A) $1/\kappa \left(A\right)$ is computed as
 1 / κ1(A) = 1 / (‖A‖1‖A − 1‖1) . $1/κ1(A)=1 / ( ‖A‖1 ‖A-1‖1 ) .$
1 / κ(A) $1/\kappa \left(A\right)$ is returned, rather than κ(A) $\kappa \left(A\right)$, since when A $A$ is singular κ(A) $\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:     d( : $:$) – double array
Note: the dimension of the array d must be at least max (1,n)$\mathrm{max}\phantom{\rule{0.125em}{0ex}}\left(1,{\mathbf{n}}\right)$.
Must contain the n$n$ diagonal elements of the diagonal matrix D$D$ from the LDLH$LD{L}^{\mathrm{H}}$ factorization of A$A$.
2:     e( : $:$) – complex array
Note: the dimension of the array e must be at least max (1,n1)$\mathrm{max}\phantom{\rule{0.125em}{0ex}}\left(1,{\mathbf{n}}-1\right)$.
Must contain the (n1)$\left(n-1\right)$ subdiagonal elements of the unit lower bidiagonal matrix L$L$. (e can also be regarded as the superdiagonal of the unit upper bidiagonal matrix U$U$ from the UHDU${U}^{\mathrm{H}}DU$ factorization of A$A$.)
3:     anorm – double scalar
The 1$1$-norm of the original matrix A$A$, which may be computed by calling nag_blas_zlanht (f06up) with its parameter norm = '1'${\mathbf{norm}}=\text{'1'}$. anorm must be computed either before calling nag_lapack_zpttrf (f07jr) or else from a copy of the original matrix A$A$.
Constraint: anorm0.0${\mathbf{anorm}}\ge 0.0$.

### Optional Input Parameters

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

rwork

### Output Parameters

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

## Error Indicators and Warnings

info = i${\mathbf{info}}=-i$
If info = i${\mathbf{info}}=-i$, parameter i$i$ had an illegal value on entry. The parameters are numbered as follows:
1: n, 2: d, 3: e, 4: anorm, 5: rcond, 6: rwork, 7: info.
It is possible that info refers to a parameter that is omitted from the MATLAB interface. This usually indicates that an error in one of the other input parameters has caused an incorrect value to be inferred.

## Accuracy

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

The condition number estimation requires O(n) $\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

```function nag_lapack_zptcon_example
d = [16;
9;
1;
4];
e = [ 1 + 1i;
2 - 1i;
1 - 4i];
anorm = 83.75202879546762;
[rcond, info] = nag_lapack_zptcon(d, e, anorm)
```
```

rcond =

1.0862e-04

info =

0

```
```function f07ju_example
d = [16;
9;
1;
4];
e = [ 1 + 1i;
2 - 1i;
1 - 4i];
anorm = 83.75202879546762;
[rcond, info] = f07ju(d, e, anorm)
```
```

rcond =

1.0862e-04

info =

0

```