Mathematics
A
matrix P with the multiplicative property of altering the row or column ordering of a matrix. For example, the
LU Decomposition of a matrix, essential to
numerical analysis, works best with an LU decomposition of a specially permuted matrix A, i.e.
PA = LU
Permutation matrices can be formed by adjustment of the
identity matrix. Left multiplication (e.g. P*A) permutes rows, whereas right multiplication (A*P) permutes columns. For example, the following exercise exchanges rows 2 and 3 of matrix A:
P * A = PA
{ 1 0 0 { a b c { a b c
0 0 1 * d e f = g h i
0 1 0 } g h i } d e f }
Aside from pedagogical uses, permutation matrices are typically not stored in a dense 2d matrix form, as they can be compactly specified in a 1d vector.