hide long namesshow long names
hide short namesshow short names
Integer type:  int32  int64  nag_int  show int32  show int32  show int64  show int64  show nag_int  show nag_int

PDF version (NAG web site, 64-bit version, 64-bit version)
Chapter Contents
Chapter Introduction
NAG Toolbox

NAG Toolbox: nag_sparse_direct_real_gen_diag (f11mm)

 Contents

    1  Purpose
    2  Syntax
    7  Accuracy
    9  Example

Purpose

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

Syntax

[rpg, ifail] = f11mm(n, icolzp, a, iprm, il, lval, iu, uval)
[rpg, ifail] = nag_sparse_direct_real_gen_diag(n, icolzp, a, iprm, il, lval, iu, uval)

Description

nag_sparse_direct_real_gen_diag (f11mm) computes the reciprocal pivot growth factor maxjAj/Uj from the columns Aj and Uj of an LU  factorization of the matrix A, Pr A Pc = LU  where Pr is a row permutation matrix, Pc is a column permutation matrix, L is unit lower triangular and U is upper triangular as computed by nag_sparse_direct_real_gen_lu (f11me).

References

None.

Parameters

Compulsory Input Parameters

1:     n int64int32nag_int scalar
n, the order of the matrix A.
Constraint: n0.
2:     icolzp: int64int32nag_int array
The dimension of the array icolzp must be at least n+1
icolzpi contains the index in A of the start of a new column. See Compressed column storage (CCS) format in the F11 Chapter Introduction.
3:     a: – double array
The dimension of the array a must be at least icolzpn+1-1, the number of nonzeros of the sparse matrix A
The array of nonzero values in the sparse matrix A.
4:     iprm7×n int64int32nag_int array
The column permutation which defines Pc, the row permutation which defines Pr, plus associated data structures as computed by nag_sparse_direct_real_gen_lu (f11me).
5:     il: int64int32nag_int array
The dimension of the array il must be at least as large as the dimension of the array of the same name in nag_sparse_direct_real_gen_lu (f11me)
Records the sparsity pattern of matrix L as computed by nag_sparse_direct_real_gen_lu (f11me).
6:     lval: – double array
The dimension of the array lval must be at least as large as the dimension of the array of the same name in nag_sparse_direct_real_gen_lu (f11me)
Records the nonzero values of matrix L and some nonzero values of matrix U as computed by nag_sparse_direct_real_gen_lu (f11me).
7:     iu: int64int32nag_int array
The dimension of the array iu must be at least as large as the dimension of the array of the same name in nag_sparse_direct_real_gen_lu (f11me)
Records the sparsity pattern of matrix U as computed by nag_sparse_direct_real_gen_lu (f11me).
8:     uval: – double array
The dimension of the array uval must be at least as large as the dimension of the array of the same name in nag_sparse_direct_real_gen_lu (f11me)
Records some nonzero values of matrix U as computed by nag_sparse_direct_real_gen_lu (f11me).

Optional Input Parameters

None.

Output Parameters

1:     rpg – double scalar
The reciprocal pivot growth factor maxjAj/Uj. If the reciprocal pivot growth factor is much less than 1, the stability of the LU factorization may be poor.
2:     ifail int64int32nag_int scalar
ifail=0 unless the function detects an error (see Error Indicators and Warnings).

Error Indicators and Warnings

Errors or warnings detected by the function:
   ifail=1
Constraint: n0.
   ifail=2
Incorrect column permutations in array iprm.
   ifail=-99
An unexpected error has been triggered by this routine. Please contact NAG.
   ifail=-399
Your licence key may have expired or may not have been installed correctly.
   ifail=-999
Dynamic memory allocation failed.

Accuracy

Not applicable.

Further Comments

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_sparse_direct_real_gen_lu (f11me).

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


fprintf('f11mm example results\n\n');

% Calculate reciprocal pivot growth from factorization of sparse A 
n      = int64(5);
nz     = int64(11);
icolzp = [int64(1); 3; 5;  7; 9; 12];
irowix = [int64(1); 3; 1;  5; 2;  3;  2; 4; 3; 4; 5];
a      = [         2; 4; 1; -2; 1;  1; -1; 1; 1; 2; 3];

% Calculate COLAMD permutation
spec = 'M';
iprm = zeros(1, 7*n, 'int64');
[iprm, ifail] = f11md( ...
                       spec, n, icolzp, irowix, iprm);

% Factorise
thresh = 1;
nzlmx = int64(8*nz);
nzlumx = int64(8*nz);
nzumx = int64(8*nz);
[iprm, nzlumx, il, lval, iu, uval, nnzl, nnzu, flop, ifail] = ...
  f11me( ...
         n, irowix, a, iprm, thresh, nzlmx, nzlumx, nzumx);

% Calculate reciprocal pivot growth
[rpg, ifail] = f11mm( ...
                      n, icolzp, a, iprm, il, lval, iu, uval);

disp('Reciprocal pivot growth');
disp(rpg);


f11mm example results

Reciprocal pivot growth
     1


PDF version (NAG web site, 64-bit version, 64-bit version)
Chapter Contents
Chapter Introduction
NAG Toolbox

© The Numerical Algorithms Group Ltd, Oxford, UK. 2009–2015