public class Permutation
extends java.lang.Object
| Constructor and Description |
|---|
Permutation(byte[] enc)
Create a permutation from an encoded permutation.
|
Permutation(int n)
Create the identity permutation of the given size.
|
Permutation(int[] perm)
Create a permutation using the given permutation vector.
|
Permutation(int n,
java.security.SecureRandom sr)
Create a random permutation of the given size.
|
| Modifier and Type | Method and Description |
|---|---|
Permutation |
computeInverse()
Compute the inverse permutation P-1.
|
boolean |
equals(java.lang.Object other)
checks if given object is equal to this permutation.
|
byte[] |
getEncoded()
Encode this permutation as byte array.
|
int[] |
getVector() |
int |
hashCode() |
Permutation |
rightMultiply(Permutation p)
Compute the product of this permutation and another permutation.
|
java.lang.String |
toString() |
public Permutation(int n)
n - the size of the permutationpublic Permutation(int[] perm)
perm - the permutation vectorpublic Permutation(byte[] enc)
enc - the encoded permutationpublic Permutation(int n,
java.security.SecureRandom sr)
n - the size of the permutationsr - the source of randomnesspublic byte[] getEncoded()
public int[] getVector()
public Permutation computeInverse()
public Permutation rightMultiply(Permutation p)
p - the other permutationpublic boolean equals(java.lang.Object other)
The method returns false whenever the given object is not permutation.
equals in class java.lang.Objectother - -
permutationpublic java.lang.String toString()
toString in class java.lang.Objectpublic int hashCode()
hashCode in class java.lang.Object