Package edu.cmu.tetrad.search.utils
Class PermutationMatrixPair
java.lang.Object
edu.cmu.tetrad.search.utils.PermutationMatrixPair
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
ConstructorsConstructorDescriptionPermutationMatrixPair
(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 TypeMethodDescriptionint[]
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.toString()
Returns a string representation of the object.
-
Constructor Details
-
PermutationMatrixPair
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
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
Returns a string representation of the object.
-