repthy
Class Homomorphism

Object
  extended byAbstractMap
      extended byHomomorphism
All Implemented Interfaces:
Map
Direct Known Subclasses:
HashHomom, HomomFromFunc

public abstract class Homomorphism
extends AbstractMap

A Homomorphism is a Map from one Group to another satisfying the axioms for a homomorphism of groups.

An isomorphism is just a Homomorphism for which isIsomorphism() returns true.

This class is immutable--elements can't be added or removed once the object is instantiated. The class implements the Map interface, but any attempt to modify it will throw a java.lang.UnsupportedOperationException.

A subclass of Homomorphism only needs to implement the following methods.

For efficiency, it should probably override AbstractMap.get(Object), whose default implementation takes time linear in source.getOrder().

Author:
Mark McConnell

Nested Class Summary
 
Nested classes inherited from class Map
Map.Entry
 
Constructor Summary
Homomorphism()
           
 
Method Summary
 GroupElt apply(GroupElt g)
          Returns the value of this homomorphism on the element g of the source.
 void clear()
          Unsupported, because Homomorphisms are immutable.
 boolean containsKey(Object o)
           
 int getImageOrder()
           
 int getKernelOrder()
           
 Group getSource()
          Returns the source (domain).
 Group getTarget()
          Returns the target.
static Homomorphism identity(Group G, Group G1)
          If G and G1 have the same elements (that is, if G.equals(G1)), this method returns the natural identity map from G to G1.
 Homomorphism inverse()
          If this homomorphism is an isomorphism, return the inverse homomorphism.
 HashSet inverseImage(Collection c)
          Returns the set of all elements of the source whose images lie in c.
 boolean isInjective()
           
 boolean isIsomorphism()
           
 boolean isSurjective()
           
 Set keySet()
           
 GpCharacter pullBack(GpCharacter chiT)
          Returns the pullback of the character chiT on the target.
 Object put(Object key, Object value)
          Unsupported, because Homomorphisms are immutable.
 void putAll(Map map)
          Unsupported, because Homomorphisms are immutable.
 Object remove(Object o)
          Unsupported, because Homomorphisms are immutable.
 
Methods inherited from class AbstractMap
clone, containsValue, entrySet, equals, get, hashCode, isEmpty, size, toString, values
 
Methods inherited from class Object
finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

Homomorphism

public Homomorphism()
Method Detail

containsKey

public final boolean containsKey(Object o)

keySet

public final Set keySet()

clear

public final void clear()
Unsupported, because Homomorphisms are immutable.

Throws:
UnsupportedOperationException - Always.

put

public final Object put(Object key,
                        Object value)
Unsupported, because Homomorphisms are immutable.

Throws:
UnsupportedOperationException - Always.

putAll

public final void putAll(Map map)
Unsupported, because Homomorphisms are immutable.

Throws:
UnsupportedOperationException - Always.

remove

public final Object remove(Object o)
Unsupported, because Homomorphisms are immutable.

Throws:
UnsupportedOperationException - Always.

getSource

public final Group getSource()
Returns the source (domain).


getTarget

public final Group getTarget()
Returns the target.


apply

public GroupElt apply(GroupElt g)
Returns the value of this homomorphism on the element g of the source. Returns null if g is not actually in the source. Same as AbstractMap.get(java.lang.Object).


inverseImage

public HashSet inverseImage(Collection c)
Returns the set of all elements of the source whose images lie in c. The running time is O(|source|) times the average running time of c's Collection.contains(java.lang.Object) method.


identity

public static Homomorphism identity(Group G,
                                    Group G1)
If G and G1 have the same elements (that is, if G.equals(G1)), this method returns the natural identity map from G to G1. If not, returns null.


getKernelOrder

public int getKernelOrder()

isInjective

public boolean isInjective()

getImageOrder

public int getImageOrder()

isSurjective

public boolean isSurjective()

isIsomorphism

public boolean isIsomorphism()

inverse

public Homomorphism inverse()
If this homomorphism is an isomorphism, return the inverse homomorphism. This impelmentation always returns a HashHomom.

Throws:
IllegalArgumentException - If this homomorphism is not an isomorphism.

pullBack

public GpCharacter pullBack(GpCharacter chiT)
Returns the pullback of the character chiT on the target. This is a character on the source.

Throws:
IllegalArgumentException - If chiT is not defined on the target.