# NAG FL Interfacef07cuf (zgtcon)

## ▸▿ Contents

Settings help

FL Name Style:

FL Specification Language:

## 1Purpose

f07cuf estimates the reciprocal condition number of a complex $n×n$ tridiagonal matrix $A$, using the $LU$ factorization returned by f07crf.

## 2Specification

Fortran Interface
 Subroutine f07cuf ( norm, n, dl, d, du, du2, ipiv, work, info)
 Integer, Intent (In) :: n, ipiv(*) Integer, Intent (Out) :: info Real (Kind=nag_wp), Intent (In) :: anorm Real (Kind=nag_wp), Intent (Out) :: rcond Complex (Kind=nag_wp), Intent (In) :: dl(*), d(*), du(*), du2(*) Complex (Kind=nag_wp), Intent (Out) :: work(2*n) Character (1), Intent (In) :: norm
C Header Interface
#include <nag.h>
 void f07cuf_ (const char *norm, const Integer *n, const Complex dl[], const Complex d[], const Complex du[], const Complex du2[], const Integer ipiv[], const double *anorm, double *rcond, Complex work[], Integer *info, const Charlen length_norm)
The routine may be called by the names f07cuf, nagf_lapacklin_zgtcon or its LAPACK name zgtcon.

## 3Description

f07cuf should be preceded by a call to f07crf, which uses Gaussian elimination with partial pivoting and row interchanges to factorize the matrix $A$ as
 $A=PLU ,$
where $P$ is a permutation matrix, $L$ is unit lower triangular with at most one nonzero subdiagonal element in each column, and $U$ is an upper triangular band matrix, with two superdiagonals. f07cuf then utilizes the factorization to estimate either ${‖{A}^{-1}‖}_{1}$ or ${‖{A}^{-1}‖}_{\infty }$, from which the estimate of the reciprocal of the condition number of $A$, $1/\kappa \left(A\right)$ is computed as either
 $1 / κ1 (A) = 1 / (‖A‖1‖A-1‖1)$
or
 $1 / κ∞ (A) = 1 / (‖A‖∞‖A-1‖∞) .$
$1/\kappa \left(A\right)$ is returned, rather than $\kappa \left(A\right)$, since when $A$ is singular $\kappa \left(A\right)$ is infinite.
Note that ${\kappa }_{\infty }\left(A\right)={\kappa }_{1}\left({A}^{\mathrm{T}}\right)$.

## 4References

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

## 5Arguments

1: $\mathbf{norm}$Character(1) Input
On entry: specifies the norm to be used to estimate $\kappa \left(A\right)$.
${\mathbf{norm}}=\text{'1'}$ or $\text{'O'}$
Estimate ${\kappa }_{1}\left(A\right)$.
${\mathbf{norm}}=\text{'I'}$
Estimate ${\kappa }_{\infty }\left(A\right)$.
Constraint: ${\mathbf{norm}}=\text{'1'}$, $\text{'O'}$ or $\text{'I'}$.
2: $\mathbf{n}$Integer Input
On entry: $n$, the order of the matrix $A$.
Constraint: ${\mathbf{n}}\ge 0$.
3: $\mathbf{dl}\left(*\right)$Complex (Kind=nag_wp) array Input
Note: the dimension of the array dl 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)$ multipliers that define the matrix $L$ of the $LU$ factorization of $A$.
4: $\mathbf{d}\left(*\right)$Complex (Kind=nag_wp) array Input
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 upper triangular matrix $U$ from the $LU$ factorization of $A$.
5: $\mathbf{du}\left(*\right)$Complex (Kind=nag_wp) array Input
Note: the dimension of the array du 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)$ elements of the first superdiagonal of $U$.
6: $\mathbf{du2}\left(*\right)$Complex (Kind=nag_wp) array Input
Note: the dimension of the array du2 must be at least $\mathrm{max}\phantom{\rule{0.125em}{0ex}}\left(1,{\mathbf{n}}-2\right)$.
On entry: must contain the $\left(n-2\right)$ elements of the second superdiagonal of $U$.
7: $\mathbf{ipiv}\left(*\right)$Integer array Input
Note: the dimension of the array ipiv must be at least $\mathrm{max}\phantom{\rule{0.125em}{0ex}}\left(1,{\mathbf{n}}\right)$.
On entry: must contain the $n$ pivot indices that define the permutation matrix $P$. At the $i$th step, row $i$ of the matrix was interchanged with row ${\mathbf{ipiv}}\left(i\right)$, and ${\mathbf{ipiv}}\left(i\right)$ must always be either $i$ or $\left(i+1\right)$, ${\mathbf{ipiv}}\left(i\right)=i$ indicating that a row interchange was not performed.
8: $\mathbf{anorm}$Real (Kind=nag_wp) Input
On entry: if ${\mathbf{norm}}=\text{'1'}$ or $\text{'O'}$, the $1$-norm of the original matrix $A$.
If ${\mathbf{norm}}=\text{'I'}$, the $\infty$-norm of the original matrix $A$.
anorm may be computed by calling f06unf with the same value for the argument norm.
anorm must be computed either before calling f07crf or else from a copy of the original matrix $A$.
Constraint: ${\mathbf{anorm}}\ge 0.0$.
9: $\mathbf{rcond}$Real (Kind=nag_wp) Output
On exit: contains an estimate of the reciprocal condition number.
10: $\mathbf{work}\left(2×{\mathbf{n}}\right)$Complex (Kind=nag_wp) array Workspace
11: $\mathbf{info}$Integer Output
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

In practice the condition number estimator is very reliable, but it can underestimate the true condition number; see Section 15.3 of Higham (2002) for further details.

## 8Parallelism and Performance

Background information to multithreading can be found in the Multithreading documentation.
f07cuf 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.

## 9Further Comments

The condition number estimation typically requires between four and five solves and never more than eleven solves, following the factorization. The total number of floating-point operations required to perform a solve is proportional to $n$.
The real analogue of this routine is f07cgf.

## 10Example

This example estimates the condition number in the $1$-norm of the tridiagonal matrix $A$ given by
 $A = ( -1.3+1.3i 2.0-1.0i 0.0i+0.0 0.0i+0.0 0.0i+0.0 1.0-2.0i -1.3+1.3i 2.0+1.0i 0.0i+0.0 0.0i+0.0 0.0i+0.0 1.0+1.0i -1.3+3.3i -1.0+1.0i 0.0i+0.0 0.0i+0.0 0.0i+0.0 2.0-3.0i -0.3+4.3i 1.0-1.0i 0.0i+0.0 0.0i+0.0 0.0i+0.0 1.0+1.0i -3.3+1.3i ) .$

### 10.1Program Text

Program Text (f07cufe.f90)

### 10.2Program Data

Program Data (f07cufe.d)

### 10.3Program Results

Program Results (f07cufe.r)