chordDiagrams
Class Orbit

java.lang.Object
  extended by chordDiagrams.Orbit

public class Orbit
extends java.lang.Object


Field Summary
private  java.util.HashSet<java.lang.String> basis
          Stores basis
 java.lang.String diagID
          Diagram ID of the Diagram whose orbit is considered
 int diagIndex
          Index of the diagram whose orbit is considered (index in the list of diagID's sorted lexicographically)
private  java.util.TreeSet<Relation> indRelations
          Independent relations
private  java.util.ArrayList<java.lang.String> keyset
          Keyset for the diagrams
 java.util.HashMap<java.lang.Integer,OrbitElement> orbit
          Stores the actual orbit
 int shortLength
          Stores the length of the orbit modulo 4T, i.e.
 
Constructor Summary
Orbit(java.lang.String diagID, java.util.HashSet<java.lang.String> basis, java.util.TreeSet<Relation> indRelations, java.util.ArrayList<java.lang.String> keyset)
          Creates an instance of the class to store the orbit of a diagram under some action
 
Method Summary
 void addDiagram(java.lang.String diagID)
          Adds a diagram into the orbit
 void drawOrbit(DiagramDrawer D, java.util.HashMap<java.lang.String,diagram> diags, java.lang.String fname)
          Draws the orbit with the specified Diagram Drawer Elements of the orbit are saved to the filenames of the form fname_i.PNG
 int getIndex(java.lang.String diagID)
          Gets the index of a diagram in the keyset
 boolean isEmpty()
          Tells whether there were no elements put into the orbit
 boolean isInteresting(java.lang.Integer I)
          Tells whether an orbit element is interesting
 int length()
          Returns the number of elements in this orbit
 Relation lookupRelation(int dIndex)
          If the diagram is not in the basis, then it is a pivot in the matrix of independent relations.
 java.lang.String toString()
           
 java.lang.String toStringExtended()
          Instead of diagram indices, diagram ID's are printed
 java.lang.String toStringShort()
          Same as toString, shorter form
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

diagIndex

public int diagIndex
Index of the diagram whose orbit is considered (index in the list of diagID's sorted lexicographically)


diagID

public java.lang.String diagID
Diagram ID of the Diagram whose orbit is considered


orbit

public java.util.HashMap<java.lang.Integer,OrbitElement> orbit
Stores the actual orbit


shortLength

public int shortLength
Stores the length of the orbit modulo 4T, i.e. #of elements that are not expressed by a relation of the form a=b


basis

private java.util.HashSet<java.lang.String> basis
Stores basis


indRelations

private java.util.TreeSet<Relation> indRelations
Independent relations


keyset

private java.util.ArrayList<java.lang.String> keyset
Keyset for the diagrams

Constructor Detail

Orbit

public Orbit(java.lang.String diagID,
             java.util.HashSet<java.lang.String> basis,
             java.util.TreeSet<Relation> indRelations,
             java.util.ArrayList<java.lang.String> keyset)
Creates an instance of the class to store the orbit of a diagram under some action

Parameters:
diagID - String ID of the diagram
basis - basis
indRelations - independent relations
keyset - sorted diagram ID's (so that we could deal with indices instead of strings)
Method Detail

getIndex

public int getIndex(java.lang.String diagID)
Gets the index of a diagram in the keyset

Parameters:
diagID - ID of the diagram to look for
Returns:
the index of the diagram in the sorted collection of diagram IDs

addDiagram

public void addDiagram(java.lang.String diagID)
Adds a diagram into the orbit


lookupRelation

public Relation lookupRelation(int dIndex)
If the diagram is not in the basis, then it is a pivot in the matrix of independent relations. The method looks up the relation with this diagram.

Parameters:
dIndex - index of the diagram
Returns:
Relation with this diagram

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object

toStringExtended

public java.lang.String toStringExtended()
Instead of diagram indices, diagram ID's are printed

Returns:

toStringShort

public java.lang.String toStringShort()
Same as toString, shorter form

Returns:

isEmpty

public boolean isEmpty()
Tells whether there were no elements put into the orbit

Returns:
true if no elements were put here

length

public int length()
Returns the number of elements in this orbit


drawOrbit

public void drawOrbit(DiagramDrawer D,
                      java.util.HashMap<java.lang.String,diagram> diags,
                      java.lang.String fname)
Draws the orbit with the specified Diagram Drawer Elements of the orbit are saved to the filenames of the form fname_i.PNG

Parameters:
D - DDrawer to draw with
diags -
fname - filename base

isInteresting

public boolean isInteresting(java.lang.Integer I)
Tells whether an orbit element is interesting

Parameters:
I - key of the orbit element
Returns:
true if an orbit element is in the basis or a nontrivial linear combination of basis elements