Package pointgon

Class Path

All Implemented Interfaces:
Serializable
Direct Known Subclasses:
Combined1, Combined2

public class Path extends Splitter
Class for splitting a (sub-)pointgon with a path.
Since:
2006.01.27 (Christian Borgelt)
See Also:
  • Field Details

    • cut

      protected static final Vertex[] cut
      fixed dummy path to represent any path cutting off an anchor
    • frst

      protected Vertex frst
      first vertex on counterclockwise walk
    • last

      protected Vertex last
      last vertex on counterclockwise walk
    • idxs

      protected int[] idxs
      indices of holes on current path
    • path

      protected Vertex[] path
      vertices of current path
    • plen

      protected int plen
      length of current path
    • pdir

      protected int pdir
      direction of current path
    • lftpos

      protected int lftpos
      position in holes for left paths
    • rgtpos

      protected int rgtpos
      position in holes for right paths
    • rgtall

      protected int rgtall
      full size of right subproblem
    • lftall

      protected int lftall
      full size of left subproblem
    • bestlen

      protected int bestlen
      length of the best path
  • Constructor Details

    • Path

      protected Path(MWT mwt)
      Create a path splitter.
      Parameters:
      mwt - the minimum weight triangulation object
      Since:
      2006.01.27 (Christian Borgelt)
  • Method Details

    • getpos

      protected void getpos(Vertex p, Vertex q)
      Get hole positions for a path.
      Parameters:
      p - start vertex of the path
      q - end vertex of the path
      Since:
      2006.01.27 (Christian Borgelt)
    • nextEnd

      protected Vertex 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

      protected boolean validcut(Vertex p, Vertex q)
      Check the path cutting off the anchor.
      Parameters:
      p - the first vertex of the path
      q - the last vertex of the path
      Returns:
      whether the cut is valid
      Since:
      2006.01.27 (Christian Borgelt)
    • inside

      protected boolean inside(Vertex p, Vertex q)
      Check whether path leads inside.
      Parameters:
      p - the first vertex of the path
      q - the last vertex of the path
      Returns:
      whether the path leads inside
      Since:
      2006.01.27 (Christian Borgelt)
    • size

      protected int size(Vertex[] key, int cnt)
      Get the full size of a subproblem.
      Parameters:
      key - the key of the subproblem
      cnt - the size of the subproblem
      Returns:
      the full size of a subproblem
      Since:
      2006.01.27 (Christian Borgelt)
    • init

      protected void init(Vertex[] key, int cnt, Vertex[] holes, int holecnt)
      Initialize the path splitter.
      Specified by:
      init in class 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 void init(Vertex[] key, int cnt, Object spobj)
      Initialize a path splitter.
      Specified by:
      init in class Splitter
      Parameters:
      key - the key of the subproblem
      cnt - the size of the subproblem
      spobj - the splitter object
      Since:
      2006.01.27 (Christian Borgelt)
    • next

      protected boolean next()
      Create the next subproblem split.
      Specified by:
      next in class Splitter
      Returns:
      whether a new split was created
      Since:
      2006.01.27 (Christian Borgelt)
    • split

      protected void split()
      Split a subproblem with the current path.
      Specified by:
      split in class Splitter
      Since:
      2006.01.27 (Christian Borgelt)
    • triangle

      protected Vertex[] triangle()
      Get the current triangle.
      Specified by:
      triangle in class Splitter
      Returns:
      always null
      Since:
      2006.01.27 (Christian Borgelt)
    • weight

      protected double weight()
      Compute the weight of the current split.
      Specified by:
      weight in class Splitter
      Returns:
      the weight of the current split
      Since:
      2006.01.27 (Christian Borgelt)
    • edges

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

      protected void store()
      Store the current path as best.
      Specified by:
      store in class Splitter
      Since:
      2006.01.27 (Christian Borgelt)
    • retrieve

      protected Object retrieve()
      Retrieve the best path.
      Specified by:
      retrieve in class Splitter
      Returns:
      the best path
      Since:
      2006.01.27 (Christian Borgelt)
    • distribute

      protected void distribute()
      Distribute the hole vertices.
      Specified by:
      distribute in class Splitter
      Since:
      2006.01.27 (Christian Borgelt)