Class ZigguratSampler.Exponential

    • Method Detail

      • sample

        public double sample()
        Creates a double sample.
        Returns:
        a sample.
      • withUniformRandomProvider

        public ZigguratSampler.Exponential withUniformRandomProvider​(org.apache.commons.rng.UniformRandomProvider rng)
        Create a new instance of the sampler with the same underlying state using the given uniform random provider as the source of randomness.
        Parameters:
        rng - Generator of uniformly distributed random numbers.
        Returns:
        the sampler
      • of

        public static ZigguratSampler.Exponential of​(org.apache.commons.rng.UniformRandomProvider rng)
        Create a new exponential sampler with mean = 1.
        Parameters:
        rng - Generator of uniformly distributed random numbers.
        Returns:
        the sampler
      • of

        public static ZigguratSampler.Exponential of​(org.apache.commons.rng.UniformRandomProvider rng,
                                                     double mean)
        Create a new exponential sampler with the specified mean.
        Parameters:
        rng - Generator of uniformly distributed random numbers.
        mean - Mean.
        Returns:
        the sampler
        Throws:
        IllegalArgumentException - if the mean is not strictly positive (mean <= 0)