# NAG CL Interfacef07juc (zptcon)

## 1Purpose

f07juc computes the reciprocal condition number of a complex $n$ by $n$ Hermitian positive definite tridiagonal matrix $A$, using the $LD{L}^{\mathrm{H}}$ factorization returned by f07jrc.

## 2Specification

 #include
 void f07juc (Integer n, const double d[], const Complex e[], double anorm, double *rcond, NagError *fail)
The function may be called by the names: f07juc, nag_lapacklin_zptcon or nag_zptcon.

## 3Description

f07juc should be preceded by a call to f07jrc, which computes a modified Cholesky factorization of the matrix $A$ as
 $A=LDLH ,$
where $L$ is a unit lower bidiagonal matrix and $D$ is a diagonal matrix, with positive diagonal elements. f07juc 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}$Integer Input
On entry: $n$, the order of the matrix $A$.
Constraint: ${\mathbf{n}}\ge 0$.
2: $\mathbf{d}\left[\mathit{dim}\right]$const double Input
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{H}}$ factorization of $A$.
3: $\mathbf{e}\left[\mathit{dim}\right]$const Complex Input
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{H}}DU$ factorization of $A$.)
4: $\mathbf{anorm}$double Input
On entry: the $1$-norm of the original matrix $A$, which may be computed as shown in Section 10. anorm must be computed either before calling f07jrc or else from a copy of the original matrix $A$.
Constraint: ${\mathbf{anorm}}\ge 0.0$.
5: $\mathbf{rcond}$double * Output
On exit: the reciprocal condition number, $1/{\kappa }_{1}\left(A\right)=1/\left({‖A‖}_{1}{‖{A}^{-1}‖}_{1}\right)$.
6: $\mathbf{fail}$NagError * Input/Output
The NAG error argument (see Section 7 in the Introduction to the NAG Library CL Interface).

## 6Error Indicators and Warnings

NE_ALLOC_FAIL
Dynamic memory allocation failed.
See Section 3.1.2 in the Introduction to the NAG Library CL Interface for further information.
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.
See Section 7.5 in the Introduction to the NAG Library CL Interface for further information.
NE_NO_LICENCE
Your licence key may have expired or may not have been installed correctly.
See Section 8 in the Introduction to the NAG Library CL Interface for further information.
NE_REAL
On entry, ${\mathbf{anorm}}=〈\mathit{\text{value}}〉$.
Constraint: ${\mathbf{anorm}}\ge 0.0$.

## 7Accuracy

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

## 8Parallelism and Performance

f07juc 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 function. 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 real analogue of this function is f07jgc.

## 10Example

This example computes the condition number of the Hermitian positive definite tridiagonal matrix $A$ given by
 $A = 16.0i+00.0 16.0-16.0i 0.0i+0.0 0.0i+0.0 16.0+16.0i 41.0i+00.0 18.0+9.0i 0.0i+0.0 0.0i+00.0 18.0-09.0i 46.0i+0.0 1.0+4.0i 0.0i+00.0 0.0i+00.0 1.0-4.0i 21.0i+0.0 .$

### 10.1Program Text

Program Text (f07juce.c)

### 10.2Program Data

Program Data (f07juce.d)

### 10.3Program Results

Program Results (f07juce.r)