|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.ObjectchordDiagrams.FourTGenerator
chordDiagrams.FourTProcessor
public class FourTProcessor
The class processes a list of 4T relations to leave out only independent ones in row-reduced echelon form. Mathematica is used to generate this form.
Field Summary | |
---|---|
java.util.TreeSet<Relation> |
indRelations
Data structire to hold the independent relations |
(package private) boolean[] |
isInBasis
isInBasis[i] is true if diagram referenced by keys.get(i) is in the basis Not initialized until evaluateRelations() is called |
(package private) int |
MAX
Maximum size of the matrix (rows*cols) that will be sent to Mathematica. |
com.wolfram.jlink.KernelLink |
ml
Kernel Link object to interface with Mathematica |
Fields inherited from class chordDiagrams.FourTGenerator |
---|
count, diag_gen, diags, k, keys, n, relations |
Constructor Summary | |
---|---|
FourTProcessor(int n,
int k,
int MAXnum,
UnframedDiagramGenerator gen)
Creates a new instance of the class |
Method Summary | |
---|---|
void |
closeKernelLink()
Finalizes Kernel Link Mathematica connection |
void |
DrawBasis(DiagramDrawer DDrawer)
Once the basis has been computed (after Mathematica computations were run), this method draws the diagrams in the basis and saves them into files. |
void |
DrawRelations(DiagramDrawer DDrawer)
Draws the set of 4T relations computed by this class with a DDRawer |
java.util.SortedSet<Relation> |
evaluateRelations()
Row-reduces the relation matrix using Mathematica (via J/Link API) and puts result into indRelation using the recursive processRelation() method |
void |
evaluateRelations(java.util.Iterator<Relation> iter,
java.util.Set<Relation> resultSet,
int num)
Row-reduces the relation matrix using Mathematica (via J/Link API) and puts result into resultSet |
int |
extractBasis()
Extracts the basis from the list of independent relations, once it has been computed. |
java.lang.String |
indRelationDataFname()
Generates a name of the file to save relations in. |
boolean |
initKernelLink()
Initialize Mathematica KernelLink |
boolean |
loadIndRelations()
Load the independent relation data from file. |
int |
nnz(java.util.Set<Relation> relSet)
Returns the number of non-zero entries in a relation set |
static void |
printMatrix(double[][] A)
Outputs matrix to console |
void |
printMatrix(int[][] A)
Outputs matrix to console |
void |
processMathematicaOutput(double[][] data,
java.util.Set<Relation> relations)
Takes a relation matrix (usually this is a result of Mathematica computation) and puts it into a relation set |
void |
processRelations(java.util.Iterator<Relation> iter,
java.util.Set<Relation> resultSet,
int num,
int MAX)
Sends a certain number of relations to Mathematica to row-reduce, no more than a MAX at a time, and puts the result into the resultSet |
void |
putRelationRulesToMathematica(java.util.Set<Relation> relSet)
Sends the relations matrix "rules" to Mathematica ("rules" for sparse array notation) The relations are obtained from the provided set. |
int |
putRelationsToMathematica(java.util.Iterator<Relation> iter,
int num)
Sends the relations to mathematica in the sparse array form The sparse array is asigned to variable "matrix". |
boolean |
saveIndRelations()
Saves the independent relations to the file The name of the file depends on n and k ans is returned by indRelationDataFname() function |
int |
setFromIterator(java.util.Iterator<Relation> iter,
java.util.Set<Relation> resultSet,
int n)
Takes and iterator and tries to take a specified number of Relations from the iterator. |
boolean |
TestMegaConjecture()
Tests the mega conjecture that all relations have size 2. |
Methods inherited from class chordDiagrams.FourTGenerator |
---|
account4Ts, charMatch, DrawRelations, generate4Ts, generateA, generateAll4Ts, generateAll4Ts, identify4Tdiagrams, isNew, JoinArrays, loadRelations, printArray, relationDataFname, reverseString, rotateStringArray, saveRelations |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
boolean[] isInBasis
public java.util.TreeSet<Relation> indRelations
public com.wolfram.jlink.KernelLink ml
int MAX
Constructor Detail |
---|
public FourTProcessor(int n, int k, int MAXnum, UnframedDiagramGenerator gen)
n
- number of chordsk
- number of linksMAXnum
- maximum size of the matrix that Mathematica will handle
gen
- Diagram generator to useMethod Detail |
---|
public void processRelations(java.util.Iterator<Relation> iter, java.util.Set<Relation> resultSet, int num, int MAX)
iter
- Iterator to get the relations fromnum
- number of relations to sendresultSet
- the set to put resuling (independent)relations intoMAX
- maximum number of relations to send at a timepublic java.util.SortedSet<Relation> evaluateRelations()
public void evaluateRelations(java.util.Iterator<Relation> iter, java.util.Set<Relation> resultSet, int num)
iter
- Iterator to get the relations fromnum
- number of relations to sendresultSet
- the set to put resuling (independent)relations intopublic boolean initKernelLink()
public void closeKernelLink()
public void printMatrix(int[][] A)
A
- matrix to printpublic static void printMatrix(double[][] A)
A
- matrix to printpublic int putRelationsToMathematica(java.util.Iterator<Relation> iter, int num) throws com.wolfram.jlink.MathLinkException
iter
- Iterator to get the relations fromnum
- Number of relations to get from the Iterator
com.wolfram.jlink.MathLinkException
- and exception is thrown when Mathematica criespublic void putRelationRulesToMathematica(java.util.Set<Relation> relSet) throws com.wolfram.jlink.MathLinkException
relSet
- the set to take relations from
com.wolfram.jlink.MathLinkException
public int setFromIterator(java.util.Iterator<Relation> iter, java.util.Set<Relation> resultSet, int n)
iter
- the Iterator to take the Relations fromn
- number of elements to take (mwthod will stop once the Iterator is depleted, if this occurs sooner)resultSet
- the set to put the relations into
public int nnz(java.util.Set<Relation> relSet)
relSet
- the set with relations
public void processMathematicaOutput(double[][] data, java.util.Set<Relation> relations)
data
- relation matrixrelations
- data structure (Set) to store relations inpublic int extractBasis()
public void DrawBasis(DiagramDrawer DDrawer)
DDrawer
- diagram drawer to draw basis withpublic void DrawRelations(DiagramDrawer DDrawer)
DrawRelations
in class FourTGenerator
DDrawer
- DiagramDrawer to draw the relations withpublic boolean saveIndRelations()
public boolean loadIndRelations()
public java.lang.String indRelationDataFname()
public boolean TestMegaConjecture()
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |