STFC Website

part of UK Research & Innovation

Version 1.0.0

12th July 2004

MC22: Permute a sparse matrix given row and column permutations

Given a sparse matrix \(\mathbf{A} = {\{a _{ij}\}} _{n \times n}\) and a row permutation matrix \(\mathbf{P}\) and a column permutation matrix \(\mathbf{Q}\), this subroutine performs the permutation \(\mathbf{\hat{A}} = \mathbf{PAQ}\). The nonzero entries of \(\mathbf{A}\) are stored by rows in a compact form and the user defines the permutation matrices \(\mathbf{P}\) and \(\mathbf{Q}\) by index vectors of length \(n\).