f07 Chapter Contents
f07 Chapter Introduction
NAG C Library Manual

# NAG Library Function Documentnag_dptcon (f07jgc)

## 1  Purpose

nag_dptcon (f07jgc) 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_dpttrf (f07jdc).

## 2  Specification

 #include #include
 void nag_dptcon (Integer n, const double d[], const double e[], double anorm, double *rcond, NagError *fail)

## 3  Description

nag_dptcon (f07jgc) should be preceded by a call to nag_dpttrf (f07jdc), 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_dptcon (f07jgc) 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.

## 4  References

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

## 5  Arguments

1:     nIntegerInput
On entry: $n$, the order of the matrix $A$.
Constraint: ${\mathbf{n}}\ge 0$.
2:     d[$\mathit{dim}$]const doubleInput
Note: the dimension, dim, of the array d must be at least $\mathrm{max}\phantom{\rule{0.125em}{0ex}}\left(1,{\mathbf{n}}\right)$.
On entry: must contain the $n$ diagonal elements of the diagonal matrix $D$ from the $LD{L}^{\mathrm{T}}$ factorization of $A$.
3:     e[$\mathit{dim}$]const doubleInput
Note: the dimension, dim, of the array e must be at least $\mathrm{max}\phantom{\rule{0.125em}{0ex}}\left(1,{\mathbf{n}}-1\right)$.
On entry: 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$.)
4:     anormdoubleInput
On entry: the $1$-norm of the original matrix $A$, which may be computed as shown in Section 9. anorm must be computed either before calling nag_dpttrf (f07jdc) or else from a copy of the original matrix $A$.
Constraint: ${\mathbf{anorm}}\ge 0.0$.
5:     rconddouble *Output
On exit: the reciprocal condition number, $1/{\kappa }_{1}\left(A\right)=1/\left({‖A‖}_{1}{‖{A}^{-1}‖}_{1}\right)$.
6:     failNagError *Input/Output
The NAG error argument (see Section 3.6 in the Essential Introduction).

## 6  Error Indicators and Warnings

NE_ALLOC_FAIL
Dynamic memory allocation failed.
On entry, argument $〈\mathit{\text{value}}〉$ had an illegal value.
NE_INT
On entry, ${\mathbf{n}}=〈\mathit{\text{value}}〉$.
Constraint: ${\mathbf{n}}\ge 0$.
NE_INTERNAL_ERROR
An internal error has occurred in this function. Check the function call and any array sizes. If the call is correct then please contact NAG for assistance.
NE_REAL
On entry, ${\mathbf{anorm}}=〈\mathit{\text{value}}〉$.
Constraint: ${\mathbf{anorm}}\ge 0.0$.

## 7  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_zptcon (f07juc).

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

### 9.1  Program Text

Program Text (f07jgce.c)

### 9.2  Program Data

Program Data (f07jgce.d)

### 9.3  Program Results

Program Results (f07jgce.r)