Package org.apache.lucene.util.hppc
Class BitMixer
- java.lang.Object
-
- org.apache.lucene.util.hppc.BitMixer
-
public final class BitMixer extends java.lang.Object
Bit mixing utilities. The purpose of these methods is to evenly distribute key space over int32 range.Forked from com.carrotsearch.hppc.BitMixer
github: https://github.com/carrotsearch/hppc release: 0.9.0
-
-
Constructor Summary
Constructors Constructor Description BitMixer()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static int
mix(byte key)
static int
mix(char key)
static int
mix(double key)
static int
mix(float key)
static int
mix(int key)
static int
mix(long key)
static int
mix(short key)
static int
mix(java.lang.Object key)
static int
mix32(int k)
MH3's plain finalization step.static long
mix64(long z)
Computes David Stafford variant 9 of 64bit mix function (MH3 finalization step, with different shifts and constants).static int
mixPhi(byte k)
static int
mixPhi(char k)
static int
mixPhi(double k)
static int
mixPhi(float k)
static int
mixPhi(int k)
static int
mixPhi(long k)
static int
mixPhi(short k)
static int
mixPhi(java.lang.Object k)
-
-
-
Field Detail
-
PHI_C32
private static final int PHI_C32
- See Also:
- Constant Field Values
-
PHI_C64
private static final long PHI_C64
- See Also:
- Constant Field Values
-
-
Method Detail
-
mix
public static int mix(byte key)
-
mix
public static int mix(short key)
-
mix
public static int mix(char key)
-
mix
public static int mix(int key)
-
mix
public static int mix(float key)
-
mix
public static int mix(double key)
-
mix
public static int mix(long key)
-
mix
public static int mix(java.lang.Object key)
-
mix32
public static int mix32(int k)
MH3's plain finalization step.
-
mix64
public static long mix64(long z)
Computes David Stafford variant 9 of 64bit mix function (MH3 finalization step, with different shifts and constants).Variant 9 is picked because it contains two 32-bit shifts which could be possibly optimized into better machine code.
- See Also:
- "http://zimbry.blogspot.com/2011/09/better-bit-mixing-improving-on.html"
-
mixPhi
public static int mixPhi(byte k)
-
mixPhi
public static int mixPhi(char k)
-
mixPhi
public static int mixPhi(short k)
-
mixPhi
public static int mixPhi(int k)
-
mixPhi
public static int mixPhi(float k)
-
mixPhi
public static int mixPhi(double k)
-
mixPhi
public static int mixPhi(long k)
-
mixPhi
public static int mixPhi(java.lang.Object k)
-
-