NAG CL Interfacef07cgc (dgtcon)

Settings help

CL Name Style:

1Purpose

f07cgc estimates the reciprocal condition number of a real $n×n$ tridiagonal matrix $A$, using the $LU$ factorization returned by f07cdc.

2Specification

 #include
 void f07cgc (Nag_NormType norm, Integer n, const double dl[], const double d[], const double du[], const double du2[], const Integer ipiv[], double anorm, double *rcond, NagError *fail)
The function may be called by the names: f07cgc, nag_lapacklin_dgtcon or nag_dgtcon.

3Description

f07cgc should be preceded by a call to f07cdc, 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. f07cgc 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}$Nag_NormType Input
On entry: specifies the norm to be used to estimate $\kappa \left(A\right)$.
${\mathbf{norm}}=\mathrm{Nag_OneNorm}$
Estimate ${\kappa }_{1}\left(A\right)$.
${\mathbf{norm}}=\mathrm{Nag_InfNorm}$
Estimate ${\kappa }_{\infty }\left(A\right)$.
Constraint: ${\mathbf{norm}}=\mathrm{Nag_OneNorm}$ or $\mathrm{Nag_InfNorm}$.
2: $\mathbf{n}$Integer Input
On entry: $n$, the order of the matrix $A$.
Constraint: ${\mathbf{n}}\ge 0$.
3: $\mathbf{dl}\left[\mathit{dim}\right]$const double Input
Note: the dimension, dim, 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[\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 upper triangular matrix $U$ from the $LU$ factorization of $A$.
5: $\mathbf{du}\left[\mathit{dim}\right]$const double Input
Note: the dimension, dim, 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[\mathit{dim}\right]$const double Input
Note: the dimension, dim, 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[\mathit{dim}\right]$const Integer Input
Note: the dimension, dim, 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-1\right]$, and ${\mathbf{ipiv}}\left[i-1\right]$ must always be either $i$ or $\left(i+1\right)$, ${\mathbf{ipiv}}\left[i-1\right]=i$ indicating that a row interchange was not performed.
8: $\mathbf{anorm}$double Input
On entry: if ${\mathbf{norm}}=\mathrm{Nag_OneNorm}$, the $1$-norm of the original matrix $A$.
If ${\mathbf{norm}}=\mathrm{Nag_InfNorm}$, the $\infty$-norm of the original matrix $A$.
anorm may be computed as demonstrated in Section 10 for the $1$-norm. The $\infty$-norm may be similarly computed by swapping the dl and du arrays in the code for the $1$-norm.
anorm must be computed either before calling f07cdc or else from a copy of the original matrix $A$.
Constraint: ${\mathbf{anorm}}\ge 0.0$.
9: $\mathbf{rcond}$double * Output
On exit: contains an estimate of the reciprocal condition number.
10: $\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

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

f07cgc 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 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 complex analogue of this function is f07cuc.

10Example

This example estimates the condition number in the $1$-norm of the tridiagonal matrix $A$ given by
 $A = ( 3.0 2.1 0.0 0.0 0.0 3.4 2.3 -1.0 0.0 0.0 0.0 3.6 -5.0 1.9 0.0 0.0 0.0 7.0 -0.9 8.0 0.0 0.0 0.0 -6.0 7.1 ) .$

10.1Program Text

Program Text (f07cgce.c)

10.2Program Data

Program Data (f07cgce.d)

10.3Program Results

Program Results (f07cgce.r)