Class liba
java.lang.Object
liba
algorithm library
-
Field Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic final int
hash_bkdr
(byte[] block, int value) a hash function whose prime number is 131static final int
hash_sdbm
(byte[] block, int value) a hash function whose prime number is 65599static final int
isqrt
(int x) square root of an unsigned integerstatic final int
isqrt
(long x) square root of an unsigned integerstatic final double
rsqrt
(double x) reciprocal of square-rootstatic final float
rsqrt
(float x) reciprocal of square-root
-
Field Details
-
VERSION
algorithm library version string
-
-
Method Details
-
isqrt
public static final int isqrt(int x) square root of an unsigned integer- Parameters:
x
- independent variable- Returns:
- calculated result
-
isqrt
public static final int isqrt(long x) square root of an unsigned integer- Parameters:
x
- independent variable- Returns:
- calculated result
-
rsqrt
public static final float rsqrt(float x) reciprocal of square-root- Parameters:
x
- independent variable- Returns:
- calculated result
-
rsqrt
public static final double rsqrt(double x) reciprocal of square-root- Parameters:
x
- independent variable- Returns:
- calculated result
-
hash_bkdr
public static final int hash_bkdr(byte[] block, int value) a hash function whose prime number is 131- Parameters:
block
- block to be processedvalue
- initial value- Returns:
- hash value
-
hash_sdbm
public static final int hash_sdbm(byte[] block, int value) a hash function whose prime number is 65599- Parameters:
block
- block to be processedvalue
- initial value- Returns:
- hash value
-