chordDiagrams
Class OrbitObserver

java.lang.Object
  extended by chordDiagrams.OrbitObserver

public class OrbitObserver
extends java.lang.Object

This class looks for orbits of diagrams in the basis under link permutation

Author:
Romwell

Field Summary
 java.util.HashSet<java.lang.String> basis
          Stores diagID's for the basis
(package private)  java.util.HashMap<java.lang.String,diagram> diags
          Data structure to store diagrams
 java.util.TreeSet<Relation> indRelations
          Data structure to store independent relations
(package private)  int k
          Number of links
(package private)  java.util.ArrayList<java.lang.String> keys
          Key set for diagrams
(package private)  int[] linkpermutation
          Current permutation of links
(package private)  boolean[] linkplaced
          Used for recursive calls in link permutation generation; i'th entry is true if i'th link is used in the permutation.
(package private)  int n
          Number of chords
 java.util.HashMap<java.lang.Integer,java.lang.String> orbitlabels
          Store the labels of orbit elements
 java.util.ArrayList<Orbit> orbits
          Stores orbits of the diagrams
 java.util.HashSet<java.lang.String> reducedBasis
          Stores diagID's for the reduced basis
 
Constructor Summary
OrbitObserver(int n, int k, int MAXNum, UnframedDiagramGenerator gen)
          Constructs a new instance of Orbit Observer
 
Method Summary
 java.lang.String diagIDfromCurPermutation(java.lang.String[] dlinks)
          Takes the current link permutation and returns the diagram ID
 java.lang.String[] diagLinks(java.lang.String diagID)
          Returns the links of the diagram as an array
 void drawOrbits(DiagramDrawer D)
          Draws the orbits with the specified DDrawer filenames are of the form orbit_n-k_(i)_j.PNG
 void generateAllOrbits()
          Generates orbits for all diagrams in the basis
 void generateBasis(boolean[] isInBasis)
          Fills the basis HashSet with basis diagrams
 void generateOrbit(int pos, java.lang.String[] diagLinks, Orbit O)
          Generates the orbit of a diagram under the permutation of links
 void generateOrbit(java.lang.String diagID)
          Generates an orbit for a diagram and places it in the list
private  void generateOrbitBaisLabels()
          Generates the labels for orbit elements that are in the basis for subsequent LaTeX printount
 void generateOrbitLabels()
          Generates labels for elements of all orbits
private  void generateOrbitRelationLabels()
          Generates labels for orbit elements that are relations; labels for basis elements must be generated prior to calling this method
static java.lang.String indexToLetters(int i)
          Generates string orbit label from index 0->a, 1->b,...,26->aa,27->ab,...
 int maxOrbitShortLength()
          Calculates the maximum "short" length of an orbit (i.e., length moudulo 4T relation, elements expressed by a relation of the form a=b aren't considered)
 void printOrbitLabels()
          Prints orbits labeled
 void printOrbits()
          Prints all orbits to command line (primary usage: debugging)
 void printOrbitsEx()
          Same as printOrbits, but with diagID's instead of indices
 void printOrbitsShort()
          Same as printOrbits, shorter
 void putCurrentOrbitElement(java.lang.String dID, Orbit O)
          Puts the current orbit element into the orbit.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

n

int n
Number of chords


k

int k
Number of links


diags

java.util.HashMap<java.lang.String,diagram> diags
Data structure to store diagrams


keys

java.util.ArrayList<java.lang.String> keys
Key set for diagrams


indRelations

public java.util.TreeSet<Relation> indRelations
Data structure to store independent relations


basis

public java.util.HashSet<java.lang.String> basis
Stores diagID's for the basis


reducedBasis

public java.util.HashSet<java.lang.String> reducedBasis
Stores diagID's for the reduced basis


orbits

public java.util.ArrayList<Orbit> orbits
Stores orbits of the diagrams


linkplaced

boolean[] linkplaced
Used for recursive calls in link permutation generation; i'th entry is true if i'th link is used in the permutation.


linkpermutation

int[] linkpermutation
Current permutation of links


orbitlabels

public java.util.HashMap<java.lang.Integer,java.lang.String> orbitlabels
Store the labels of orbit elements

Constructor Detail

OrbitObserver

public OrbitObserver(int n,
                     int k,
                     int MAXNum,
                     UnframedDiagramGenerator gen)
Constructs a new instance of Orbit Observer

Parameters:
n -
k -
MAXNum -
gen - diagram generator to use
Method Detail

generateOrbit

public void generateOrbit(java.lang.String diagID)
Generates an orbit for a diagram and places it in the list

Parameters:
diagID -

diagLinks

public java.lang.String[] diagLinks(java.lang.String diagID)
Returns the links of the diagram as an array

Parameters:
diagID - diagram ID
Returns:
array containing the links as strings of colors

generateOrbit

public void generateOrbit(int pos,
                          java.lang.String[] diagLinks,
                          Orbit O)
Generates the orbit of a diagram under the permutation of links

Parameters:
pos - current position in the permutation
diagLinks - diagram links as strings of colors
O - orbit to store the orbit elements (link permutations) in

putCurrentOrbitElement

public void putCurrentOrbitElement(java.lang.String dID,
                                   Orbit O)
Puts the current orbit element into the orbit.

Parameters:
dID - diagram ID to put into the orbit
O - the orbit to put the element in

diagIDfromCurPermutation

public java.lang.String diagIDfromCurPermutation(java.lang.String[] dlinks)
Takes the current link permutation and returns the diagram ID

Parameters:
dlinks -
Returns:
index of the diagram in keyset

generateAllOrbits

public void generateAllOrbits()
Generates orbits for all diagrams in the basis


printOrbits

public void printOrbits()
Prints all orbits to command line (primary usage: debugging)


printOrbitsEx

public void printOrbitsEx()
Same as printOrbits, but with diagID's instead of indices


printOrbitsShort

public void printOrbitsShort()
Same as printOrbits, shorter


generateBasis

public void generateBasis(boolean[] isInBasis)
Fills the basis HashSet with basis diagrams

Parameters:
isInBasis - array that tells which elements are in the bais (a[i]=true if i is in the basis)

drawOrbits

public void drawOrbits(DiagramDrawer D)
Draws the orbits with the specified DDrawer filenames are of the form orbit_n-k_(i)_j.PNG

Parameters:
D - DDrawer to draw with

generateOrbitBaisLabels

private void generateOrbitBaisLabels()
Generates the labels for orbit elements that are in the basis for subsequent LaTeX printount


generateOrbitRelationLabels

private void generateOrbitRelationLabels()
Generates labels for orbit elements that are relations; labels for basis elements must be generated prior to calling this method


generateOrbitLabels

public void generateOrbitLabels()
Generates labels for elements of all orbits


printOrbitLabels

public void printOrbitLabels()
Prints orbits labeled


maxOrbitShortLength

public int maxOrbitShortLength()
Calculates the maximum "short" length of an orbit (i.e., length moudulo 4T relation, elements expressed by a relation of the form a=b aren't considered)

Returns:
the biggest "short" length of an orbit

indexToLetters

public static java.lang.String indexToLetters(int i)
Generates string orbit label from index 0->a, 1->b,...,26->aa,27->ab,...

Parameters:
i - index of the orbit
Returns:
String representation of the index