public static <S extends Rectangle> int SelfJoin_rectangles(S rs,
Self join of rectangles. This method runs faster than the general version
because it just performs the filter step based on the rectangles.
public static <S extends Shape> int SelfJoin_planeSweep(S R,
The general version of self join algorithm which works with arbitrary
shapes. First, it performs a filter step where it finds shapes with
overlapping MBRs. Second, an optional refine step can be executed to
return only shapes which actually overlap.
R - - input set of shapes
refine - - Whether or not to run a refine step
output - - output collector where the results are reported
- number of pairs returned by the planesweep algorithm