f11 Chapter Contents
f11 Chapter Introduction
NAG Library Manual

# NAG Library Function Documentnag_superlu_condition_number_lu (f11mgc)

## 1  Purpose

nag_superlu_condition_number_lu (f11mgc) computes an estimate of the reciprocal of the condition number of a sparse matrix given an $LU$ factorization of the matrix computed by nag_superlu_lu_factorize (f11mec).

## 2  Specification

 #include #include
 void nag_superlu_condition_number_lu (Nag_NormType norm, Integer n, const Integer il[], const double lval[], const Integer iu[], const double uval[], double anorm, double *rcond, NagError *fail)

## 3  Description

nag_superlu_condition_number_lu (f11mgc) estimates the condition number of a real sparse matrix $A$, in either the $1$-norm or the $\infty$-norm:
 $κ1A=A1 A-11 or κ∞A=A∞ A-1∞.$
Note that ${\kappa }_{\infty }\left(A\right)={\kappa }_{1}\left({A}^{\mathrm{T}}\right)$.
Because the condition number is infinite if $A$ is singular, the function actually returns an estimate of the reciprocal of the condition number.
The function should be preceded by a call to nag_superlu_matrix_norm (f11mlc) to compute ${‖A‖}_{1}$ or ${‖A‖}_{\infty }$, and a call to nag_superlu_lu_factorize (f11mec) to compute the $LU$ factorization of $A$. The function then estimates ${‖{A}^{-1}‖}_{1}$ or ${‖{A}^{-1}‖}_{\infty }$ and computes the reciprocal of the condition number.

None.

## 5  Arguments

1:     normNag_NormTypeInput
On entry: indicates whether ${\kappa }_{1}\left(A\right)$ or ${\kappa }_{\infty }\left(A\right)$ is to be estimated.
${\mathbf{norm}}=\mathrm{Nag_RealOneNorm}$
${\kappa }_{1}\left(A\right)$ is estimated.
${\mathbf{norm}}=\mathrm{Nag_RealInfNorm}$
${\kappa }_{\infty }\left(A\right)$ is estimated.
Constraint: ${\mathbf{norm}}=\mathrm{Nag_RealOneNorm}$ or $\mathrm{Nag_RealInfNorm}$.
2:     nIntegerInput
On entry: $n$, the order of the matrix $A$.
Constraint: ${\mathbf{n}}\ge 0$.
3:     il[$\mathit{dim}$]const IntegerInput
Note: the dimension, dim, of the array il must be at least as large as the dimension of the array of the same name in nag_superlu_lu_factorize (f11mec).
On entry: records the sparsity pattern of matrix $L$ as computed by nag_superlu_lu_factorize (f11mec).
4:     lval[$\mathit{dim}$]const doubleInput
Note: the dimension, dim, of the array lval must be at least as large as the dimension of the array of the same name in nag_superlu_lu_factorize (f11mec).
On entry: records the nonzero values of matrix $L$ and some nonzero values of matrix $U$ as computed by nag_superlu_lu_factorize (f11mec).
5:     iu[$\mathit{dim}$]const IntegerInput
Note: the dimension, dim, of the array iu must be at least as large as the dimension of the array of the same name in nag_superlu_lu_factorize (f11mec).
On entry: records the sparsity pattern of matrix $U$ as computed by nag_superlu_lu_factorize (f11mec).
6:     uval[$\mathit{dim}$]const doubleInput
Note: the dimension, dim, of the array uval must be at least as large as the dimension of the array of the same name in nag_superlu_lu_factorize (f11mec).
On entry: records some nonzero values of matrix $U$ as computed by nag_superlu_lu_factorize (f11mec).
7:     anormdoubleInput
On entry: if ${\mathbf{norm}}=\mathrm{Nag_RealOneNorm}$, the $1$-norm of the matrix $A$.
If ${\mathbf{norm}}=\mathrm{Nag_RealInfNorm}$, the $\infty$-norm of the matrix $A$.
anorm may be computed by calling nag_superlu_matrix_norm (f11mlc) with the same value for the argument norm.
Constraint: ${\mathbf{anorm}}\ge 0.0$.
8:     rconddouble *Output
On exit: an estimate of the reciprocal of the condition number of $A$. rcond is set to zero if exact singularity is detected or the estimate underflows. If rcond is less than machine precision, $A$ is singular to working precision.
9:     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 estimate rcond is never less than the true value $\rho$, and in practice is nearly always less than $10\rho$, although examples can be constructed where rcond is much larger.

## 8  Parallelism and Performance

nag_superlu_condition_number_lu (f11mgc) is not threaded by NAG in any implementation.
nag_superlu_condition_number_lu (f11mgc) 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.

A call to nag_superlu_condition_number_lu (f11mgc) involves solving a number of systems of linear equations of the form $Ax=b$ or ${A}^{\mathrm{T}}x=b$.

## 10  Example

This example estimates the condition number in the $1$-norm of the matrix $A$, where
 $A= 2.00 1.00 0 0 0 0 0 1.00 -1.00 0 4.00 0 1.00 0 1.00 0 0 0 1.00 2.00 0 -2.00 0 0 3.00 .$
Here $A$ is nonsymmetric and must first be factorized by nag_superlu_lu_factorize (f11mec). The true condition number in the $1$-norm is $20.25$.

### 10.1  Program Text

Program Text (f11mgce.c)

### 10.2  Program Data

Program Data (f11mgce.d)

### 10.3  Program Results

Program Results (f11mgce.r)