ProGAL.dataStructures.rangeSearching.rangeTree
Class RangeTree

java.lang.Object
  extended by ProGAL.dataStructures.rangeSearching.rangeTree.RangeTree
All Implemented Interfaces:
RangeSearchDataStructure

public class RangeTree
extends java.lang.Object
implements RangeSearchDataStructure


Constructor Summary
RangeTree(java.util.List<Point> points)
          Initialize the range tree by presorting according to each dimension.
 
Method Summary
static void main(java.lang.String[] args)
          Test the range tree.
 java.util.List<Point> query(double[] low, double[] high)
          Query the range tree given a low and a high value for each dimension.
 java.util.List<Point> query(Point p1, Point p2)
          Query the range given two points.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

RangeTree

public RangeTree(java.util.List<Point> points)
Initialize the range tree by presorting according to each dimension.

Method Detail

query

public java.util.List<Point> query(double[] low,
                                   double[] high)
Query the range tree given a low and a high value for each dimension. The values in high does not necessary has to be higher than the values in low. It is the interval which matters.


query

public java.util.List<Point> query(Point p1,
                                   Point p2)
Query the range given two points. As with the query above, the coordinates perform an interval. p1 < p2 is not a necessity.

Specified by:
query in interface RangeSearchDataStructure

main

public static void main(java.lang.String[] args)
Test the range tree.