public class EmpiricalDistribution extends Object
Modifier and Type | Field and Description |
---|---|
protected double[] |
_cdf |
protected int |
_interpolationType |
private Random |
_rand |
Constructor and Description |
---|
EmpiricalDistribution(double[] pdf)
Create an EmpiricalDistribution from an input array of positive values.
|
Modifier and Type | Method and Description |
---|---|
double |
nextDouble()
Returns a random number from the distribution.
|
double |
pdf(int k)
Returns the probability distribution function.
|
void |
setSeed(long seed)
Allows the random number generator seed to be set
|
void |
setState(double[] pdf)
Creates and normalizes the cumulative probability distribution
|
String |
toString()
Returns a String representation of the receiver.
|
private Random _rand
protected double[] _cdf
protected int _interpolationType
public EmpiricalDistribution(double[] pdf)
pdf
- an array of positive values representing the empirical
distribution from which random numbers should be drawn.public void setSeed(long seed)
seed
- public double nextDouble()
public double pdf(int k)
public void setState(double[] pdf)
Copyright © 2016 Linear Collider Detector (LCD). All rights reserved.