de.jstacs.utils.random
Class EqualParts
java.lang.Object
de.jstacs.utils.random.MultivariateRandomGenerator
de.jstacs.utils.random.EqualParts
public class EqualParts
- extends MultivariateRandomGenerator
This class is no real random generator it just returns 1/n for all values.
The content of container MRGParams
is never used in this class.
- Author:
- Jens Keilwagen
Method Summary |
void |
generate(double[] d,
int start,
int number)
Modifies a given number of array entries to
1/number . |
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 n)
Returns an array of length n with entries 1/n . |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
EqualParts
public EqualParts()
generate
public void generate(double[] d,
int start,
int number,
MRGParams p)
- Description copied from class:
MultivariateRandomGenerator
- Generates a
n
-dimensional random array as part of the array
d
beginning at start
.
- Specified by:
generate
in class MultivariateRandomGenerator
- Parameters:
d
- the arraystart
- the start index for generated valuesnumber
- the dimension of the random arrayp
- the parameter of the underlying distribution
generate
public double[] generate(int n)
- Returns an array of length
n
with entries 1/n
.
- Parameters:
n
- the length of the array and the divisor for the calculation of
the equal parts as its entries
- Returns:
- an array of length
n
with entries 1/n - See Also:
generate(double[], int, int)
generate
public void generate(double[] d,
int start,
int number)
- Modifies a given
number
of array entries to
1/number
.
- Parameters:
d
- the array which will be modifiedstart
- the start index of the modification of the arraynumber
- the number of entries 1/number