public class CompactHilbertCurve extends Object implements SpaceFillingCurve
sum(i=0..n-1, m[i]).
The main difference from the paper(s) is that we reverse the order of the dimensions so that we keep the natural orientation of the curve.
This class is not thread safe.| Constructor and Description |
|---|
CompactHilbertCurve(int[] m)
Convenience constructor.
|
CompactHilbertCurve(MultiDimensionalSpec spec) |
| Modifier and Type | Method and Description |
|---|---|
void |
accept(ZoomingNavigator visitor)
Shows the space to the visitor, and the process is guided by the visitor
through its
boolean returning method. |
MultiDimensionalSpec |
getSpec()
Provides the specification of the multidimensional space on which this
space filling curve operates.
|
void |
index(BitVector[] p,
int minLevel,
BitVector index)
Computes the compact Hilbert index of the n-point
p. |
void |
indexInverse(BitVector index,
BitVector[] p)
Computes the unique n-point
p having index as its compact
Hilbert index in this multidimensional space. |
String |
toString() |
public CompactHilbertCurve(MultiDimensionalSpec spec)
public CompactHilbertCurve(int[] m)
m - bits per dimensionpublic MultiDimensionalSpec getSpec()
IndexCalculatorgetSpec in interface IndexCalculatorpublic void index(BitVector[] p, int minLevel, BitVector index)
p.index in interface IndexCalculatorp - point in the multidimensional space. Implementations are not
allowed to modify anything in this parameter.minLevel - the level between 0 and mMax inclusive, inclusive, up to
which the index bits should be calculated. If equal to mMax, then the
result is always zero since there are no dimensions that have the mMax bit.
To get the full compact index specify minLevel = 0.index - outputpublic void indexInverse(BitVector index, BitVector[] p)
p having index as its compact
Hilbert index in this multidimensional space.indexInverse in interface SpaceFillingCurveindex - the index of a to-be-located point. Implementations must not
modify this parameter in any way.p - outputpublic void accept(ZoomingNavigator visitor)
SpaceFillingCurveboolean returning method. Thus the visitor has a double
role as a driver of the navigation since at each call it decides if it
wants to zoom in or not. The visitor is guaranteed to see the space in
index order in-depth traversal.accept in interface SpaceFillingCurvevisitor - driver-visitorCopyright © 2014. All Rights Reserved.