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 |
|---|---|
void |
encode(Output output) |
boolean |
equals(java.lang.Object o) |
int |
hashCode() |
int |
index(double value) |
double |
lowerBound(int index) |
double |
maxIndexableValue() |
double |
minIndexableValue() |
double |
relativeAccuracy() |
void |
serialize(Serializer serializer) |
int |
serializedSize() |
double |
upperBound(int index) |
double |
value(int index) |
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, waitdecodepublic BitwiseLinearlyInterpolatedMapping(double relativeAccuracy)
public int index(double value)
index in interface IndexMappingpublic double value(int index)
value in interface IndexMappingpublic double lowerBound(int index)
lowerBound in interface IndexMappingpublic double upperBound(int index)
upperBound in interface IndexMappingpublic double relativeAccuracy()
relativeAccuracy in interface IndexMappingpublic double minIndexableValue()
minIndexableValue in interface IndexMappingpublic double maxIndexableValue()
maxIndexableValue in interface IndexMappingpublic void encode(Output output) throws java.io.IOException
encode in interface IndexMappingjava.io.IOExceptionpublic 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