Package pointgon

Class Splitter

java.lang.Object
pointgon.Splitter
All Implemented Interfaces:
Serializable
Direct Known Subclasses:
Path, Triangle

public abstract class Splitter extends Object implements Serializable
Class for splitting a (sub-)pointgon into (sub-)pointgons.
Since:
2006.01.27 (Christian Borgelt)
See Also:
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    protected Object
    best split of the subproblem
    protected int
    size of subproblem
    protected int
    order of perimeter vertices
    protected boolean
    whether to distribute holes
    protected int
    number of holes in subproblem
    protected Vertex[]
    holes in subproblem
    protected Vertex[]
    key of subproblem
    protected int
    size of left subproblem
    protected int
    number of holes in left subproblem
    protected Vertex[]
    holes in left subproblem
    protected Vertex[]
    key of left subproblem
    protected int
    size of right subproblem
    protected int
    number of holes in right subproblem
    protected Vertex[]
    holes in right subproblem
    protected Vertex[]
    key of right subproblem
    protected int
    state of the splitter
    protected Vertex[]
    triangle cut out of the subproblem
    protected char[][][]
    flag table for valid triangles
    protected Vertex[]
    all (input) perimeter vertices
    protected double[][]
    table of edge weights/validity
  • Constructor Summary

    Constructors
    Constructor
    Description
    Create a subproblem splitter.
  • Method Summary

    Modifier and Type
    Method
    Description
    protected abstract void
    Distribute the hole vertices.
    protected abstract Edge[]
    Get the edges of the current path.
    protected double
    Check for an empty triangle.
    protected abstract void
    init(Vertex[] key, int cnt, Object spobj)
    Initialize a subproblem splitter.
    protected abstract void
    init(Vertex[] key, int cnt, Vertex[] holes, int holecnt)
    Initialize a subproblem splitter.
    protected boolean
    isects(Vertex src, Vertex dst)
    Check intersection with key.
    protected abstract boolean
    Create next subproblem split.
    protected abstract Object
    Retrieve the best path.
    protected void
    Show the subproblem to process.
    protected void
    show(int depth)
    Show the subproblem to process.
    protected abstract void
    Split a subproblem with the current split.
    protected abstract void
    Store the current path as best.
    protected abstract Vertex[]
    Get the current triangle.
    protected boolean
    Check a triangle.
    protected abstract double
    Compute the weight of the current split.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Field Details

    • verts

      protected Vertex[] verts
      all (input) perimeter vertices
    • dir

      protected int dir
      order of perimeter vertices
    • wgts

      protected double[][] wgts
      table of edge weights/validity
    • trtab

      protected char[][][] trtab
      flag table for valid triangles
    • dist

      protected boolean dist
      whether to distribute holes
    • key

      protected Vertex[] key
      key of subproblem
    • rgtkey

      protected Vertex[] rgtkey
      key of right subproblem
    • lftkey

      protected Vertex[] lftkey
      key of left subproblem
    • cnt

      protected int cnt
      size of subproblem
    • rgtcnt

      protected int rgtcnt
      size of right subproblem
    • lftcnt

      protected int lftcnt
      size of left subproblem
    • holes

      protected Vertex[] holes
      holes in subproblem
    • rgtholes

      protected Vertex[] rgtholes
      holes in right subproblem
    • lftholes

      protected Vertex[] lftholes
      holes in left subproblem
    • holecnt

      protected int holecnt
      number of holes in subproblem
    • rgtholecnt

      protected int rgtholecnt
      number of holes in right subproblem
    • lftholecnt

      protected int lftholecnt
      number of holes in left subproblem
    • triangle

      protected Vertex[] triangle
      triangle cut out of the subproblem
    • state

      protected int state
      state of the splitter
    • best

      protected transient Object best
      best split of the subproblem
  • Constructor Details

    • Splitter

      public Splitter()
      Create a subproblem splitter.
      Since:
      2006.01.27 (Christian Borgelt)
  • Method Details

    • valid

      protected boolean valid(Vertex a, Vertex b, Vertex c)
      Check a triangle.
      Parameters:
      a - first vertex of triangle
      b - second vertex of triangle
      c - third vertex of triangle
      Returns:
      whether the triangle is valid
      Since:
      2006.01.27 (Christian Borgelt)
    • isects

      protected boolean isects(Vertex src, Vertex dst)
      Check intersection with key.
      Parameters:
      src - the source vertex
      dst - the destination vertex
      Returns:
      whether the edges between the vertices intersects path
      Since:
      2006.01.27 (Christian Borgelt)
    • init

      protected abstract void init(Vertex[] key, int cnt, Vertex[] holes, int holecnt)
      Initialize a subproblem splitter.
      Parameters:
      key - the key of the subproblem
      cnt - the size of the subproblem
      holes - the holes of the subproblem
      holecnt - the number of holes of the subproblem
      Since:
      2006.01.27 (Christian Borgelt)
    • init

      protected abstract void init(Vertex[] key, int cnt, Object spobj)
      Initialize a subproblem splitter.
      Parameters:
      key - the key of the subproblem
      cnt - the size of the subproblem
      spobj - the splitter object
      Since:
      2006.01.27 (Christian Borgelt)
    • empty

      protected double empty()
      Check for an empty triangle.
      Returns:
      whether the traingle is empty
      Since:
      2006.01.27 (Christian Borgelt)
    • next

      protected abstract boolean next()
      Create next subproblem split.
      Returns:
      whether a new split was created
      Since:
      2006.01.27 (Christian Borgelt)
    • split

      protected abstract void split()
      Split a subproblem with the current split.
      Since:
      2006.01.27 (Christian Borgelt)
    • triangle

      protected abstract Vertex[] triangle()
      Get the current triangle.
      Returns:
      the current triangle
      Since:
      2006.01.27 (Christian Borgelt)
    • weight

      protected abstract double weight()
      Compute the weight of the current split.
      Returns:
      the weight of a split
      Since:
      2006.01.27 (Christian Borgelt)
    • edges

      protected abstract Edge[] edges()
      Get the edges of the current path.
      Returns:
      the edges of the current path as an array
      Since:
      2006.01.27 (Christian Borgelt)
    • store

      protected abstract void store()
      Store the current path as best.
      Since:
      2006.01.27 (Christian Borgelt)
    • retrieve

      protected abstract Object retrieve()
      Retrieve the best path.
      Returns:
      the best path
      Since:
      2006.01.27 (Christian Borgelt)
    • distribute

      protected abstract void distribute()
      Distribute the hole vertices.
      Since:
      2006.01.27 (Christian Borgelt)
    • show

      protected void show()
      Show the subproblem to process.
      Since:
      2006.01.27 (Christian Borgelt)
    • show

      protected void show(int depth)
      Show the subproblem to process.
      Parameters:
      depth - the recursion depth
      Since:
      2006.01.27 (Christian Borgelt)