PDF version (NAG web site
, 64-bit version, 64-bit version)
NAG Toolbox: nag_sparse_direct_real_gen_setup (f11md)
Purpose
nag_sparse_direct_real_gen_setup (f11md) computes a column permutation suitable for
factorization (by
nag_sparse_direct_real_gen_lu (f11me)) of a real sparse matrix in compressed column (Harwell–Boeing) format and applies it to the matrix. This function must be called prior to
nag_sparse_direct_real_gen_lu (f11me).
Syntax
Description
Given a sparse matrix in compressed column (Harwell–Boeing) format
and a choice of column permutation schemes, the function computes those data structures that will be needed by the
factorization function
nag_sparse_direct_real_gen_lu (f11me) and associated functions
nag_sparse_direct_real_gen_diag (f11mm),
nag_sparse_direct_real_gen_solve (f11mf) and
nag_sparse_direct_real_gen_refine (f11mh). The column permutation choices are:
- original order (that is, no permutation);
- user-supplied permutation;
- a permutation, computed by the function, designed to minimize fill-in during the factorization.
The algorithm for this computed permutation is based on the approximate minimum degree column ordering algorithm COLAMD. The computed permutation is not sensitive to the magnitude of the nonzero values of .
References
Amestoy P R, Davis T A and Duff I S (1996) An approximate minimum degree ordering algorithm SIAM J. Matrix Anal. Appl. 17 886–905
Gilbert J R and Larimore S I (2004) A column approximate minimum degree ordering algorithm ACM Trans. Math. Software 30,3 353–376
Gilbert J R, Larimore S I and Ng E G (2004) Algorithm 836: COLAMD, an approximate minimum degree ordering algorithm ACM Trans. Math. Software 30, 3 377–380
Parameters
Compulsory Input Parameters
- 1:
– string (length ≥ 1)
-
Indicates the permutation to be applied.
- The identity permutation is used (i.e., the columns are not permuted).
- The permutation in the iprm array is used, as supplied by you.
- The permutation computed by the COLAMD algorithm is used
Constraint:
, or .
- 2:
– int64int32nag_int scalar
-
, the order of the matrix .
Constraint:
.
- 3:
– int64int32nag_int array
-
The dimension of the array
icolzp
must be at least
contains the index in
of the start of a new column. See
Compressed column storage (CCS) format in the F11 Chapter Introduction.
- 4:
– int64int32nag_int array
-
The dimension of the array
irowix
must be at least
, the number of nonzeros of the sparse matrix
contains the row index in
for element
. See
Compressed column storage (CCS) format in the F11 Chapter Introduction.
- 5:
– int64int32nag_int array
-
The first entries contain the column permutation supplied by you. This will be used if , and ignored otherwise. If used, it must consist of a permutation of all the integers in the range , the leftmost column of the matrix denoted by and the rightmost by . Labelling columns in this way, means that column of is in position in , where expresses the factorization to be performed.
Optional Input Parameters
None.
Output Parameters
- 1:
– int64int32nag_int array
-
A new permutation is returned in the first
entries. The rest of the array contains data structures that will be used by other functions. The function computes the column elimination tree for
and a post-order permutation on the tree. It then compounds the
iprm permutation given or computed by the COLAMD algorthm with the post-order permutation. This array is needed by the
factorization function
nag_sparse_direct_real_gen_lu (f11me) and associated functions
nag_sparse_direct_real_gen_solve (f11mf),
nag_sparse_direct_real_gen_refine (f11mh) and
nag_sparse_direct_real_gen_diag (f11mm) and should be passed to them unchanged.
- 2:
– int64int32nag_int scalar
unless the function detects an error (see
Error Indicators and Warnings).
Error Indicators and Warnings
Errors or warnings detected by the function:
-
-
Constraint: .
On entry, .
Constraint: , or .
-
-
Incorrect column permutations in array
iprm.
-
-
COLAMD algorithm failed.
-
-
Incorrect specification of argument
icolzp.
-
-
Incorrect specification of argument
irowix.
-
An unexpected error has been triggered by this routine. Please
contact
NAG.
-
Your licence key may have expired or may not have been installed correctly.
-
Dynamic memory allocation failed.
Accuracy
Not applicable. This computation does not use floating-point numbers.
Further Comments
We recommend calling this function with
before calling
nag_sparse_direct_real_gen_lu (f11me). The COLAMD algorithm computes a sparsity-preserving permutation
solely from the pattern of
such that the
factorization
remains as sparse as possible, regardless of the subsequent choice of
. The algorithm takes advantage of the existence of super-columns (columns with the same sparsity pattern) to reduce running time.
Example
This example computes a sparsity preserving column permutation for the
factorization of the matrix
, where
Open in the MATLAB editor:
f11md_example
function f11md_example
fprintf('f11md example results\n\n');
n = int64(5);
icolzp = [int64(1); 3; 5; 7; 9; 12];
irowix = [int64(1); 3; 1; 5; 2; 3; 2; 4; 3; 4; 5];
iprm = zeros(1, 7*n, 'int64');
spec = 'M';
[iprm, ifail] = f11md( ...
spec, n, icolzp, irowix, iprm);
fprintf('\nCOLAMD Permutation\n');
disp(int2str(iprm(1:n)));
spec = 'U';
iprm(1:n)= [4, 3, 2, 1, 0];
[iprm, ifail] = f11md( ...
spec, n, icolzp, irowix, iprm);
fprintf('\nUser Permutation\n');
disp(int2str(iprm(1:n)));
spec = 'N';
[iprm, ifail] = f11md( ...
spec, n, icolzp, irowix, iprm);
fprintf('\nNatural Permutation\n');
disp(int2str(iprm(1:n)));
f11md example results
COLAMD Permutation
1 0 4 3 2
User Permutation
4 3 2 1 0
Natural Permutation
0 1 2 3 4
PDF version (NAG web site
, 64-bit version, 64-bit version)
© The Numerical Algorithms Group Ltd, Oxford, UK. 2009–2015