NAG Library Routine Document

f11mgf  (direct_real_gen_cond)

 Contents

    1  Purpose
    7  Accuracy

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

3
Description

f11mgf 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 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 κ1A or κA is to be estimated.
norm='1' or 'O'
κ1A is estimated.
norm='I'
κA is estimated.
Constraint: norm='1', 'O' or 'I'.
2:     n – IntegerInput
On entry: n, the order of the matrix A.
Constraint: n0.
3:     il* – Integer arrayInput
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) arrayInput
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 arrayInput
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) arrayInput
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 – IntegerInput/Output
On entry: ifail must be set to 0, -1​ or ​1. If you are unfamiliar with this argument you should refer to Section 3.4 in How to Use the NAG Library and its Documentation for details.
For environments where it might be inappropriate to halt program execution when an error is detected, the value -1​ or ​1 is recommended. If the output of error messages is undesirable, then the value 1 is recommended. Otherwise, if you are not familiar with this argument, the recommended value is 0. 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 3.9 in How to Use the NAG Library and its Documentation for further information.
ifail=-399
Your licence key may have expired or may not have been installed correctly.
See Section 3.8 in How to Use the NAG Library and its Documentation for further information.
ifail=-999
Dynamic memory allocation failed.
See Section 3.7 in How to Use the NAG Library and its Documentation 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

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)

© The Numerical Algorithms Group Ltd, Oxford, UK. 2017