CompactHilbertCurve implements SpaceFillingCurve { static void clearOneBitInEachDimension(int i, BitVector[] p) { int n = p.length; for (int j = 0; j < n; ++j) { BitVector bv = p[j]; if (i < bv.size()) { bv.clear(i); } } } CompactHilbertCurve(MultiDimensionalSpec spec);  CompactHilbertCurve(int[] m); @Override MultiDimensionalSpec getSpec(); @Override void index(BitVector[] p, int minLevel, BitVector index); @Override void indexInverse(BitVector index, BitVector[] p); @Override void accept(ZoomingNavigator visitor); @Override String toString();  }
@Test public void clearOneBitInEachDimension() { BitVector[] p = {BitVectorFactories.OPTIMAL.apply(3), BitVectorFactories.OPTIMAL.apply(1)}; p[0].copyFrom(7); p[1].copyFrom(1); CompactHilbertCurve.clearOneBitInEachDimension(0, p); Assert.assertEquals(6, p[0].toExactLong()); Assert.assertEquals(0, p[1].toExactLong()); CompactHilbertCurve.clearOneBitInEachDimension(1, p); Assert.assertEquals(4, p[0].toExactLong()); Assert.assertEquals(0, p[1].toExactLong()); CompactHilbertCurve.clearOneBitInEachDimension(2, p); Assert.assertEquals(0, p[0].toExactLong()); Assert.assertEquals(0, p[1].toExactLong()); }