f11 Chapter Contents
f11 Chapter Introduction
NAG C Library Manual

# NAG Library Function Documentnag_superlu_diagnostic_lu (f11mmc)

## 1  Purpose

nag_superlu_diagnostic_lu (f11mmc) computes the reciprocal pivot growth factor of an $LU$ factorization of a real sparse matrix in compressed column (Harwell–Boeing) format.

## 2  Specification

 #include #include
 void nag_superlu_diagnostic_lu (Integer n, const Integer icolzp[], const double a[], const Integer iprm[], const Integer il[], const double lval[], const Integer iu[], const double uval[], double *rpg, NagError *fail)

## 3  Description

nag_superlu_diagnostic_lu (f11mmc) computes the reciprocal pivot growth factor ${\mathrm{max}}_{j}\left({‖{A}_{j}‖}_{\infty }/{‖{U}_{j}‖}_{\infty }\right)$ from the columns ${A}_{j}$ and ${U}_{j}$ of an $LU$ factorization of the matrix $A$, ${P}_{r}A{P}_{c}=LU$ where ${P}_{r}$ is a row permutation matrix, ${P}_{c}$ is a column permutation matrix, $L$ is unit lower triangular and $U$ is upper triangular as computed by nag_superlu_lu_factorize (f11mec).

None.

## 5  Arguments

1:     nIntegerInput
On entry: $n$, the order of the matrix $A$.
Constraint: ${\mathbf{n}}\ge 0$.
2:     icolzp[$\mathit{dim}$]const IntegerInput
Note: the dimension, dim, of the array icolzp must be at least ${\mathbf{n}}+1$.
On entry: ${\mathbf{icolzp}}\left[i-1\right]$ contains the index in $A$ of the start of a new column. See Section 2.1.3 in the f11 Chapter Introduction.
3:     a[$\mathit{dim}$]const doubleInput
Note: the dimension, dim, of the array a must be at least ${\mathbf{icolzp}}\left[{\mathbf{n}}\right]-1$, the number of nonzeros of the sparse matrix $A$.
On entry: the array of nonzero values in the sparse matrix $A$.
4:     iprm[$7×{\mathbf{n}}$]const IntegerInput
On entry: the column permutation which defines ${P}_{c}$, the row permutation which defines ${P}_{r}$, plus associated data structures as computed by nag_superlu_lu_factorize (f11mec).
5:     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).
6:     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).
7:     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).
8:     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).
9:     rpgdouble *Output
On exit: the reciprocal pivot growth factor ${\mathrm{max}}_{j}\left({‖{A}_{j}‖}_{\infty }/{‖{U}_{j}‖}_{\infty }\right)$. If the reciprocal pivot growth factor is much less than $1$, the stability of the $LU$ factorization may be poor.
10:   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 number $〈\mathit{\text{value}}〉$ had an illegal value.
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_INVALID_PERM_COL
Incorrect Column Permutations in array iprm.

## 7  Accuracy

Not applicable.

If the reciprocal pivot growth factor, rpg, is much less than $1$, then the factorization of the matrix $A$ could be poor. This means that using the factorization to obtain solutions to a linear system, forward error bounds and estimates of the condition number could be unreliable. Consider increasing the thresh argument in the call to nag_superlu_lu_factorize (f11mec).

## 9  Example

To compute the reciprocal pivot growth for the factorization 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 .$
In this case, it should be equal to $1.0$.

### 9.1  Program Text

Program Text (f11mmce.c)

### 9.2  Program Data

Program Data (f11mmce.d)

### 9.3  Program Results

Program Results (f11mmce.r)