NAG FL Interface
f11mdf (direct_​real_​gen_​setup)

Settings help

FL Name Style:


FL Specification Language:


1 Purpose

f11mdf computes a column permutation suitable for LU factorization (by f11mef) of a real sparse matrix in compressed column (Harwell–Boeing) format and applies it to the matrix. This routine must be called prior to f11mef.

2 Specification

Fortran Interface
Subroutine f11mdf ( spec, n, icolzp, irowix, iprm, ifail)
Integer, Intent (In) :: n, icolzp(max(1,(n+1))), irowix(max(1,(ICOLZP(max(1,(n+1)))-1)))
Integer, Intent (Inout) :: iprm(max(1,(7*n))), ifail
Character (1), Intent (In) :: spec
C Header Interface
#include <nag.h>
void  f11mdf_ (const char *spec, const Integer *n, const Integer icolzp[], const Integer irowix[], Integer iprm[], Integer *ifail, const Charlen length_spec)
The routine may be called by the names f11mdf or nagf_sparse_direct_real_gen_setup.

3 Description

Given a sparse matrix in compressed column (Harwell–Boeing) format A and a choice of column permutation schemes, the routine computes those data structures that will be needed by the LU factorization routine f11mef and associated routines f11mmf, f11mff and f11mhf. The column permutation choices are:
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 A.

4 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

5 Arguments

1: spec Character(1) Input
On entry: indicates the permutation to be applied.
spec='N'
The identity permutation is used (i.e., the columns are not permuted).
spec='U'
The permutation in the iprm array is used, as supplied by you.
spec='M'
The permutation computed by the COLAMD algorithm is used
Constraint: spec='N', 'U' or 'M'.
2: n Integer Input
On entry: n, the order of the matrix A.
Constraint: n0.
3: icolzp(max(1,(n+1))) Integer array Input
On entry: the new column index array of sparse matrix A. See Section 2.1.3 in the F11 Chapter Introduction.
4: irowix(max(1,(icolzp(max(1,(n+1)))-1))) Integer array Input
On entry: irowix(i) contains the row index in A for element A(i). See Section 2.1.3 in the F11 Chapter Introduction.
5: iprm(max(1,(7×n))) Integer array Input/Output
On entry: the first n entries contain the column permutation if supplied by the user. This will be used if spec='U', and ignored otherwise. If used, it must consist of a permutation of all the integers in the range [0,(n-1)], the leftmost column of the matrix A denoted by 0 and the rightmost by n-1. Labelling columns in this way, iprm(i)=j means that column i-1 of A is in position j in APc, where Pr A Pc=LU expresses the factorization to be performed.
On exit: The column permutation given or computed is returned in the second n entries. The rest of the array contains data structures that will be used by other routines in the suite. The routine computes the column elimination tree for A 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 and this permutation is returned in the first n entries. This whole array is needed by the LU factorization routine f11mef and associated routines f11mff, f11mhf and f11mmf and should be passed to them unchanged.
6: 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, n=value.
Constraint: n0.
On entry, spec=value.
Constraint: spec='N', 'U' or 'M'.
ifail=2
Incorrect column permutations in array iprm.
ifail=3
COLAMD algorithm failed.
ifail=4
Incorrect specification of argument icolzp.
ifail=5
Incorrect specification of argument irowix.
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

Not applicable. This computation does not use floating-point numbers.

8 Parallelism and Performance

Background information to multithreading can be found in the Multithreading documentation.
f11mdf is threaded by NAG for parallel execution in multithreaded implementations of the NAG Library.
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

We recommend calling this routine with spec='M' before calling f11mef. The COLAMD algorithm computes a sparsity-preserving permutation Pc solely from the pattern of A such that the LU factorization Pr A Pc = LU remains as sparse as possible, regardless of the subsequent choice of Pr. The algorithm takes advantage of the existence of super-columns (columns with the same sparsity pattern) to reduce running time.

10 Example

This example computes a sparsity preserving column permutation for the LU 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 ) .  

10.1 Program Text

Program Text (f11mdfe.f90)

10.2 Program Data

Program Data (f11mdfe.d)

10.3 Program Results

Program Results (f11mdfe.r)