public class BitwiseLinearlyInterpolatedMapping extends java.lang.Object implements IndexMapping
IndexMapping that approximates the memory-optimal one (namely LogarithmicMapping) by
extracting the floor value of the logarithm to the base 2 from the binary representations of floating-point values
and linearly interpolating the logarithm in-between using, again, the binary representation.
Note that this mapping, while fast, might be highly memory inefficient as it only works for a discrete set of relative accuracies and will fall back to the largest possible one that is less than the requested accuracy (which can be as low as half of it, in the worst case).
| Constructor and Description |
|---|
BitwiseLinearlyInterpolatedMapping(double relativeAccuracy) |
| Modifier and Type | Method and Description |
|---|---|
boolean |
equals(java.lang.Object o) |
int |
hashCode() |
int |
index(double value) |
double |
maxIndexableValue() |
double |
minIndexableValue() |
double |
relativeAccuracy() |
void |
serialize(Serializer serializer) |
int |
serializedSize() |
double |
value(int index) |
public BitwiseLinearlyInterpolatedMapping(double relativeAccuracy)
public int index(double value)
index in interface IndexMappingpublic double value(int index)
value in interface IndexMappingpublic double relativeAccuracy()
relativeAccuracy in interface IndexMappingpublic double minIndexableValue()
minIndexableValue in interface IndexMappingpublic double maxIndexableValue()
maxIndexableValue in interface IndexMappingpublic int serializedSize()
serializedSize in interface IndexMappingpublic void serialize(Serializer serializer)
serialize in interface IndexMappingpublic boolean equals(java.lang.Object o)
equals in class java.lang.Objectpublic int hashCode()
hashCode in class java.lang.Object