# NAG Library Routine Document

## 1Purpose

f07jgf (dptcon) 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 f07jdf (dpttrf).

## 2Specification

Fortran Interface
 Subroutine f07jgf ( n, d, e, work, info)
 Integer, Intent (In) :: n Integer, Intent (Out) :: info Real (Kind=nag_wp), Intent (In) :: d(*), e(*), anorm Real (Kind=nag_wp), Intent (Out) :: rcond, work(n)
#include nagmk26.h
 void f07jgf_ (const Integer *n, const double d[], const double e[], const double *anorm, double *rcond, double work[], Integer *info)
The routine may be called by its LAPACK name dptcon.

## 3Description

f07jgf (dptcon) should be preceded by a call to f07jdf (dpttrf), 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. f07jgf (dptcon) 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.

## 4References

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

## 5Arguments

1:     $\mathbf{n}$ – IntegerInput
On entry: $n$, the order of the matrix $A$.
Constraint: ${\mathbf{n}}\ge 0$.
2:     $\mathbf{d}\left(*\right)$ – Real (Kind=nag_wp) arrayInput
Note: the dimension 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:     $\mathbf{e}\left(*\right)$ – Real (Kind=nag_wp) arrayInput
Note: the dimension 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:     $\mathbf{anorm}$ – Real (Kind=nag_wp)Input
On entry: the $1$-norm of the original matrix $A$, which may be computed by calling f06rpf with its argument ${\mathbf{norm}}=\text{'1'}$. anorm must be computed either before calling f07jdf (dpttrf) or else from a copy of the original matrix $A$.
Constraint: ${\mathbf{anorm}}\ge 0.0$.
5:     $\mathbf{rcond}$ – Real (Kind=nag_wp)Output
On exit: the reciprocal condition number, $1/{\kappa }_{1}\left(A\right)=1/\left({‖A‖}_{1}{‖{A}^{-1}‖}_{1}\right)$.
6:     $\mathbf{work}\left({\mathbf{n}}\right)$ – Real (Kind=nag_wp) arrayWorkspace
7:     $\mathbf{info}$ – IntegerOutput
On exit: ${\mathbf{info}}=0$ unless the routine detects an error (see Section 6).

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

## 7Accuracy

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

## 8Parallelism and Performance

f07jgf (dptcon) makes calls to BLAS and/or LAPACK routines, which may be threaded within the vendor library used by this implementation. Consult the documentation for the vendor library for further information.
Please consult the X06 Chapter Introduction for information on how to control and interrogate the OpenMP environment used within this routine. Please also consult the Users' Note for your implementation for any additional implementation-specific information.

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 routine is f07juf (zptcon).

## 10Example

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

### 10.1Program Text

Program Text (f07jgfe.f90)

### 10.2Program Data

Program Data (f07jgfe.d)

### 10.3Program Results

Program Results (f07jgfe.r)

© The Numerical Algorithms Group Ltd, Oxford, UK. 2017