Package pointgon
Class Path
java.lang.Object
pointgon.Splitter
pointgon.Path
- All Implemented Interfaces:
Serializable
Class for splitting a (sub-)pointgon with a path.
- Since:
- 2006.01.27 (Christian Borgelt)
- See Also:
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected int
length of the best pathprotected static final Vertex[]
fixed dummy path to represent any path cutting off an anchorprotected Vertex
first vertex on counterclockwise walkprotected int[]
indices of holes on current pathprotected Vertex
last vertex on counterclockwise walkprotected int
full size of left subproblemprotected int
position in holes for left pathsprotected Vertex[]
vertices of current pathprotected int
direction of current pathprotected int
length of current pathprotected int
full size of right subproblemprotected int
position in holes for right paths -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected void
Distribute the hole vertices.protected Edge[]
edges()
Get the edges of the current path.protected void
Get hole positions for a path.protected void
Initialize a path splitter.protected void
Initialize the path splitter.protected boolean
Check whether path leads inside.protected boolean
next()
Create the next subproblem split.protected Vertex
nextEnd()
Get the next path end vertex.protected boolean
nextHoles
(boolean valid) Get the next holes sequence.protected Object
retrieve()
Retrieve the best path.protected int
Get the full size of a subproblem.protected void
split()
Split a subproblem with the current path.protected void
store()
Store the current path as best.protected Vertex[]
triangle()
Get the current triangle.protected boolean
Check the path cutting off the anchor.protected double
weight()
Compute the weight of the current split.
-
Field Details
-
cut
fixed dummy path to represent any path cutting off an anchor -
frst
first vertex on counterclockwise walk -
last
last vertex on counterclockwise walk -
idxs
protected int[] idxsindices of holes on current path -
path
vertices of current path -
plen
protected int plenlength of current path -
pdir
protected int pdirdirection of current path -
lftpos
protected int lftposposition in holes for left paths -
rgtpos
protected int rgtposposition in holes for right paths -
rgtall
protected int rgtallfull size of right subproblem -
lftall
protected int lftallfull size of left subproblem -
bestlen
protected int bestlenlength of the best path
-
-
Constructor Details
-
Path
Create a path splitter.- Parameters:
mwt
- the minimum weight triangulation object- Since:
- 2006.01.27 (Christian Borgelt)
-
-
Method Details
-
getpos
Get hole positions for a path.- Parameters:
p
- start vertex of the pathq
- end vertex of the path- Since:
- 2006.01.27 (Christian Borgelt)
-
nextEnd
Get the next path end vertex.- Returns:
- the next path end vertex.
- Since:
- 2006.01.27 (Christian Borgelt)
-
nextHoles
protected boolean nextHoles(boolean valid) Get the next holes sequence.- Parameters:
valid
- whether preceding sequence was valid- Returns:
- whether there is a next hole sequence
- Since:
- 2006.01.27 (Christian Borgelt)
-
validcut
Check the path cutting off the anchor.- Parameters:
p
- the first vertex of the pathq
- the last vertex of the path- Returns:
- whether the cut is valid
- Since:
- 2006.01.27 (Christian Borgelt)
-
inside
Check whether path leads inside.- Parameters:
p
- the first vertex of the pathq
- the last vertex of the path- Returns:
- whether the path leads inside
- Since:
- 2006.01.27 (Christian Borgelt)
-
size
Get the full size of a subproblem.- Parameters:
key
- the key of the subproblemcnt
- the size of the subproblem- Returns:
- the full size of a subproblem
- Since:
- 2006.01.27 (Christian Borgelt)
-
init
Initialize the path splitter. -
init
Initialize a path splitter. -
next
protected boolean next()Create the next subproblem split. -
split
protected void split()Split a subproblem with the current path. -
triangle
Get the current triangle. -
weight
protected double weight()Compute the weight of the current split. -
edges
Get the edges of the current path. -
store
protected void store()Store the current path as best. -
retrieve
Retrieve the best path. -
distribute
protected void distribute()Distribute the hole vertices.- Specified by:
distribute
in classSplitter
- Since:
- 2006.01.27 (Christian Borgelt)
-