repthy
Class HashGroup

Object
  extended byAbstractCollection
      extended byAbstractSet
          extended byImmutableSet
              extended byGroup
                  extended byHashGroup
All Implemented Interfaces:
Collection, Set
Direct Known Subclasses:
AbelianGroup, GL, PermGp, PGL, PGroup, ProductGroup, PSL, QuotientGroup, SL

public class HashGroup
extends Group

An implementation of Group backed by a HashSet that holds one copy of each element of the group.

Author:
Mark McConnell

Field Summary
 
Fields inherited from class Group
charTable
 
Constructor Summary
HashGroup(GroupElt[] generators)
          Constructs the group with the given generators.
HashGroup(Set set)
          set is a Set holding GroupElts.
 
Method Summary
 boolean contains(Object g)
           
 Set getConjClass(int i)
          Returns the i-th conjugacy class as an unmodifiable Set.
 int getConjClassIndex(GroupElt g)
          Returns i such that g is in the i-th conjugacy class.
 int getConjClassNum()
          Returns the number of conjugacy classes.
 Iterator iterator()
          Returns an iterator over the elements of the group.
 int size()
           
 
Methods inherited from class Group
cyclicSubgpsUpToConj, describeOrder8, elementarySubgps, fillInCharTable, getCenter, getCentralizer, getCharComparator, getCharTable, getCommutatorSubgroup, getCompositionSeries, getConjClassRep, getEltOrder, getEltOrder, getIdentity, getOrder, getProperNormalSubgroup, getSylow, isAbelian, isCentral, isSimple, isSubgroupOf, order, power, printTest, tableTest
 
Methods inherited from class ImmutableSet
add, addAll, clear, remove, removeAll, retainAll
 
Methods inherited from class AbstractSet
equals, hashCode
 
Methods inherited from class AbstractCollection
containsAll, isEmpty, toArray, toArray, toString
 
Methods inherited from class Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface Set
containsAll, isEmpty, toArray, toArray
 

Constructor Detail

HashGroup

public HashGroup(Set set)
set is a Set holding GroupElts. It must be non-empty, and the elements must satisfy the group axioms. There is no error-checking, but expect trouble if these conditions are not met. set is copied, so that changes to it later will not affect what's inside this group.


HashGroup

public HashGroup(GroupElt[] generators)
Constructs the group with the given generators. The algorithm walks naively through the Cayley graph on the generators, hence has running time depending on the number of edges in the Cayley graph times its diameter. The group is backed by a HashSet holding one copy of every element.

Throws:
IllegalArgumentException - If generators does not have at least one element.
Method Detail

contains

public boolean contains(Object g)

iterator

public Iterator iterator()
Returns an iterator over the elements of the group. The elements appear in an unspecified order.

Throws:
UnsupportedOperationException - if you call remove() on this iterator.

size

public int size()

getConjClassNum

public int getConjClassNum()
Description copied from class: Group
Returns the number of conjugacy classes.

Specified by:
getConjClassNum in class Group

getConjClass

public Set getConjClass(int i)
Returns the i-th conjugacy class as an unmodifiable Set. The inverse operation is getConjClassIndex(repthy.GroupElt). If an element of the class implements Comparable, then the corresponding Set will be a SortedSet.

Specified by:
getConjClass in class Group
Throws:
ArrayIndexOutOfBoundsException - unless 0 ≤ i < getConjClassNum().

getConjClassIndex

public int getConjClassIndex(GroupElt g)
Returns i such that g is in the i-th conjugacy class. The inverse operation is getConjClass(int).

Specified by:
getConjClassIndex in class Group
Throws:
NullPointerException - if g is not in the group.