@Test public void randomTest() { int N = 2000; Set<RectHV> input = generateRect(N); IntervalSearchTree<Double, RectHV> invST = new IntervalST<>(); Map<RectHV, Set<RectHV>> test = RectangleIntersection.findAllIntersection(input, invST); for (RectHV cur : input) { Set<RectHV> expect = new HashSet<>(); for (RectHV k : input) { if (k == cur) continue; if (k.intersects(cur)) expect.add(k); } Assert.assertTrue(equals(expect, test.get(cur))); } }
public static Map<RectHV, Set<RectHV>> findAllIntersection(Set<RectHV> input) { return findAllIntersection(input, new IntervalST<>()); }
RectangleIntersection { public static Map<RectHV, Set<RectHV>> findAllIntersection(Set<RectHV> input) { return findAllIntersection(input, new IntervalST<>()); } }
RectangleIntersection { public static Map<RectHV, Set<RectHV>> findAllIntersection(Set<RectHV> input) { return findAllIntersection(input, new IntervalST<>()); }  }
RectangleIntersection { public static Map<RectHV, Set<RectHV>> findAllIntersection(Set<RectHV> input) { return findAllIntersection(input, new IntervalST<>()); }  static Map<RectHV, Set<RectHV>> findAllIntersection(Set<RectHV> input); static Map<RectHV, Set<RectHV>> findAllIntersection(Set<RectHV> input,
                                                               IntervalSearchTree<Double, RectHV> intervalST); }
RectangleIntersection { public static Map<RectHV, Set<RectHV>> findAllIntersection(Set<RectHV> input) { return findAllIntersection(input, new IntervalST<>()); }  static Map<RectHV, Set<RectHV>> findAllIntersection(Set<RectHV> input); static Map<RectHV, Set<RectHV>> findAllIntersection(Set<RectHV> input,
                                                               IntervalSearchTree<Double, RectHV> intervalST);  }