graph
Class Formatter
java.lang.Object
|
+--graph.Formatter
- public class Formatter
- extends java.lang.Object
This class handles conversions of graphs to various formats.
Graph -> archiveString <-> Formatter -> MathematicaString.
There is also a constructor Graph(Formatter f);
The internal arrays store graph incidence data for a planar.
The tempList is a list of face numbers of the faces that are temporary.
This code for this class was adapted from java98.GraphArrays.
Constructor Summary |
Formatter(java.lang.String S)
Constructor |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
testString
public static final java.lang.String testString
Formatter
public Formatter(java.lang.String S)
- Constructor
- Parameters:
S
- archive format string representing a graph.
adjacentSize
public int adjacentSize(int i)
adjacent
public int adjacent(int i,
int index)
isFinal
public boolean isFinal(int faceIndex)
tempCount
public int tempCount()
faceCount
public int faceCount()
faceCount
public int faceCount(int vertexIndex)
vertexCount
public int vertexCount()
vertexCount
public int vertexCount(int faceIndex)
toArchiveString
public java.lang.String toArchiveString()
- Conversion from Formatter to archive string format.
toArchiveString
public static java.lang.String toArchiveString(Graph G)
- Convert a graph into archive string format.
- Parameters:
G
- graph to be converted.
To convert back, use two steps:
toGraph(new Formatter(archiveString));
toMathematicaString
public java.lang.String toMathematicaString()
- Mathematica string format is a format that graphs were stored in by
the linear program generator, in the "Kepler98" package.
// format {0,0,{p1,...,pr}}; pi = {{p,q,r},{adjacent}};
p = number of triangles at the vertex,
q = number of quads at the vertex,
r = number of exceptional regions at the vertex.
adjacent_i is a list of vertices, in counterclockwise order around vertex_i
These vertices are represented as integers 1,.. in the linear order given by vertexAtFace indices
There is an index shift by 1 so that the minimum vertex index is 1.
precondition: tempList.length==0 (tempList data is discarded in this format).
This format is no longer in use, and it should be deprecated.
printGraph
public void printGraph()
- This method is really for test purposes only. It prints data about this object.
main
public static void main(java.lang.String[] args)