public final class RandomUtil extends Object
Modifier and Type | Method and Description |
---|---|
static BigInteger[] |
randomBigIntegerArray(int length,
BigInteger min,
BigInteger max,
org.apache.commons.math3.random.RandomGenerator rnd)
Creates random array of length
degree + 1 with elements bounded by bound (by absolute value). |
static BigInteger |
randomInt(BigInteger bound,
org.apache.commons.math3.random.RandomGenerator rnd)
Returns random integer in range
[0, bound) . |
static int[] |
randomIntArray(int length,
int min,
int max,
org.apache.commons.math3.random.RandomGenerator rnd)
Creates random array of length
degree + 1 with elements bounded by bound (by absolute value). |
static long[] |
randomLongArray(int length,
long min,
long max,
org.apache.commons.math3.random.RandomGenerator rnd)
Creates random array of length
degree + 1 with elements bounded by bound (by absolute value). |
static int[] |
randomSharpIntArray(int length,
int total,
org.apache.commons.math3.random.RandomGenerator rnd)
Creates random array of length
degree + 1 with elements bounded by bound (by absolute value). |
public static int[] randomIntArray(int length, int min, int max, org.apache.commons.math3.random.RandomGenerator rnd)
degree + 1
with elements bounded by bound
(by absolute value).length
- array lengthmin
- min valuemax
- max valuernd
- random sourcelength
with elements bounded by bound
(by absolute value)public static int[] randomSharpIntArray(int length, int total, org.apache.commons.math3.random.RandomGenerator rnd)
degree + 1
with elements bounded by bound
(by absolute value).length
- array lengthtotal
- totalrnd
- random sourcelength
with elements bounded by bound
(by absolute value)public static long[] randomLongArray(int length, long min, long max, org.apache.commons.math3.random.RandomGenerator rnd)
degree + 1
with elements bounded by bound
(by absolute value).length
- array lengthmin
- min valuemax
- max valuernd
- random sourcelength
with elements bounded by bound
(by absolute value)public static BigInteger[] randomBigIntegerArray(int length, BigInteger min, BigInteger max, org.apache.commons.math3.random.RandomGenerator rnd)
degree + 1
with elements bounded by bound
(by absolute value).length
- array lengthmin
- min valuemax
- max valuernd
- random sourcelength
with elements bounded by bound
(by absolute value)public static BigInteger randomInt(BigInteger bound, org.apache.commons.math3.random.RandomGenerator rnd)
[0, bound)
.bound
- maximal allowed valuernd
- randomb
so that 0 <= b < bound
Copyright © 2018. All rights reserved.