int i;
if (upperCount > 1) {
int[] upperTransposition = Combinatorics.createIdentity(upperCount + lowerCount);
upperTransposition[0] = 1;
upperTransposition[1] = 0;
Symmetry upperTranspositionSymmetry = new Symmetry(upperTransposition, false);
symmetries.addUnsafe(upperTranspositionSymmetry);
}
if (lowerCount > 1) {
int[] lowerTransposition = Combinatorics.createIdentity(upperCount + lowerCount);
lowerTransposition[upperCount] = 1 + upperCount;
lowerTransposition[upperCount + 1] = upperCount;
Symmetry lowerTranspositionSymmetry = new Symmetry(lowerTransposition, false);
symmetries.addUnsafe(lowerTranspositionSymmetry);
}
//cycle
if (upperCount > 2) {
int[] upperCycle = new int[upperCount + lowerCount];
upperCycle[0] = upperCount - 1;
for (i = 1; i < upperCount; ++i)
upperCycle[i] = i - 1;
for (; i < upperCount + lowerCount; ++i)
upperCycle[i] = i;
Symmetry upperCycleSymmetry = new Symmetry(upperCycle, false);
symmetries.addUnsafe(upperCycleSymmetry);
}
if (lowerCount > 2) {
int[] lowerCycle = new int[upperCount + lowerCount];
for (i = 0; i < upperCount; ++i)
lowerCycle[i] = i;
lowerCycle[upperCount] = upperCount + lowerCount - 1;
++i;
for (; i < upperCount + lowerCount; ++i)
lowerCycle[i] = i - 1;
Symmetry lowerCycleSymmetry = new Symmetry(lowerCycle, false);
symmetries.addUnsafe(lowerCycleSymmetry);
}
return symmetries;
}