Class VPTree.Builder

  • Enclosing class:
    VPTree<O>

    private class VPTree.Builder
    extends java.lang.Object
    Build the VP-Tree
    Author:
    Erich Schubert
    • Constructor Summary

      Constructors 
      Constructor Description
      Builder()
      Constructor.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      private VPTree.Node buildTree​(int left, int right)
      Build the tree recursively
      private double calcMoment​(DBIDRef p, DBIDs check, int size)
      Calculate the 2nd moment to the median of the distances to p
      private DBIDVar chooseVantagePoint​(int left, int right)
      Find a vantage points in the DBIDs between left and right
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • Builder

        public Builder()
        Constructor.
    • Method Detail

      • buildTree

        private VPTree.Node buildTree​(int left,
                                      int right)
        Build the tree recursively
        Parameters:
        left - Left bound in scratch
        right - Right bound in scratch
        Returns:
        new node
      • chooseVantagePoint

        private DBIDVar chooseVantagePoint​(int left,
                                           int right)
        Find a vantage points in the DBIDs between left and right
        Parameters:
        left - Left bound in scratch
        right - Right bound in scratch
        Returns:
        vantage point
      • calcMoment

        private double calcMoment​(DBIDRef p,
                                  DBIDs check,
                                  int size)
        Calculate the 2nd moment to the median of the distances to p
        Parameters:
        p - DBID to calculate the moment for
        check - points to check with
        size - Maximum size to use
        Returns:
        second moment