NAG CL Interface
f11mgc (direct_​real_​gen_​cond)

1 Purpose

f11mgc computes an estimate of the reciprocal of the condition number of a sparse matrix given an LU factorization of the matrix computed by f11mec.

2 Specification

#include <nag.h>
void  f11mgc (Nag_NormType norm, Integer n, const Integer il[], const double lval[], const Integer iu[], const double uval[], double anorm, double *rcond, NagError *fail)
The function may be called by the names: f11mgc, nag_sparse_direct_real_gen_cond or nag_superlu_condition_number_lu.

3 Description

f11mgc estimates the condition number of a real sparse matrix A, in either the 1-norm or the -norm:
κ1A=A1 A-11   or   κA=A A-1.  
Note that κA=κ1AT.
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 f11mlc to compute A1 or A, and a call to f11mec to compute the LU factorization of A. The function then estimates A-11 or A-1 and computes the reciprocal of the condition number.

4 References

None.

5 Arguments

1: norm Nag_NormType Input
On entry: indicates whether κ1A or κA is to be estimated.
norm=Nag_RealOneNorm
κ1A is estimated.
norm=Nag_RealInfNorm
κA is estimated.
Constraint: norm=Nag_RealOneNorm or Nag_RealInfNorm.
2: n Integer Input
On entry: n, the order of the matrix A.
Constraint: n0.
3: il[dim] const Integer Input
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 f11mec.
On entry: records the sparsity pattern of matrix L as computed by f11mec.
4: lval[dim] const double Input
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 f11mec.
On entry: records the nonzero values of matrix L and some nonzero values of matrix U as computed by f11mec.
5: iu[dim] const Integer Input
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 f11mec.
On entry: records the sparsity pattern of matrix U as computed by f11mec.
6: uval[dim] const double Input
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 f11mec.
On entry: records some nonzero values of matrix U as computed by f11mec.
7: anorm double Input
On entry: if norm=Nag_RealOneNorm, the 1-norm of the matrix A.
If norm=Nag_RealInfNorm, the -norm of the matrix A.
anorm may be computed by calling f11mlc with the same value for the argument norm.
Constraint: anorm0.0.
8: rcond double * 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: fail NagError * Input/Output
The NAG error argument (see Section 7 in the Introduction to the NAG Library CL Interface).

6 Error 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.
NE_BAD_PARAM
On entry, argument value had an illegal value.
NE_INT
On entry, n=value.
Constraint: n0.
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, anorm=value.
Constraint: anorm0.0.

7 Accuracy

The computed estimate rcond is never less than the true value ρ, and in practice is nearly always less than 10ρ, although examples can be constructed where rcond is much larger.

8 Parallelism and Performance

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.
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.

9 Further Comments

A call to f11mgc involves solving a number of systems of linear equations of the form Ax=b or ATx=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 f11mec. The true condition number in the 1-norm is 10.875.

10.1 Program Text

Program Text (f11mgce.c)

10.2 Program Data

Program Data (f11mgce.d)

10.3 Program Results

Program Results (f11mgce.r)