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 permutation will be used.

Returns the matrix permuted by these row and column permutations.

Version:
$Id: $Id
Author:
josephramsey
See Also:
  • Constructor Summary

    Constructors
    Constructor
    Description
    PermutationMatrixPair(Matrix M, int[] rowPerm, int[] colPerm)
    Constructs with a given matrix M and a row and column permutation (which may be null).
  • Method Summary

    Modifier and Type
    Method
    Description
    int[]
    Returns a copy of the column permutation array for the PermutationMatrixPair.
    Returns W, permuted row-wise by the permutation passed in through the constructor.
    int[]
    Returns the row permutation array of the PermutationMatrixPair.
    Returns a string representation of the object.

    Methods inherited from class java.lang.Object

    equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
  • 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 row-wise by the permutation passed in through the constructor.
      Returns:
      The matrix, permuted column-wise and row-wise, by the specified column and row permutations.
    • getRowPerm

      public int[] getRowPerm()
      Returns the row permutation array of the PermutationMatrixPair.
      Returns:
      The row permutation array.
    • getColPerm

      public int[] getColPerm()
      Returns a copy of the column permutation array for the PermutationMatrixPair.
      Returns:
      The column permutation array.
    • toString

      public String toString()
      Returns a string representation of the object.
      Overrides:
      toString in class Object
      Returns:
      A string representation of the object.