naginterfaces.library.sparse.sym_​rcm

naginterfaces.library.sparse.sym_rcm(icolzp, irowix, lopts, mask=None)[source]

sym_rcm reduces the bandwidth of a sparse symmetric matrix stored in compressed column storage format using the Reverse Cuthill–McKee algorithm.

For full information please refer to the NAG Library document for f11ye

https://support.nag.com/numeric/nl/nagdoc_30/flhtml/f11/f11yef.html

Parameters
icolzpint, array-like, shape

records the index into which starts each new column.

irowixint, array-like, shape

The row indices corresponding to the nonzero elements in the matrix .

loptsbool, array-like, shape

The options to be used by sym_rcm.

Row/column of the matrix will only be referenced if , otherwise will be ignored.

The final permutation will not be reversed, that is, the Cuthill–McKee ordering will be returned. The bandwidth of the non-reversed matrix will be the same but the profile will be the same or larger (see Wai-Hung and Sherman (1976)).

The matrix will be checked for symmetrical sparsity pattern, otherwise not.

The bandwidth and profile of the unpermuted matrix will be calculated, otherwise not.

The bandwidth and profile of the permuted matrix will be calculated, otherwise not.

maskNone or int, array-like, shape , optional

Note: the required length for this argument is determined as follows: if : ; otherwise: .

is only referenced if is . A value of indicates that the node corresponding to row or column is not to be referenced. A value of indicates that the node corresponding to row or column is to be referenced. In particular, rows and columns not referenced will not be permuted.

Returns
permint, ndarray, shape

This will contain the permutation vector that describes the permutation matrix for the reordering of the matrix . The elements of the permutation matrix are zero except for the unit elements in row and column , .

infoint, ndarray, shape

Statistics about the matrix and the permuted matrix. The quantities below are calculated using any masking in effect otherwise the value zero is returned.

The bandwidth of the matrix , if .

The profile of the matrix , if .

The bandwidth of the permuted matrix , if .

The profile of the permuted matrix , if .

Raises
NagValueError
(errno )

On entry, .

Constraint: .

(errno )

On entry, .

Constraint: .

(errno )

On entry, and .

Constraint: for all .

(errno )

On entry, and .

Constraint: for all .

(errno )

On entry, .

Constraint: .

(errno )

On entry, and .

Constraint: .

(errno )

On entry, the matrix is not symmetric.

Element has no symmetric element.

Notes

sym_rcm takes the compressed column storage (CCS) representation (see the F11 Introduction) of an symmetric matrix and applies the Reverse Cuthill–McKee (RCM) algorithm which aims to minimize the bandwidth of the matrix by reordering the rows and columns symmetrically. This also results in a lower profile of the matrix (see Further Comments).

sym_rcm can be useful for solving systems of equations , as the permuted system (where is the permutation matrix described by the vector returned by sym_rcm) may require less storage space and/or less computational steps when solving (see Wai-Hung and Sherman (1976)).

sym_rcm may be used prior to real_symm_precon_ichol() and real_symm_precon_ichol_solve().

References

Pissanetsky, S, 1984, Sparse Matrix Technology, Academic Press

Wai-Hung, L and Sherman, A H, 1976, Comparative analysis of the Cuthill–McKee and the reverse Cuthill–McKee ordering algorithms for sparse matrices, SIAM J. Numer. Anal. (13(2)), 198–213