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_dptcon (f07jg)

## Purpose

nag_lapack_dptcon (f07jg) computes the reciprocal condition number of a real $n$ by $n$ symmetric positive definite tridiagonal matrix $A$, using the $LD{L}^{\mathrm{T}}$ factorization returned by nag_lapack_dpttrf (f07jd).

## Syntax

[rcond, info] = f07jg(d, e, anorm, 'n', n)
[rcond, info] = nag_lapack_dptcon(d, e, anorm, 'n', n)

## Description

nag_lapack_dptcon (f07jg) should be preceded by a call to nag_lapack_dpttrf (f07jd), which computes a modified Cholesky factorization of the matrix $A$ as
 $A=LDLT ,$
where $L$ is a unit lower bidiagonal matrix and $D$ is a diagonal matrix, with positive diagonal elements. nag_lapack_dptcon (f07jg) 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{T}}$ factorization of $A$.
2:     $\mathrm{e}\left(:\right)$ – double 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{T}}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_dpttrf (f07jd) 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 complex analogue of this function is nag_lapack_zptcon (f07ju).

## Example

This example computes the condition number of the symmetric positive definite tridiagonal matrix $A$ given by
 $A = 4.0 -2.0 0 0 0 -2.0 10.0 -6.0 0 0 0 -6.0 29.0 15.0 0 0 0 15.0 25.0 8.0 0 0 0 8.0 5.0 .$
```function f07jg_example

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

% Symmetric tridiagonal A stored as two diagonals
d = [ 4     10     29     25     5];
e = [-2     -6     15     8       ];

[df, ef, info] = f07jd( ...
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] = f07jg( ...
df, ef, anorm);

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

```
```f07jg example results

Condition number of A = 1.05e+02
```