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 permtuation 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[]
Getter for the fieldcolPerm
.Returns W, permuted rowwise by the permutation passed in through the constructor.int[]
Getter for the fieldrowPerm
.toString()
Prints a string representation of this.
-
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 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()Getter for the field
rowPerm
.- Returns:
- The row permutation.
-
getColPerm
public int[] getColPerm()Getter for the field
colPerm
.- Returns:
- The column permutation.
-
toString
-