mikera.randomz
Class Hash
- java.lang.Object
-
- mikera.randomz.Hash
-
public class Hash extends java.lang.ObjectStatic pseudo-random hash functions
-
-
Constructor Summary
Constructors Constructor and Description Hash()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method and Description static doubledhash(double x)static doubledhash(double x, double y)static doubledhash(double x, double y, double z)static doubledhash(double x, double y, double z, double t)static longhash(double x)static longhash(double x, double y)static longhash(double x, double y, double z)static longhash(double x, double y, double z, double t)static inthashCode(double d)Hashcode for a double primitive.static inthashCode(int value)Hashcode for an int, defined as the value of the int itself for consistency with java.lang.Integerstatic <T> inthashCode(java.util.List<T> list)Hashcode for list of items.static inthashCode(long l)Hashcode for a long primitive Matches Java hashCode.static longlongHash(long a)static intzeroVectorHash(int length)Return the hashCode for a vector of zeros
-
-
-
Method Detail
-
longHash
public static final long longHash(long a)
-
hash
public static final long hash(double x)
-
hash
public static final long hash(double x, double y)
-
hash
public static final long hash(double x, double y, double z)
-
hash
public static final long hash(double x, double y, double z, double t)
-
dhash
public static final double dhash(double x)
-
dhash
public static final double dhash(double x, double y)
-
dhash
public static final double dhash(double x, double y, double z)
-
dhash
public static final double dhash(double x, double y, double z, double t)
-
hashCode
public static final int hashCode(int value)
Hashcode for an int, defined as the value of the int itself for consistency with java.lang.Integer- Parameters:
value-- Returns:
-
hashCode
public static final int hashCode(double d)
Hashcode for a double primitive. Matches Java hashCode.- Parameters:
d-- Returns:
-
hashCode
public static final int hashCode(long l)
Hashcode for a long primitive Matches Java hashCode.- Parameters:
l-- Returns:
-
hashCode
public static <T> int hashCode(java.util.List<T> list)
Hashcode for list of items. Matches Java hashcode- Parameters:
list-- Returns:
-
zeroVectorHash
public static int zeroVectorHash(int length)
Return the hashCode for a vector of zeros- Parameters:
length-- Returns:
-
-
DMelt 3.0 © DataMelt by jWork.ORG