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 $n$ by n $n$ symmetric positive definite tridiagonal matrix A $A$, using the LDLT $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 $A$ as
 A = LDLT , $A=LDLT ,$
where L $L$ is a unit lower bidiagonal matrix and D $D$ is a diagonal matrix, with positive diagonal elements. nag_lapack_dptcon (f07jg) 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 LDLT$LD{L}^{\mathrm{T}}$ factorization of A$A$.
2:     e( : $:$) – double 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 UTDU${U}^{\mathrm{T}}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_dlanst (f06rp) with its parameter norm = '1'${\mathbf{norm}}=\text{'1'}$. anorm must be computed either before calling nag_lapack_dpttrf (f07jd) 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$.

work

### 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: work, 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 complex analogue of this function is nag_lapack_zptcon (f07ju).

## Example

```function nag_lapack_dptcon_example
d = [4;
9;
25;
16;
1];
e = [-0.5;
-0.6666666666666666;
0.6;
0.5];
anorm = 50;
[rcond, info] = nag_lapack_dptcon(d, e, anorm)
```
```

rcond =

0.0095

info =

0

```
```function f07jg_example
d = [4;
9;
25;
16;
1];
e = [-0.5;
-0.6666666666666666;
0.6;
0.5];
anorm = 50;
[rcond, info] = f07jg(d, e, anorm)
```
```

rcond =

0.0095

info =

0

```