-
Notifications
You must be signed in to change notification settings - Fork 3
/
NoPermutation.java
122 lines (104 loc) · 2.12 KB
/
NoPermutation.java
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
import java.util.ArrayList;
import java.util.HashMap;
import java.util.HashSet;
import java.util.Iterator;
import java.util.List;
import java.util.Map;
import java.util.Set;
/**
*
* @author Aleksandr Nosov
* @author Kai Bielenberg
*/
public class NoPermutation implements Permutation, Cycle, Transposition {
private static NoPermutation instance=new NoPermutation();
private NoPermutation(){
}
public static NoPermutation valueOf(){
return instance;
}
@Override
public Iterator<Integer> iterator() {
return new ArrayList<Integer>().iterator();
}
@Override
public int getPermElement(int inverseImage){
return 0;
}
@Override
public Cycle cycle(int index){
return valueOf();
}
@Override
public List<Cycle> allCycles() {
return new ArrayList<Cycle>();
}
@Override
public Set<Integer> fixedPoints() {
return new HashSet<Integer>();
}
@Override
public Permutation inverse() {
return NoPermutation.valueOf();
}
@Override
public Permutation compose(Permutation other){
return NoPermutation.valueOf();
}
@Override
public String toCycleNotationString() {
return "NoPermutation";
}
@Override
public int permutationClass() {
return 0;
}
@Override
public int order() {
return 0;
}
@Override
public Permutation permPower(int n) {
return NoPermutation.valueOf();
}
@Override
public String toCycleTypeString() {
return "[ ]";
}
@Override
public Map<Integer, Integer> cycleType() {
return new HashMap<Integer, Integer>();
}
@Override
public List<Transposition> toTranspositions() {
return new ArrayList<Transposition>();
}
@Override
public String toTranspositionString() {
return "NoTransposition";
}
@Override
public int sign() {
return 1;
}
@Override
public String toString(){
return "NaP";
}
@Override
public Permutation unRank(int rank) {
return NoPermutation.valueOf();
}
@Override
public int rank() {
return -1;
}
@Override
public String toShortString() {
return "NaP";
}
@Override
public List<Cycle> allCyclesAsPermutaion() {
return new ArrayList<Cycle>();
}
}