NAG C Library Function Document

nag_superlu_column_permutation (f11mdc)


nag_superlu_column_permutation (f11mdc) computes a column permutation suitable for LU  factorization (by nag_superlu_lu_factorize (f11mec)) 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_superlu_lu_factorize (f11mec).


#include <nag.h>
#include <nagf11.h>
void  nag_superlu_column_permutation (Nag_ColumnPermutationType spec, Integer n, const Integer icolzp[], const Integer irowix[], Integer iprm[], NagError *fail)


Given a sparse matrix in compressed column (Harwell–Boeing) format A and a choice of column permutation schemes, the function computes those data structures that will be needed by the LU  factorization function nag_superlu_lu_factorize (f11mec) and associated functions nag_superlu_diagnostic_lu (f11mmc), nag_superlu_solve_lu (f11mfc) and nag_superlu_refine_lu (f11mhc). 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.


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


1:     spec Nag_ColumnPermutationTypeInput
On entry: 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: spec=Nag_Sparse_Identity, Nag_Sparse_User or Nag_Sparse_Colamd.
2:     n IntegerInput
On entry: n, the order of the matrix A.
Constraint: n0.
3:     icolzp[max1,n+1] const IntegerInput
On entry: icolzp[i-1] contains the index in A of the start of a new column. See Section 2.1.3 in the f11 Chapter Introduction.
4:     irowix[dim] const IntegerInput
Note: the dimension, dim, of the array irowix must be at least max1,icolzp[max1,n+1-1]-1.
On entry: irowix[i-1] contains the row index in A for element Ai. See Section 2.1.3 in the f11 Chapter Introduction.
5:     iprm[max1,7×n] IntegerInput/Output
On entry: the first n entries contain the column permutation supplied by you. This will be used if spec=Nag_Sparse_User, 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: a new permutation is returned in the first n entries. The rest of the array contains data structures that will be used by other functions. The function 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. This array is needed by the LU  factorization function nag_superlu_lu_factorize (f11mec) and associated functions nag_superlu_solve_lu (f11mfc), nag_superlu_refine_lu (f11mhc) and nag_superlu_diagnostic_lu (f11mmc) and should be passed to them unchanged.
6:     fail NagError *Input/Output
The NAG error argument (see Section 3.7 in How to Use the NAG Library and its Documentation).

Error Indicators and Warnings

COLAMD algorithm failed.
Dynamic memory allocation failed.
See Section in How to Use the NAG Library and its Documentation for further information.
On entry, argument value had an illegal value.
On entry, n=value.
Constraint: n0.
An internal error has occurred in this function. Check the function call and any array sizes. If the call is correct then please contact NAG for assistance.
See Section 2.7.6 in How to Use the NAG Library and its Documentation for further information.
Incorrect column permutations in array iprm.
Your licence key may have expired or may not have been installed correctly.
See Section 2.7.5 in How to Use the NAG Library and its Documentation for further information.
Incorrect specification of argument icolzp.
Incorrect specification of argument irowix.


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

Parallelism and Performance

nag_superlu_column_permutation (f11mdc) 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 function. Please also consult the Users' Note for your implementation for any additional implementation-specific information.

Further Comments

We recommend calling this function with spec=Nag_Sparse_Colamd before calling nag_superlu_lu_factorize (f11mec). 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.


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 .  

Program Text

Program Text (f11mdce.c)

Program Data

Program Data (f11mdce.d)

Program Results

Program Results (f11mdce.r)