public class Permutation
extends java.lang.Object
| Constructor and Description |
|---|
Permutation()
Creates an empty permutation
|
Permutation(java.util.Map<java.lang.Integer,java.lang.Integer> permutation)
Creates a permutation with an initial value
|
| Modifier and Type | Method and Description |
|---|---|
java.util.List<java.util.List<java.lang.Integer>> |
cyclicRepresenatation()
Finds the cyclis representation of the permutation
|
boolean |
equals(java.lang.Object obj) |
java.util.List<java.lang.Integer> |
fix()
Finds the fix of the permutation
|
java.util.Map<java.lang.Integer,java.lang.Integer> |
getPermutation() |
Permutation |
inverse()
Calculates inverse permutation
|
boolean |
isIdentityPermutation()
Checks if the permutation is an identity permutation
|
Permutation |
mul(Permutation other)
Multiplies this permutation with the provided one
|
java.util.List<java.lang.Integer> |
orbit(java.lang.Integer u)
Finds he permutations orbit given a vertex
|
int |
order()
Calculates the permutation's order
|
void |
setPermutation(java.util.Map<java.lang.Integer,java.lang.Integer> permutation) |
java.lang.String |
toString() |
public Permutation()
public Permutation(java.util.Map<java.lang.Integer,java.lang.Integer> permutation)
permutation - A map representing a permutationpublic Permutation inverse()
public Permutation mul(Permutation other)
other - Permutation to multiply withpublic int order()
public boolean isIdentityPermutation()
true if the permutation is an identity permutation false
otherwisepublic java.util.List<java.util.List<java.lang.Integer>> cyclicRepresenatation()
public java.util.List<java.lang.Integer> fix()
public java.util.List<java.lang.Integer> orbit(java.lang.Integer u)
u - Vertexpublic java.util.Map<java.lang.Integer,java.lang.Integer> getPermutation()
public void setPermutation(java.util.Map<java.lang.Integer,java.lang.Integer> permutation)
public java.lang.String toString()
toString in class java.lang.Objectpublic boolean equals(java.lang.Object obj)
equals in class java.lang.Object