|
ImageScience 3.0.0 | ||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectimagescience.random.ExponentialGenerator
public class ExponentialGenerator
Exponential random number generator. This implementation is based on taking the natural logarithm of uniform random numbers, the latter of which are obtained from class UniformGenerator
. For more details, see for example W. H. Press, S. A. Teukolsky, W. T. Vetterling, B. P. Flannery, Numerical Recipes in C: The Art of Scientific Computing (2nd edition), Cambridge University Press, Cambridge, 1992, Section 7.2.
Constructor Summary | |
---|---|
ExponentialGenerator()
Constructs a generator of random numbers from the exponential distribution with unit value at 0 and initialized with a random seed. |
|
ExponentialGenerator(double lambda)
Constructs a generator of random numbers from the exponential distribution with value lambda at 0 and initialized with a random seed. |
|
ExponentialGenerator(double lambda,
int seed)
Constructs a generator of random numbers from the exponential distribution with value lambda at 0 and initialized with the given seed . |
|
ExponentialGenerator(int seed)
Constructs a generator of random numbers from the exponential distribution with unit value at 0 and initialized with the given seed . |
Method Summary | |
---|---|
double |
next()
Returns a random number from the exponential distribution with lambda specified at construction. |
double |
next(double lambda)
Returns a random number from the exponential distribution with given lambda . |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public ExponentialGenerator()
0
and initialized with a random seed.
public ExponentialGenerator(int seed)
0
and initialized with the given seed
.
seed
- The seed used for initialization of the generator.public ExponentialGenerator(double lambda)
lambda
at 0
and initialized with a random seed.
lambda
- The lambda parameter of the exponential distribution. Must be larger than 0
.
java.lang.IllegalArgumentException
- If lambda
is less than or equal to 0
.public ExponentialGenerator(double lambda, int seed)
lambda
at 0
and initialized with the given seed
.
lambda
- The lambda parameter of the exponential distribution. Must be larger than 0
.seed
- The seed used for initialization of the generator.
java.lang.IllegalArgumentException
- If lambda
is less than or equal to 0
.Method Detail |
---|
public double next()
next
in interface RandomGenerator
public double next(double lambda)
lambda
.
lambda
.
|
ImageScience 3.0.0 | ||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
Copyright (C) Erik Meijering. Permission to use this software and corresponding documentation for educational, research, and not-for-profit purposes, without a fee and without a signed licensing agreement, is granted, subject to the following terms and conditions.
IT IS NOT ALLOWED TO REDISTRIBUTE, SELL, OR LEASE THIS SOFTWARE, OR DERIVATIVE WORKS THEREOF, WITHOUT PERMISSION IN WRITING FROM THE COPYRIGHT HOLDER. THE COPYRIGHT HOLDER IS FREE TO MAKE VERSIONS OF THE SOFTWARE AVAILABLE FOR A FEE OR COMMERCIALLY ONLY.
IN NO EVENT SHALL THE COPYRIGHT HOLDER BE LIABLE TO ANY PARTY FOR DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES, OF ANY KIND WHATSOEVER, ARISING OUT OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN IF ADVISED OF THE POSSIBILITY THEREOF.
THE COPYRIGHT HOLDER SPECIFICALLY DISCLAIMS ANY WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE EXPRESS OR IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE SOFTWARE AND CORRESPONDING DOCUMENTATION IS PROVIDED "AS IS". THE COPYRIGHT HOLDER HAS NO OBLIGATION TO PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS.