Class PermutationMatrix

java.lang.Object
org.flag4j.arrays.sparse.PermutationMatrix
All Implemented Interfaces:
Serializable

public class PermutationMatrix extends Object implements Serializable
A permutation matrix is a square matrix containing only zeros and ones such that each row and column have exactly a single one. The identity matrix is a special case of a permutation matrix. Permutation matrices are commonly used to track or apply row/column swaps in a matrix.

All permutation matrices are orthogonal/unitary meaning their inverse is equal to their transpose.

When a permutation matrix is left multiplied to a second matrix, it has the result of swapping rows in the second matrix.

Similarly, when a permutation matrix is right multiplied to another matrix, it has the result of swapping columns in the other matrix.
See Also: