final int end = 10000000;
final int radius = 10;
for (int numPoints = start; numPoints <= end; numPoints *= factor) {
try {
BitmapFactory bf = new ConciseBitmapFactory();
RTree tree = new RTree(2, new LinearGutmanSplitStrategy(0, 50, bf), bf);
Stopwatch stopwatch = new Stopwatch().start();
Random rand = new Random();
for (int i = 0; i < numPoints; i++) {
tree.insert(new float[]{(float) (rand.nextDouble() * 100), (float) (rand.nextDouble() * 100)}, i);
}
long stop = stopwatch.elapsedMillis();
System.out.printf("[%,d]: insert = %,d ms%n", numPoints, stop);
stopwatch.reset().start();
ImmutableRTree searchTree = ImmutableRTree.newImmutableFromMutable(tree);
stop = stopwatch.elapsedMillis();
System.out.printf("[%,d]: size = %,d bytes%n", numPoints, searchTree.toBytes().length);
System.out.printf("[%,d]: buildImmutable = %,d ms%n", numPoints, stop);
stopwatch.reset().start();
Iterable<ImmutableGenericBitmap> points = searchTree.search(new RadiusBound(new float[]{50, 50}, radius));
Iterables.size(points);
stop = stopwatch.elapsedMillis();
System.out.printf("[%,d]: search = %,dms%n", numPoints, stop);
stopwatch.reset().start();
ImmutableGenericBitmap finalSet = bf.union(points);
stop = stopwatch.elapsedMillis();
System.out.printf("[%,d]: union of %,d points in %,d ms%n", numPoints, finalSet.size(), stop);
}
catch (Exception e) {