/** * For indices with zero length */ public static IndicesSymmetries getEmpty() { if (EMPTY_INDICES_SYMMETRIES == null) EMPTY_INDICES_SYMMETRIES = new IndicesSymmetries(StructureOfIndices.getEmpty(), Collections.EMPTY_LIST, null); return EMPTY_INDICES_SYMMETRIES; }
@Override public IndicesSymmetries clone() { if (structureOfIndices.size() == 0) return getEmpty(); return new IndicesSymmetries(structureOfIndices, new ArrayList<>(generators), permutationGroup); }
/** * Creates symmetries with empty generating set. * * @param structureOfIndices structure of indices for which this symmetries can be assigned * @return symmetries with empty generating set for indices with specified structure */ public static IndicesSymmetries create(StructureOfIndices structureOfIndices) { if (structureOfIndices.size() == 0) return getEmpty(); return new IndicesSymmetries(structureOfIndices); }
/** * Creates symmetries of indices with specified structure and with specified generating set. * * @param structureOfIndices structure of indices for which this symmetries can be assigned * @param generators generating set * @return symmetries with specified generating set for indices with specified structure * @throws java.lang.IllegalArgumentException if some generator in {@code generators} have degree different from * size of {@code structureOfIndices} */ public static IndicesSymmetries create(StructureOfIndices structureOfIndices, List<Permutation> generators) { for (Permutation p : generators) if (p.degree() > structureOfIndices.size()) throw new IllegalArgumentException("Permutation degree not equal to indices size."); if (structureOfIndices.size() == 0) return getEmpty(); return new IndicesSymmetries(structureOfIndices, new ArrayList<>(generators), null); }
/** * Creates symmetries of indices with specified structure and with specified permutation group. * * @param structureOfIndices structure of indices for which this symmetries can be assigned * @param group permutation group * @return symmetries with specified permutation group for indices with specified structure * @throws java.lang.IllegalArgumentException if {@code group.degree() != structureOfIndices.size()} */ public static IndicesSymmetries create(StructureOfIndices structureOfIndices, PermutationGroup group) { if (group.degree() != structureOfIndices.size()) throw new IllegalArgumentException("Degree of permutation group not equal to indices size."); if (structureOfIndices.size() == 0) return getEmpty(); return new IndicesSymmetries(structureOfIndices, group.generators(), group); }