/*
 * Redberry: symbolic tensor computations.
 *
 * Copyright (c) 2010-2015:
 *   Stanislav Poslavsky   
 *   Bolotin Dmitriy       
 *
 * This file is part of Redberry.
 *
 * Redberry is free software: you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation, either version 3 of the License, or
 * (at your option) any later version.
 *
 * Redberry is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with Redberry. If not, see .
 */
package cc.redberry.core.groups.permutations;

import cc.redberry.core.utils.IntArrayList;

import java.util.ArrayList;
import java.util.List;

/**
 * This class holds i-th base point (βi), generators of
 * G(i) = Gβ1β2...βi-1 -
 * stabilizer of all base points from 0-th to (i-1)-th as described in Sec. 4.4.1 in [Holt05].
 * 

* Additionally it provides access to Δ(i) - the orbit of βi under * G(i), right transversals of H(i)βi - stabilizer of * βi in G(i). This access is based on Schreier vector as described in Sec. * 4.1.1 of [Holt05]. * * @author Dmitry Bolotin * @author Stanislav Poslavsky * @since 1.1.6 */ public class BSGSElement { /** * i-th base point (βi) */ public final int basePoint; /** * Generators of G(i) = Gβ1β2...βi-1 - * stabilizer of all base points from 0-th to (i-1)-th as described in Sec. 4.4.1 in [Holt05] */ final List stabilizerGenerators; /** * Schreier vector that encodes information about stabilizer of βi in G(i). */ final SchreierVector SchreierVector; /** * List of orbit points. */ final IntArrayList orbitList; /** * Maximum internal degrees of stabilizers */ int internalDegree; /** * Basic raw constructor. * * @param basePoint * @param stabilizerGenerators * @param schreierVector */ BSGSElement(int basePoint, List stabilizerGenerators, SchreierVector schreierVector, IntArrayList orbitList) { this.basePoint = basePoint; this.stabilizerGenerators = stabilizerGenerators; this.SchreierVector = schreierVector; this.orbitList = orbitList; this.internalDegree = Permutations.internalDegree(stabilizerGenerators); } /** * Returns a reference to the list of stabilizers. * * @return reference to the list of stabilizers */ public List getStabilizerGeneratorsReference() { return stabilizerGenerators; } /** * Calculates the transversal of specified point (uβ), i.e. the element * uβ such that βiuβ = β. * * @param point point * @return element that maps this base point to the specified point. * @see #getInverseTransversalOf(int) */ public Permutation getTransversalOf(int point) { Permutation transversal = getInverseTransversalOf(point).inverse(); assert transversal.newIndexOf(basePoint) == point; return transversal; } /** * Calculates the inverse transversal corresponding to the specified point (uβ), i.e. the element * uβ(-1) such that βiuβ = β. * * @param point point * @return inverse of the element that maps this base point to the specified point. */ public Permutation getInverseTransversalOf(int point) { if (SchreierVector.get(point) == -2) throw new IllegalArgumentException("Specified point does not belong to orbit of this base element."); Permutation temp = Permutations.createIdentityPermutation(SchreierVector.length()); while (SchreierVector.get(temp.newIndexOf(point)) != -1) temp = temp.compositionWithInverse( stabilizerGenerators.get(SchreierVector.get(temp.newIndexOf(point)))); return temp; } /** * Returns an immutable representation of this BSGS element * * @return immutable representation of this BSGS element */ public BSGSElement asBSGSElement() { return this; } /** * Returns true if specified point belongs to the orbit of this βi. * * @param point * @return true if specified point belongs to the orbit of this βi. */ public boolean belongsToOrbit(int point) { return SchreierVector.get(point) != -2; } /** * Returns a mutable copy of this BSGS element. * * @return a mutable copy of this BSGS element */ public BSGSCandidateElement asBSGSCandidateElement() { return new BSGSCandidateElement(basePoint, new ArrayList<>(stabilizerGenerators), SchreierVector.length()); } /** * Returns size of orbit. * * @return size of orbit */ public int orbitSize() { return orbitList.size(); } /** * Returns i-th point in orbit. * * @param i position in orbit * @return i-th point in orbit */ public int getOrbitPoint(int i) { return orbitList.get(i); } // /** // * Returns a degree of permutations. More specifically, it returns // * {@code stabilizerGenerators.get(0).length();} // * // * @return degree of permutations // */ // public int degree() { // return stabilizerGenerators.get(0).degree(); // } public int internalDegree() { return internalDegree; } @Override public String toString() { return new StringBuilder().append("[").append(basePoint).append(", ").append(stabilizerGenerators).append("]").toString(); } }

Ads help maintain this website.