Skip to main content

Module reorder

Module reorder 

Source
Expand description

Sparse matrix reordering algorithms.

Reordering reduces bandwidth (RCM) or fill-in (AMD) of sparse matrices, improving the performance of direct and iterative solvers.

§Algorithms

  • Reverse Cuthill-McKee (RCM): BFS from a peripheral node, reversed. Reduces matrix bandwidth, which improves cache locality for SpMV and reduces fill-in for banded preconditioners.

  • Approximate Minimum Degree (AMD): Greedy elimination choosing the node with minimum degree. Reduces fill-in for Cholesky/LU factorization.

§Usage

let perm = rcm_ordering(matrix)?;
let reordered = permute_csr(matrix, &perm)?;

Functions§

amd_ordering
Compute the Approximate Minimum Degree (AMD) ordering of a sparse matrix.
amd_ordering_host
Host-side AMD ordering computation.
bandwidth
Compute the bandwidth of a matrix given its CSR structure.
inverse_permutation
Compute the inverse permutation.
permute_csr
Apply a permutation to a CSR matrix: P * A * P^T.
rcm_ordering
Compute the Reverse Cuthill-McKee (RCM) ordering of a sparse matrix.
rcm_ordering_host
Host-side RCM ordering computation.