| Modifier and Type | Field and Description |
|---|---|
| private int[] | perm
perm holds the elements of the permutation vector, i.e. [perm(0), perm(1), ..., perm(n-1)] |
| Access | Constructor and Description |
|---|---|
| public | |
| public | Permutation(int[]
the permutation vector perm)Create a permutation using the given permutation vector. |
| public | |
| public | Permutation(int
the size of the permutation n, SecureRandom the source of randomness sr)Create a random permutation of the given size. |
| Modifier and Type | Method and Description |
|---|---|
| public Permutation | |
| public boolean | Returns: true or false-
permutation other)Overrides java. |
| public byte[] | |
| public int[] | |
| public int | Returns: the hash code of this permutationOverrides java. |
| private boolean | Returns: true if perm represents an n-permutation and false otherwisepermutation vector perm)Check that the given array corresponds to a permutation of the set {0, 1, ..., n-1}. |
| public Permutation | Returns: this * pthe other permutation p)Compute the product of this permutation and another permutation. |
| public String | Returns: a human readable form of the permutationOverrides java. |
| perm | back to summary |
|---|---|
| private int[] perm perm holds the elements of the permutation vector, i.e. [perm(0), perm(1), ..., perm(n-1)] | |
| Permutation | back to summary |
|---|---|
| public Permutation(int n) Create the identity permutation of the given size.
| |
| Permutation | back to summary |
|---|---|
| public Permutation(int[] perm) Create a permutation using the given permutation vector.
| |
| Permutation | back to summary |
|---|---|
| public Permutation(byte[] enc) Create a permutation from an encoded permutation.
| |
| Permutation | back to summary |
|---|---|
| public Permutation(int n, SecureRandom sr) Create a random permutation of the given size.
| |
| computeInverse | back to summary |
|---|---|
| public Permutation computeInverse() Compute the inverse permutation P-1.
| |
| equals | back to summary |
|---|---|
| public boolean equals(Object other) Overrides java. checks if given object is equal to this permutation. The method returns false whenever the given object is not permutation.
| |
| getEncoded | back to summary |
|---|---|
| public byte[] getEncoded() Encode this permutation as byte array.
| |
| getVector | back to summary |
|---|---|
public int[] getVector()
| |
| hashCode | back to summary |
|---|---|
| public int hashCode() Overrides java. Doc from java. Returns a hash code value for the object. This method is
supported for the benefit of hash tables such as those provided by
The general contract of
| |
| isPermutation | back to summary |
|---|---|
| private boolean isPermutation(int[] perm) Check that the given array corresponds to a permutation of the set {0, 1, ..., n-1}.
| |
| rightMultiply | back to summary |
|---|---|
| public Permutation rightMultiply(Permutation p) Compute the product of this permutation and another permutation.
| |
| toString | back to summary |
|---|---|
| public String toString() Overrides java. Doc from java. Returns a string representation of the object.
| |