Class PHTreeP<T>

    • Method Detail

      • createPHTree

        public static <T> PHTreeP<T> createPHTree​(int dims)
      • getDims

        public int getDims()
        Specified by:
        getDims in interface Index<T>
        Returns:
        the number of dimensions
      • size

        public int size()
        Specified by:
        size in interface Index<T>
        Returns:
        the number of entries
      • clear

        public void clear()
        Description copied from interface: Index
        Clear all entries.
        Specified by:
        clear in interface Index<T>
      • getStats

        public Stats getStats()
        Specified by:
        getStats in interface Index<T>
        Returns:
        Collect and return some index statistics. Note that indexes are not required to fill all fields. Also, individual indexes may use subclasses with additional fields.
      • getNodeCount

        public int getNodeCount()
        Specified by:
        getNodeCount in interface Index<T>
      • getDepth

        public int getDepth()
        Specified by:
        getDepth in interface Index<T>
      • toStringTree

        public String toStringTree()
        Specified by:
        toStringTree in interface Index<T>
        Returns:
        a full string output of the tree structure with all entries
      • insert

        public void insert​(double[] key,
                           T value)
        Description copied from interface: PointIndex
        Insert a point.
        Specified by:
        insert in interface PointIndex<T>
        Parameters:
        key - point
        value - value
      • remove

        public T remove​(double[] point)
        Description copied from interface: PointIndex
        Remove a point entry.
        Specified by:
        remove in interface PointIndex<T>
        Parameters:
        point - the point
        Returns:
        the value of the entry or null if the entry was not found
      • update

        public T update​(double[] oldPoint,
                        double[] newPoint)
        Description copied from interface: PointIndex
        Update the position of an entry.
        Specified by:
        update in interface PointIndex<T>
        Parameters:
        oldPoint - old position
        newPoint - new position
        Returns:
        the value of the entry or null if the entry was not found
      • queryExact

        public T queryExact​(double[] point)
        Description copied from interface: PointIndex
        Lookup an entry, using exact match.
        Specified by:
        queryExact in interface PointIndex<T>
        Parameters:
        point - the point
        Returns:
        the value of the entry or null if the entry was not found
      • query

        public QueryIterator<PointEntry<T>> query​(double[] min,
                                                  double[] max)
        Specified by:
        query in interface PointIndex<T>
        Parameters:
        min - Lower left corner of the query window
        max - Upper right corner of the query window
        Returns:
        All points that lie inside the query rectangle.
      • queryKNN

        public QueryIteratorKNN<PointEntryDist<T>> queryKNN​(double[] center,
                                                            int k)
        Description copied from interface: PointIndex
        Finds the nearest neighbor. This uses euclidean distance. Other distance types can only be specified directly on the index implementations.
        Specified by:
        queryKNN in interface PointIndex<T>
        Parameters:
        center - center point
        k - number of neighbors
        Returns:
        list of nearest neighbors