|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.ObjectchordDiagrams.ConfigutaionHolder
chordDiagrams.UnframedDiagramGenerator
public class UnframedDiagramGenerator
Generates all distinct chord diagrams for unframed singular knots. Automatically saves the results to file, and loads the file instead of recomputing (if the file is found).
Field Summary | |
---|---|
(package private) int[] |
conf
Array to store current configuration 0 -> not occupied >0 -> skip number -1 -> occupied |
(package private) int |
count
Stores configuration count; |
(package private) int |
k
Number of links |
(package private) int |
n
Number of chords |
Fields inherited from class chordDiagrams.ConfigutaionHolder |
---|
configs |
Constructor Summary | |
---|---|
UnframedDiagramGenerator(int n,
int k)
Creates an instance of the class that generates all diagrams with n chords and k links for the unframed case |
Method Summary | |
---|---|
void |
backtrack(int[] arr,
int p,
int[] links,
int[] linkcolors)
Goes through all skip confugrations to create the list of all diagrams |
java.util.HashMap<java.lang.String,diagram> |
GenerateDiagrams()
Generates all the diagrams with n chords and k links the diagrams have no kinks entries containing (xx in coloring format, 1-1 in skip format) If the diagram list has already been generated (i.e., if the file with the list exists), the data from the list will be used instead. |
java.lang.String |
getFileName()
Filename that the diagrams will be stored to/loaded from : "unframed_n-k.zdata" |
void |
init()
Initializes fields |
boolean |
isConnected(diagram d)
This is the diagram connectivity test used in generating the list of diagrams. |
boolean |
isLegitSkip_v2(int cur,
int skip,
int[] links,
int[] linkcolors)
Criteria used to enumerate connectors between 2 (or more?) circles |
boolean |
isLegitSkip(int cur,
int skip,
int[] links,
int[] linkcolors)
Tells whether a certain skip is allowed. |
int |
linkSize(int[] links,
int t)
returns the size of a link |
void |
OutDiag(int[] a)
Outputs diagram configuration (used to print diagrams in skip format) (prints every entry in the array that's great than -1) |
void |
ProduceLinkConfigs(int[] links,
int n,
int t)
Generates all diagrams by generating all link configs for n chords, and then generating all colorings by calling the corresponding function. |
Methods inherited from class chordDiagrams.ConfigutaionHolder |
---|
isNew, loadConfigs, loadObject, saveConfigs, saveObject |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
int n
int k
int[] conf
int count
Constructor Detail |
---|
public UnframedDiagramGenerator(int n, int k)
Method Detail |
---|
public void OutDiag(int[] a)
a
- the diagram in skip formatpublic int linkSize(int[] links, int t)
links
- link configurationt
- link number
public boolean isLegitSkip(int cur, int skip, int[] links, int[] linkcolors)
cur
- starting poisitionskip
- skip numberlinks
- link config in regular formatlinkcolors
- link config in coloring format
public boolean isLegitSkip_v2(int cur, int skip, int[] links, int[] linkcolors)
cur
- starting poisitionskip
- skip numberlinks
- link config in regular formatlinkcolors
- link config in coloring format
public void backtrack(int[] arr, int p, int[] links, int[] linkcolors)
arr
- array to store the configurationp
- candidate positionlinks
- stores the link structure by storing ring delimiter indiceslinkcolors
- same as links, but stores link colors in an arraypublic boolean isConnected(diagram d)
d
- diagram whose connectivity is to be checked
public void ProduceLinkConfigs(int[] links, int n, int t)
links
- the array to store the confign
- number of chordst
- current linkpublic java.util.HashMap<java.lang.String,diagram> GenerateDiagrams()
public void init()
public java.lang.String getFileName()
getFileName
in class ConfigutaionHolder
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |