NAG FL Interface
f11mgf (direct_​real_​gen_​cond)

Settings help

FL Name Style:


FL Specification Language:


1 Purpose

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

2 Specification

Fortran Interface
Subroutine f11mgf ( norm, n, il, lval, iu, uval, anorm, rcond, ifail)
Integer, Intent (In) :: n, il(*), iu(*)
Integer, Intent (Inout) :: ifail
Real (Kind=nag_wp), Intent (In) :: lval(*), uval(*), anorm
Real (Kind=nag_wp), Intent (Out) :: rcond
Character (1), Intent (In) :: norm
C Header Interface
#include <nag.h>
void  f11mgf_ (const char *norm, const Integer *n, const Integer il[], const double lval[], const Integer iu[], const double uval[], const double *anorm, double *rcond, Integer *ifail, const Charlen length_norm)
The routine may be called by the names f11mgf or nagf_sparse_direct_real_gen_cond.

3 Description

f11mgf estimates the condition number of a real sparse matrix A, in either the 1-norm or the -norm:
κ1(A)=A1 A-11   or   κ(A)=A A-1.  
Note that κ(A)=κ1(AT).
Because the condition number is infinite if A is singular, the routine actually returns an estimate of the reciprocal of the condition number.
The routine should be preceded by a call to f11mlf to compute A1 or A, and a call to f11mef to compute the LU factorization of A. The routine then estimates A-11 or A-1 and computes the reciprocal of the condition number.

4 References

None.

5 Arguments

1: norm Character(1) Input
On entry: indicates whether κ1(A) or κ(A) is to be estimated.
norm='1' or 'O'
κ1(A) is estimated.
norm='I'
κ(A) is estimated.
Constraint: norm='1', 'O' or 'I'.
2: n Integer Input
On entry: n, the order of the matrix A.
Constraint: n0.
3: il(*) Integer array Input
Note: the dimension of the array il must be at least as large as the dimension of the array of the same name in f11mef.
On entry: records the sparsity pattern of matrix L as computed by f11mef.
4: lval(*) Real (Kind=nag_wp) array Input
Note: the dimension of the array lval must be at least as large as the dimension of the array of the same name in f11mef.
On entry: records the nonzero values of matrix L and some nonzero values of matrix U as computed by f11mef.
5: iu(*) Integer array Input
Note: the dimension of the array iu must be at least as large as the dimension of the array of the same name in f11mef.
On entry: records the sparsity pattern of matrix U as computed by f11mef.
6: uval(*) Real (Kind=nag_wp) array Input
Note: the dimension of the array uval must be at least as large as the dimension of the array of the same name in f11mef.
On entry: records some nonzero values of matrix U as computed by f11mef.
7: anorm Real (Kind=nag_wp) Input
On entry: if norm='1' or 'O', the 1-norm of the matrix A.
If norm='I', the -norm of the matrix A.
anorm may be computed by calling f11mlf with the same value for the argument norm.
Constraint: anorm0.0.
8: rcond Real (Kind=nag_wp) 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: ifail Integer Input/Output
On entry: ifail must be set to 0, −1 or 1 to set behaviour on detection of an error; these values have no effect when no error is detected.
A value of 0 causes the printing of an error message and program execution will be halted; otherwise program execution continues. A value of −1 means that an error message is printed while a value of 1 means that it is not.
If halting is not appropriate, the value −1 or 1 is recommended. If message printing is undesirable, then the value 1 is recommended. Otherwise, the value 0 is recommended. When the value -1 or 1 is used it is essential to test the value of ifail on exit.
On exit: ifail=0 unless the routine detects an error or a warning has been flagged (see Section 6).

6 Error Indicators and Warnings

If on entry ifail=0 or −1, explanatory error messages are output on the current error message unit (as defined by x04aaf).
Errors or warnings detected by the routine:
ifail=1
On entry, anorm=value.
Constraint: anorm0.0.
On entry, n=value.
Constraint: n0.
On entry, norm=value.
Constraint: norm='1', 'O' or 'I'.
ifail=-99
An unexpected error has been triggered by this routine. Please contact NAG.
See Section 7 in the Introduction to the NAG Library FL Interface for further information.
ifail=-399
Your licence key may have expired or may not have been installed correctly.
See Section 8 in the Introduction to the NAG Library FL Interface for further information.
ifail=-999
Dynamic memory allocation failed.
See Section 9 in the Introduction to the NAG Library FL Interface for further information.

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

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

9 Further Comments

A call to f11mgf 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 f11mef. The true condition number in the 1-norm is 10.875.

10.1 Program Text

Program Text (f11mgfe.f90)

10.2 Program Data

Program Data (f11mgfe.d)

10.3 Program Results

Program Results (f11mgfe.r)