public class SoftOneOfN extends MultivariateRandomGenerator
1-epsilon
for one and equal parts
for the rest of a random vector. The content of container MRGParams
is never used in this class.Constructor and Description |
---|
SoftOneOfN()
This constructor can be used for (hard) sampling one of n.
|
SoftOneOfN(double epsilon)
This constructor can be used for (soft) sampling one of n.
|
Modifier and Type | Method and Description |
---|---|
void |
generate(double[] d,
int start,
int number)
Generates an array of length
number as part of the array
d beginning at index start with one entry
getting the value 1-epsilon and all the others equal parts
of epsilon . |
void |
generate(double[] d,
int start,
int number,
MRGParams p)
Generates a
n -dimensional random array as part of the array
d beginning at start . |
double[] |
generate(int number)
Generates an array of length
number with one entry getting
the value 1-epsilon and all the others equal parts of
epsilon . |
generate
public SoftOneOfN(double epsilon) throws IllegalArgumentException
1-epsilon
, all the others will get an equal part.epsilon
- the value that should be subtracted from 1 for one itemIllegalArgumentException
- if the value of epsilon
is not in [0,1]public SoftOneOfN()
public void generate(double[] d, int start, int number, MRGParams p)
MultivariateRandomGenerator
n
-dimensional random array as part of the array
d
beginning at start
.generate
in class MultivariateRandomGenerator
d
- the arraystart
- the start index for generated valuesnumber
- the dimension of the random arrayp
- the parameter of the underlying distributionpublic double[] generate(int number)
number
with one entry getting
the value 1-epsilon
and all the others equal parts of
epsilon
.number
- the length of the generated arraynumber
with one entry getting the
value 1-epsilon
and all the others equal parts of
epsilon
generate(double[], int, int)
public void generate(double[] d, int start, int number)
number
as part of the array
d
beginning at index start
with one entry
getting the value 1-epsilon
and all the others equal parts
of epsilon
.d
- the arraystart
- the start index for generated valuesnumber
- the dimension of the generated array