Class PermutationMatrixPair

java.lang.Object
edu.cmu.tetrad.search.utils.PermutationMatrixPair

public class PermutationMatrixPair extends Object
Stores a matrix together with a row and column permutation. if either of these is null in the constructor, the identity permtuation will be used. Returns the matrix permuted by these row and column permutations.
Author:
josephramsey
See Also:
  • Constructor Details

    • PermutationMatrixPair

      public PermutationMatrixPair(Matrix M, int[] rowPerm, int[] colPerm)
      Constructs with a given matrix M and a row and column permutation (which may be null).
      Parameters:
      M - The matrix to be permuted.
      rowPerm - The row permutation for M; if null the identity permutation ([0 1 2...#rows]) will be used.
      colPerm - The row permutation for M; if null the identity permutation ([0 1 2...#cols]) will be used.
  • Method Details

    • getPermutedMatrix

      public Matrix getPermutedMatrix()
      Returns W, permuted rowwise by the permutation passed in through the constructor.
      Returns:
      The matrix, permuted columnwise and rowwise, by the specified column and row permutations.
    • getRowPerm

      public int[] getRowPerm()
      Returns:
      The row permutation.
    • getColPerm

      public int[] getColPerm()
      Returns:
      The column permutation.
    • toString

      public String toString()
      Prints a string representation of this.
      Overrides:
      toString in class Object
      Returns:
      The row and columns permutations, followed by the permuted matrix.