public class UnboundedHilbertSFCOperations extends Object implements HilbertSFCOperations
Modifier and Type | Field and Description |
---|---|
protected BigDecimal[] |
binsPerDimension |
protected BigInteger |
maxHilbertValue |
protected BigInteger |
minHilbertValue |
protected static BigInteger |
UNIT_CELL_SIZE |
Constructor and Description |
---|
UnboundedHilbertSFCOperations() |
Modifier and Type | Method and Description |
---|---|
MultiDimensionalNumericData |
convertFromHilbert(byte[] hilbertValue,
com.google.uzaygezen.core.CompactHilbertCurve compactHilbertCurve,
SFCDimensionDefinition[] dimensionDefinitions)
Convert the single SFC value to the ranges of raw values that it represents
|
byte[] |
convertToHilbert(Double[] values,
com.google.uzaygezen.core.CompactHilbertCurve compactHilbertCurve,
SFCDimensionDefinition[] dimensionDefinitions)
Convert the raw values (ordered per dimension) to a single SFC value
|
RangeDecomposition |
decomposeRange(NumericData[] rangePerDimension,
com.google.uzaygezen.core.CompactHilbertCurve compactHilbertCurve,
SFCDimensionDefinition[] dimensionDefinitions,
int totalPrecision,
int maxFilteredIndexedRanges,
boolean removeVacuum,
boolean overInclusiveOnEdge)
Decompose the raw range per dimension values into an optimal set of compact Hilbert SFC ranges
|
BigInteger |
getEstimatedIdCount(MultiDimensionalNumericData data,
SFCDimensionDefinition[] dimensionDefinitions)
Get a quick (minimal complexity calculation) estimate of the total row IDs a particular data
would require to fully cover with SFC values
|
double[] |
getInsertionIdRangePerDimension(SFCDimensionDefinition[] dimensionDefinitions)
* Get the range/size of a single insertion ID for each dimension
|
long[] |
indicesFromHilbert(byte[] hilbertValue,
com.google.uzaygezen.core.CompactHilbertCurve compactHilbertCurve,
SFCDimensionDefinition[] dimensionDefinitions)
Convert the single SFC value to the per dimension SFC coordinates that it represents
|
void |
init(SFCDimensionDefinition[] dimensionDefs)
initialize this set of operations with the given dimension definitions
|
long[] |
normalizeRange(double minValue,
double maxValue,
int dimension,
SFCDimensionDefinition boundedDimensionDefinition)
Determines the coordinates a given range will span within this space filling curve.
|
protected static final BigInteger UNIT_CELL_SIZE
protected BigDecimal[] binsPerDimension
protected BigInteger minHilbertValue
protected BigInteger maxHilbertValue
public void init(SFCDimensionDefinition[] dimensionDefs)
HilbertSFCOperations
init
in interface HilbertSFCOperations
dimensionDefs
- the dimension definitions to usepublic byte[] convertToHilbert(Double[] values, com.google.uzaygezen.core.CompactHilbertCurve compactHilbertCurve, SFCDimensionDefinition[] dimensionDefinitions)
HilbertSFCOperations
convertToHilbert
in interface HilbertSFCOperations
values
- a raw value per dimension in ordercompactHilbertCurve
- the compact Hilbert curve to use for the conversiondimensionDefinitions
- a set of dimension definitions to use to normalize the raw valuespublic long[] indicesFromHilbert(byte[] hilbertValue, com.google.uzaygezen.core.CompactHilbertCurve compactHilbertCurve, SFCDimensionDefinition[] dimensionDefinitions)
HilbertSFCOperations
indicesFromHilbert
in interface HilbertSFCOperations
hilbertValue
- the computed hilbert value to invert back to integer coordinates per
dimensioncompactHilbertCurve
- the compact Hilbert curve to use for the conversiondimensionDefinitions
- a set of dimension definitions to use to determine the bits of
precision per dimension that is expected in the compact hilbert curvepublic MultiDimensionalNumericData convertFromHilbert(byte[] hilbertValue, com.google.uzaygezen.core.CompactHilbertCurve compactHilbertCurve, SFCDimensionDefinition[] dimensionDefinitions)
HilbertSFCOperations
convertFromHilbert
in interface HilbertSFCOperations
hilbertValue
- the computed hilbert value to invert back to native coordinatescompactHilbertCurve
- the compact Hilbert curve to use for the conversiondimensionDefinitions
- a set of dimension definitions to use to normalize the raw valuespublic RangeDecomposition decomposeRange(NumericData[] rangePerDimension, com.google.uzaygezen.core.CompactHilbertCurve compactHilbertCurve, SFCDimensionDefinition[] dimensionDefinitions, int totalPrecision, int maxFilteredIndexedRanges, boolean removeVacuum, boolean overInclusiveOnEdge)
HilbertSFCOperations
decomposeRange
in interface HilbertSFCOperations
rangePerDimension
- the raw range per dimensioncompactHilbertCurve
- the compact Hilbert curve to use for the conversiondimensionDefinitions
- a set of dimension definitions to use to normalize the raw valuestotalPrecision
- the total precision of the dimension definitions, for conveniencemaxFilteredIndexedRanges
- the maximum number of ranges, if < 0 it will be unlimitedremoveVacuum
- a flag to pass to the compact hilbert curve range decompositionpublic BigInteger getEstimatedIdCount(MultiDimensionalNumericData data, SFCDimensionDefinition[] dimensionDefinitions)
HilbertSFCOperations
getEstimatedIdCount
in interface HilbertSFCOperations
data
- the datasetdimensionDefinitions
- a set of dimension definitions to use to normalize the raw valuespublic double[] getInsertionIdRangePerDimension(SFCDimensionDefinition[] dimensionDefinitions)
HilbertSFCOperations
getInsertionIdRangePerDimension
in interface HilbertSFCOperations
dimensionDefinitions
- a set of dimension definitions to use to calculate the range of
each insertion IDpublic long[] normalizeRange(double minValue, double maxValue, int dimension, SFCDimensionDefinition boundedDimensionDefinition) throws IllegalArgumentException
HilbertSFCOperations
normalizeRange
in interface HilbertSFCOperations
minValue
- the minimum valuemaxValue
- the maximum valuedimension
- the ordinal of the dimension on this space filling curveboundedDimensionDefinition
- the dimension definition to use to normalize the raw valuesIllegalArgumentException
Copyright © 2013–2022. All rights reserved.