|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES All Classes | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectde.jstacs.utils.random.MultivariateRandomGenerator
de.jstacs.utils.random.SoftOneOfN
public class SoftOneOfN
This random generator returns 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 Summary | |
---|---|
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. |
Method Summary | |
---|---|
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 . |
Methods inherited from class de.jstacs.utils.random.MultivariateRandomGenerator |
---|
generate |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
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 item
IllegalArgumentException
- if the value of epsilon
is not in [0,1]public SoftOneOfN()
Method Detail |
---|
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 array
number
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
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES All Classes | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |