p = symrcm(S)
| Parameter | Description |
|---|---|
| S | a square sparse or full floating-point or logical matrix. |
| Parameter | Description |
|---|---|
| p | row vector permutation. |
symrcm returns a Reverse Cuthill-McKee permutation computed from the symmetrized nonzero pattern of S.
The permutation can reduce matrix bandwidth before sparse factorizations or iterative solves.
Double, single, logical, complex double, and complex single square matrices are supported, both full and sparse. For sparse input, stored zero values are ignored when the graph pattern is built.
The returned permutation is a row vector of one-based indices. Applying S(p,p) reorders rows and columns consistently.
S = sparse([0 1 0 0; 1 0 1 0; 0 1 0 1; 0 0 1 0]);
p = symrcm(S)
S = sparse(single([0 1i; 0 0]));
p = symrcm(S)
| Version | Description |
|---|---|
| 2.0.0 | initial version |