|
|||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--graph.Graph
A Graph object represents a planar graph (or better, map). The data structures stores a list of vertices and faces. The vertices know about the faces around them, and vice versa. The edge structure is determined by the relationship of vertices and faces.
Rather than loading this class with tons of structural information, we implement things roughly on a Model-Controller-Viewer design pattern. The Graph Class is the Model for the data, and constructors contain the controller code. The various viewers take different structural views of this class (View scores, view structures, format conversions, etc). All controller code lies in the constructors, because the Graph Class is immutable.
The purpose of this code is to prove part of the Kepler conjecture. Specifically: 1. Give a fresh implementation of the graph package at www.math.lsa.umich.edu/~hales/countdown/graph. 2. Give a useful data structure for use in the linear programming part of the Kepler conjecture
Inner Class Summary | |
static class |
Graph.Test
Test Class contains test code. |
Method Summary | |
Graph |
add(Face[] F,
Vertex[] newFaceVertexList)
Graph with one new polygon added along an edge. |
boolean |
contains(Face F)
|
boolean |
contains(Vertex V)
|
Graph |
copy(boolean reverse,
Vertex[] vList,
Face[] fList)
deepClone or deepMirrorImage of the graph. |
java.util.Enumeration |
faceEnumeration()
Enumerates all Face objects. |
int |
faceSize()
The number of faces in the graph |
Vertex |
getBaseVertex()
|
static Graph |
getInstance(Formatter f)
Construct a graph from a formatter object. |
static Graph |
getInstance(int size)
Construct a polygon graph. |
static Graph |
getInstance(int[] seedData)
Construct graph from seedData giving a graph around one vertex. |
protected void |
setBaseVertex(Vertex V)
|
java.util.Enumeration |
vertexEnumeration()
Enumerates all Vertex objects. |
int |
vertexSize()
The number of vertices in the graph. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Method Detail |
public boolean contains(Vertex V)
public boolean contains(Face F)
public Vertex getBaseVertex()
protected void setBaseVertex(Vertex V)
public int vertexSize()
public int faceSize()
public java.util.Enumeration vertexEnumeration()
public java.util.Enumeration faceEnumeration()
public static Graph getInstance(int size)
size
- the number of vertices in the polygon.public static Graph getInstance(Formatter f)
public Graph copy(boolean reverse, Vertex[] vList, Face[] fList)
G
- graph to clonevList
- any array of Vertices on G,fList
- any array of Faces on G.reverse
- if true, a mirror image of G is constructed.public Graph add(Face[] F, Vertex[] newFaceVertexList)
F
- list of length 1 containing the Face to be modified.newFaceVertexList,
- all vertices cyclically arranged (clockwise), nulls for new Vertices.public static Graph getInstance(int[] seedData)
seedData
- a clockwise array of integers specifying sizes of consecutive faces.
|
|||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |