Class RealUniform

java.lang.Object
org.flag4j.rng.distributions.Distribution<Double,Random>
org.flag4j.rng.distributions.RealUniform

public class RealUniform extends Distribution<Double,Random>
A uniform real distribution.
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    final double
    Upper bound of the uniform distribution (exclusive).
    final double
    Lower bound of the uniform distribution (inclusive).

    Fields inherited from class org.flag4j.rng.distributions.Distribution

    rng
  • Constructor Summary

    Constructors
    Constructor
    Description
    RealUniform(RandomComplex rng, double min, double max)
    Constructs a real uniform distribution.
  • Method Summary

    Modifier and Type
    Method
    Description
    Randomly samples this uniform distribution.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Field Details

    • min

      public final double min
      Lower bound of the uniform distribution (inclusive).
    • max

      public final double max
      Upper bound of the uniform distribution (exclusive).
  • Constructor Details

    • RealUniform

      public RealUniform(RandomComplex rng, double min, double max)
      Constructs a real uniform distribution.
      Parameters:
      rng - Pseudorandom number generator to use when randomly sampling from this distribution.
      min - Lower bound of the uniform distribution (inclusive).
      max - Upper bound of the uniform distribution (exclusive).
  • Method Details

    • sample

      public Double sample()
      Randomly samples this uniform distribution.
      Specified by:
      sample in class Distribution<Double,Random>
      Returns:
      A pseudorandomrandom value distributed according to a uniform distribution between min (inclusive) and max (exclusive).