public final class BenchmarkUtils extends Object
| Modifier and Type | Field and Description |
|---|---|
static int |
DEFAULT_MAX_EXP
Default max exponent for random double values.
|
static int |
DEFAULT_MIN_EXP
Default min exponent for random double values.
|
| Modifier and Type | Method and Description |
|---|---|
static double |
randomDouble(int minExp,
int maxExp,
org.apache.commons.rng.UniformRandomProvider rng)
Create a random double value with exponent in the range
[minExp, maxExp]. |
static double |
randomDouble(org.apache.commons.rng.UniformRandomProvider rng)
Creates a random double number with a random sign and mantissa and a large, default
range for the exponent.
|
static double[] |
randomDoubleArray(int len,
int minExp,
int maxExp,
org.apache.commons.rng.UniformRandomProvider rng)
Create an array with the given length containing random doubles with exponents in the range
[minExp, maxExp]. |
static double[] |
randomDoubleArray(int len,
org.apache.commons.rng.UniformRandomProvider rng)
Create an array of doubles populated using
randomDouble(UniformRandomProvider). |
public static final int DEFAULT_MIN_EXP
public static final int DEFAULT_MAX_EXP
public static double randomDouble(org.apache.commons.rng.UniformRandomProvider rng)
rng - random number generatorpublic static double randomDouble(int minExp, int maxExp, org.apache.commons.rng.UniformRandomProvider rng)
[minExp, maxExp].minExp - minimum exponent; must be less than maxExpmaxExp - maximum exponent; must be greater than minExprng - random number generatorpublic static double[] randomDoubleArray(int len, org.apache.commons.rng.UniformRandomProvider rng)
randomDouble(UniformRandomProvider).rng - uniform random providerlen - array lengthlen random doublespublic static double[] randomDoubleArray(int len, int minExp, int maxExp, org.apache.commons.rng.UniformRandomProvider rng)
[minExp, maxExp].len - array lengthminExp - minimum exponent; must be less than maxExpmaxExp - maximum exponent; must be greater than minExprng - random number generatorCopyright © 2016–2021 The Apache Software Foundation. All rights reserved.