public final class RandomUtils extends Object
| Modifier and Type | Field and Description |
|---|---|
static int |
MAX_INT_SMALLER_TWIN_PRIME
The largest prime less than 231-1 that is the smaller of a twin prime pair.
|
| Modifier and Type | Method and Description |
|---|---|
static long |
md5HashToLong(long l) |
static int |
nextTwinPrime(int n)
Finds next-largest "twin primes": numbers p and p+2 such that both are prime.
|
static int |
randomFrom(FastIDSet set,
org.apache.commons.math3.random.RandomGenerator random) |
static float[] |
randomUnitVector(int dimensions,
org.apache.commons.math3.random.RandomGenerator random) |
public static final int MAX_INT_SMALLER_TWIN_PRIME
public static float[] randomUnitVector(int dimensions,
org.apache.commons.math3.random.RandomGenerator random)
dimensions - dimensionality of resulting vectorrandom - random number generator to usepublic static int nextTwinPrime(int n)
public static long md5HashToLong(long l)
public static int randomFrom(FastIDSet set, org.apache.commons.math3.random.RandomGenerator random)
set - to choose fromrandom - random number generatorCopyright © 2012. All Rights Reserved.