random-fu-0.0.3.2: Random number generation

Data.Random.Distribution.Uniform

Synopsis

# Documentation

data Uniform t Source

A definition of a uniform distribution over the type `t`. See also `uniform`.

Constructors

 Uniform !t !t A uniform distribution defined by a lower and upper range bound. For `Integral` and `Enum` types, the range is inclusive. For `Fractional` types the range includes the lower bound but not the upper.

data StdUniform t Source

A name for the "standard" uniform distribution over the type `t`, if one exists. See also `stdUniform`.

For `Integral` and `Enum` types that are also `Bounded`, this is the uniform distribution over the full range of the type. For un-`Bounded` `Integral` types this is not defined. For `Fractional` types this is a random variable in the range [0,1) (that is, 0 to 1 including 0 but not including 1).

Constructors

 StdUniform

Get a "standard" uniformly distributed value. For integral types, this means uniformly distributed over the full range of the type (and hence there is no support for Integer). For fractional types, this means uniformly distributed on the interval [0,1).

Like `stdUniform`, but uses `abs` to return only positive or zero values.

stdUniformPos :: (Distribution StdUniform a, Num a) => RVar aSource

Like `stdUniform` but only returns positive values.

integralUniform :: Integral a => a -> a -> RVar aSource

Compute a random `Integral` value between the 2 values provided (inclusive).

realFloatUniform :: RealFloat a => a -> a -> RVar aSource

`realFloatUniform a b` computes a uniform random value in the range [a,b) for any `RealFloat` type

`floatUniform a b` computes a uniform random `Float` value in the range [a,b)

`doubleUniform a b` computes a uniform random `Double` value in the range [a,b)

fixedUniform :: HasResolution r => Fixed r -> Fixed r -> RVar (Fixed r)Source

`fixedUniform a b` computes a uniform random `Fixed` value in the range [a,b), with any desired precision.

Compute a random value for a `Bounded` type, between `minBound` and `maxBound` (inclusive for `Integral` or `Enum` types, in [`minBound`, `maxBound`) for Fractional types.)

boundedEnumStdUniform :: (Enum a, Bounded a) => RVar aSource

Compute a random value for a `Bounded` `Enum` type, between `minBound` and `maxBound` (inclusive)

Compute a uniform random value in the range [0,1) for any `RealFloat` type

Compute a uniform random `Fixed` value in the range [0,1), with any desired precision.

Compute a uniform random `Float` value in the range [0,1)

Compute a uniform random `Double` value in the range [0,1)

realStdUniformCDF :: Real a => a -> DoubleSource

The CDF of the random variable `realFloatStdUniform`.

realUniformCDF :: RealFrac a => a -> a -> a -> DoubleSource

`realUniformCDF a b` is the CDF of the random variable `realFloatUniform a b`.