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)

Purpose

nag_sparse_direct_real_gen_diag (f11mm) computes the reciprocal pivot growth factor of an LU 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 maxj(Aj / Uj)maxj(Aj/Uj) from the columns AjAj and UjUj of an LU LU  factorization of the matrix AA, Pr A Pc = LU Pr A Pc = LU  where PrPr is a row permutation matrix, PcPc is a column permutation matrix, LL is unit lower triangular and UU is upper triangular as computed by nag_sparse_direct_real_gen_lu (f11me).

References

None.

Parameters

Compulsory Input Parameters

1:     n – int64int32nag_int scalar
nn, the order of the matrix AA.
Constraint: n0n0.
2:     icolzp( : :) – int64int32nag_int array
Note: the dimension of the array icolzp must be at least n + 1n+1.
icolzp(i)icolzpi contains the index in AA of the start of a new column. See Section [Compressed column storage (CCS) format] in the F11 Chapter Introduction.
3:     a( : :) – double array
Note: the dimension of the array a must be at least icolzp(n + 1)1icolzpn+1-1, the number of nonzeros of the sparse matrix AA.
The array of nonzero values in the sparse matrix AA.
4:     iprm(7 × n7×n) – int64int32nag_int array
The column permutation which defines PcPc, the row permutation which defines PrPr, plus associated data structures as computed by nag_sparse_direct_real_gen_lu (f11me).
5:     il( : :) – int64int32nag_int array
Note: 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 LL as computed by nag_sparse_direct_real_gen_lu (f11me).
6:     lval( : :) – double array
Note: 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 LL and some nonzero values of matrix UU as computed by nag_sparse_direct_real_gen_lu (f11me).
7:     iu( : :) – int64int32nag_int array
Note: 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 UU as computed by nag_sparse_direct_real_gen_lu (f11me).
8:     uval( : :) – double array
Note: 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 UU as computed by nag_sparse_direct_real_gen_lu (f11me).

Optional Input Parameters

None.

Input Parameters Omitted from the MATLAB Interface

None.

Output Parameters

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

Error Indicators and Warnings

Errors or warnings detected by the function:
  ifail = 1ifail=1
On entry,n < 0n<0.
  ifail = 2ifail=2
Ill-defined column permutations in array iprmiprm. Internal checks have revealed that the iprmiprm array is corrupted.
  ifail = 301ifail=301
Unable to allocate required internal workspace.

Accuracy

Not applicable.

Further Comments

If the reciprocal pivot growth factor, rpg, is much less than 11, then the factorization of the matrix AA 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 parameter in the call to nag_sparse_direct_real_gen_lu (f11me).

Example

function nag_sparse_direct_real_gen_diag_example
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];
iprm = zeros(1, 7*n, 'int64');
spec = 'M';
thresh = 1;
nzlmx = int64(8*nz);
nzlumx = int64(8*nz);
nzumx = int64(8*nz);

% Calculate COLAMD permutation
[iprm, ifail] = nag_sparse_direct_real_gen_setup(spec, n, icolzp, irowix, iprm);

% Factorise
[iprm, nzlumx, il, lval, iu, uval, nnzl, nnzu, flop, ifail] = ...
    nag_sparse_direct_real_gen_lu(n, irowix, a, iprm, thresh, nzlmx, nzlumx, nzumx);

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

rpg =

     1


ifail =

                    0


function f11mm_example
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];
iprm = zeros(1, 7*n, 'int64');
spec = 'M';
thresh = 1;
nzlmx = int64(8*nz);
nzlumx = int64(8*nz);
nzumx = int64(8*nz);

% Calculate COLAMD permutation
[iprm, ifail] = f11md(spec, n, icolzp, irowix, iprm);

% Factorise
[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)
 

rpg =

     1


ifail =

                    0



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–2013