Documentation of 'edu.rit.numeric.UniformPrng' Java class
UniformPrng
edu.rit.numeric

Class UniformPrng



  • public class UniformPrng
    extends DoublePrng
    Class UniformPrng provides a pseudorandom number generator (PRNG) that generates random numbers with a uniform(a,b) distribution. The probability density function is
        f(x) = 1/(ba), axb
        f(x) = 0, otherwise

    Every call of the next() method results in one call of the underlying uniform PRNG's nextDouble() method.

    • Constructor Summary

      Constructors 
      Constructor and Description
      UniformPrng(Random theUniformPrng, double a, double b)
      Construct a new uniform PRNG.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method and Description
      double next()
      Returns the next random number.
      • Methods inherited from class java.lang.Object

        equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • UniformPrng

        public UniformPrng(Random theUniformPrng,
                           double a,
                           double b)
        Construct a new uniform PRNG.
        Parameters:
        theUniformPrng - The underlying uniform PRNG.
        a - Interval lower bound.
        b - Interval upper bound.
        Throws:
        java.lang.NullPointerException - (unchecked exception) Thrown if theUniformPrng is null.
        java.lang.IllegalArgumentException - (unchecked exception) Thrown if ab.
    • Method Detail

      • next

        public double next()
        Returns the next random number.
        Specified by:
        next in class DoublePrng
        Returns:
        Random number.

DMelt 3.0 © DataMelt by jWork.ORG

You see the box below because you did not login.