/** * Returns the conjugate permutation group of {@code this} with the specified permutation (this ^ permutation). * * @param permutation some permutation * @return conjugate permutation group of {@code this} with the specified permutation */ public PermutationGroup conjugate(Permutation permutation) { if (this.isTrivial()) return this; if (bsgs == null) { ArrayList<Permutation> newGens = new ArrayList<>(generators().size()); for (Permutation p : generators()) newGens.add(permutation.conjugate(p)); return createPermutationGroup(newGens); } else { List<BSGSElement> bsgs = getBSGS(); ArrayList<BSGSElement> new_bsgs = new ArrayList<>(bsgs.size()); for (BSGSElement e : bsgs) { ArrayList<Permutation> newStabs = new ArrayList<>(e.stabilizerGenerators.size()); for (Permutation p : e.stabilizerGenerators) newStabs.add(permutation.conjugate(p)); new_bsgs.add(new BSGSCandidateElement(permutation.newIndexOf(e.basePoint), newStabs, internalDegree).asBSGSElement()); } return createPermutationGroupFromBSGS(new_bsgs); } }
for (int i = 0; i < 10; ++i) { Permutation c = RandomPermutation.random(randomSource).conjugate( RandomPermutation.random(closureSource)); for (Permutation generator : generators) for (Permutation cGenerator : closure.get(0).stabilizerGenerators) if (!AlgorithmsBase.membershipTest(closure, generator.conjugate(cGenerator))) { completed = false; break out;