random-fu-0.2.7.0: Random number generation

Safe HaskellNone
LanguageHaskell98

Data.Random.Distribution.Uniform

Synopsis

Documentation

data Uniform t #

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.

Instances

CDF Uniform Bool # 

Methods

cdf :: Uniform Bool -> Bool -> Double #

CDF Uniform Char # 

Methods

cdf :: Uniform Char -> Char -> Double #

CDF Uniform Double # 

Methods

cdf :: Uniform Double -> Double -> Double #

CDF Uniform Float # 

Methods

cdf :: Uniform Float -> Float -> Double #

CDF Uniform Int # 

Methods

cdf :: Uniform Int -> Int -> Double #

CDF Uniform Int8 # 

Methods

cdf :: Uniform Int8 -> Int8 -> Double #

CDF Uniform Int16 # 

Methods

cdf :: Uniform Int16 -> Int16 -> Double #

CDF Uniform Int32 # 

Methods

cdf :: Uniform Int32 -> Int32 -> Double #

CDF Uniform Int64 # 

Methods

cdf :: Uniform Int64 -> Int64 -> Double #

CDF Uniform Integer # 

Methods

cdf :: Uniform Integer -> Integer -> Double #

CDF Uniform Ordering # 
CDF Uniform Word # 

Methods

cdf :: Uniform Word -> Word -> Double #

CDF Uniform Word8 # 

Methods

cdf :: Uniform Word8 -> Word8 -> Double #

CDF Uniform Word16 # 

Methods

cdf :: Uniform Word16 -> Word16 -> Double #

CDF Uniform Word32 # 

Methods

cdf :: Uniform Word32 -> Word32 -> Double #

CDF Uniform Word64 # 

Methods

cdf :: Uniform Word64 -> Word64 -> Double #

CDF Uniform () # 

Methods

cdf :: Uniform () -> () -> Double #

Distribution Uniform Bool # 
Distribution Uniform Char # 
Distribution Uniform Double # 
Distribution Uniform Float # 
Distribution Uniform Int # 

Methods

rvar :: Uniform Int -> RVar Int #

rvarT :: Uniform Int -> RVarT n Int #

Distribution Uniform Int8 # 
Distribution Uniform Int16 # 
Distribution Uniform Int32 # 
Distribution Uniform Int64 # 
Distribution Uniform Integer # 
Distribution Uniform Ordering # 
Distribution Uniform Word # 
Distribution Uniform Word8 # 
Distribution Uniform Word16 # 
Distribution Uniform Word32 # 
Distribution Uniform Word64 # 
Distribution Uniform () # 

Methods

rvar :: Uniform () -> RVar () #

rvarT :: Uniform () -> RVarT n () #

HasResolution r => CDF Uniform (Fixed r) # 

Methods

cdf :: Uniform (Fixed r) -> Fixed r -> Double #

HasResolution r => Distribution Uniform (Fixed r) # 

Methods

rvar :: Uniform (Fixed r) -> RVar (Fixed r) #

rvarT :: Uniform (Fixed r) -> RVarT n (Fixed r) #

uniform :: Distribution Uniform a => a -> a -> RVar a #

uniformT :: Distribution Uniform a => a -> a -> RVarT m a #

data StdUniform t #

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 

Instances

CDF StdUniform Bool # 

Methods

cdf :: StdUniform Bool -> Bool -> Double #

CDF StdUniform Char # 

Methods

cdf :: StdUniform Char -> Char -> Double #

CDF StdUniform Double # 
CDF StdUniform Float # 

Methods

cdf :: StdUniform Float -> Float -> Double #

CDF StdUniform Int # 

Methods

cdf :: StdUniform Int -> Int -> Double #

CDF StdUniform Int8 # 

Methods

cdf :: StdUniform Int8 -> Int8 -> Double #

CDF StdUniform Int16 # 

Methods

cdf :: StdUniform Int16 -> Int16 -> Double #

CDF StdUniform Int32 # 

Methods

cdf :: StdUniform Int32 -> Int32 -> Double #

CDF StdUniform Int64 # 

Methods

cdf :: StdUniform Int64 -> Int64 -> Double #

CDF StdUniform Ordering # 
CDF StdUniform Word # 

Methods

cdf :: StdUniform Word -> Word -> Double #

CDF StdUniform Word8 # 

Methods

cdf :: StdUniform Word8 -> Word8 -> Double #

CDF StdUniform Word16 # 
CDF StdUniform Word32 # 
CDF StdUniform Word64 # 
CDF StdUniform () # 

Methods

cdf :: StdUniform () -> () -> Double #

PDF StdUniform Double # 
PDF StdUniform Float # 
Distribution StdUniform Bool # 
Distribution StdUniform Char # 
Distribution StdUniform Double # 
Distribution StdUniform Float # 
Distribution StdUniform Int # 
Distribution StdUniform Int8 # 
Distribution StdUniform Int16 # 
Distribution StdUniform Int32 # 
Distribution StdUniform Int64 # 
Distribution StdUniform Ordering # 
Distribution StdUniform Word # 
Distribution StdUniform Word8 # 
Distribution StdUniform Word16 # 
Distribution StdUniform Word32 # 
Distribution StdUniform Word64 # 
Distribution StdUniform () # 

Methods

rvar :: StdUniform () -> RVar () #

rvarT :: StdUniform () -> RVarT n () #

HasResolution r => CDF StdUniform (Fixed r) # 

Methods

cdf :: StdUniform (Fixed r) -> Fixed r -> Double #

HasResolution r => Distribution StdUniform (Fixed r) # 

Methods

rvar :: StdUniform (Fixed r) -> RVar (Fixed r) #

rvarT :: StdUniform (Fixed r) -> RVarT n (Fixed r) #

stdUniform :: Distribution StdUniform a => RVar a #

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

stdUniformT :: Distribution StdUniform a => RVarT m a #

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

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

Like stdUniform but only returns positive values.

stdUniformPosT :: (Distribution StdUniform a, Num a, Eq a) => RVarT m a #

Like stdUniform but only returns positive values.

integralUniform :: Integral a => a -> a -> RVarT m a #

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

realFloatUniform :: RealFloat a => a -> a -> RVarT m a #

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

floatUniform :: Float -> Float -> RVarT m Float #

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

doubleUniform :: Double -> Double -> RVarT m Double #

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

fixedUniform :: HasResolution r => Fixed r -> Fixed r -> RVarT m (Fixed r) #

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

enumUniform :: Enum a => a -> a -> RVarT m a #

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

boundedStdUniform :: (Distribution Uniform a, Bounded a) => RVar a #

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) => RVarT m a #

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

realFloatStdUniform :: RealFloat a => RVarT m a #

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

fixedStdUniform :: HasResolution r => RVarT m (Fixed r) #

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

floatStdUniform :: RVarT m Float #

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

doubleStdUniform :: RVarT m Double #

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

realStdUniformCDF :: Real a => a -> Double #

The CDF of the random variable realFloatStdUniform.

realUniformCDF :: RealFrac a => a -> a -> a -> Double #

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

enumUniformCDF :: (Enum a, Ord a) => a -> a -> a -> Double #