Safe Haskell | Safe-Inferred |
---|---|
Language | Haskell2010 |
Synopsis
- data Uniform t = Uniform !t !t
- uniform :: Distribution Uniform a => a -> a -> RVar a
- uniformT :: Distribution Uniform a => a -> a -> RVarT m a
- data StdUniform t = StdUniform
- stdUniform :: Distribution StdUniform a => RVar a
- stdUniformT :: Distribution StdUniform a => RVarT m a
- stdUniformPos :: (Distribution StdUniform a, Num a, Eq a) => RVar a
- stdUniformPosT :: (Distribution StdUniform a, Num a, Eq a) => RVarT m a
- integralUniform :: UniformRange a => a -> a -> RVarT m a
- realFloatUniform :: RealFloat a => a -> a -> RVarT m a
- floatUniform :: Float -> Float -> RVarT m Float
- doubleUniform :: Double -> Double -> RVarT m Double
- fixedUniform :: HasResolution r => Fixed r -> Fixed r -> RVarT m (Fixed r)
- enumUniform :: Enum a => a -> a -> RVarT m a
- boundedStdUniform :: (Distribution Uniform a, Bounded a) => RVar a
- boundedEnumStdUniform :: (Enum a, Bounded a) => RVarT m a
- realFloatStdUniform :: RealFloat a => RVarT m a
- fixedStdUniform :: HasResolution r => RVarT m (Fixed r)
- floatStdUniform :: RVarT m Float
- doubleStdUniform :: RVarT m Double
- boundedStdUniformCDF :: (CDF Uniform a, Bounded a) => a -> Double
- realStdUniformCDF :: Real a => a -> Double
- realUniformCDF :: RealFrac a => a -> a -> a -> Double
- enumUniformCDF :: (Enum a, Ord a) => a -> a -> a -> Double
Documentation
A definition of a uniform distribution over the type t
. See also uniform
.
Uniform !t !t | A uniform distribution defined by a lower and upper range bound.
For |
Instances
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).
Instances
stdUniform :: Distribution StdUniform a => RVar a Source #
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 Source #
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 Source #
Like stdUniform
but only returns positive values.
stdUniformPosT :: (Distribution StdUniform a, Num a, Eq a) => RVarT m a Source #
Like stdUniform
but only returns positive values.
integralUniform :: UniformRange a => a -> a -> RVarT m a Source #
Compute a random Integral
value between the 2 values provided (inclusive).
realFloatUniform :: RealFloat a => a -> a -> RVarT m a Source #
realFloatUniform a b
computes a uniform random value in the range [a,b) for
any RealFloat
type
floatUniform :: Float -> Float -> RVarT m Float Source #
floatUniform a b
computes a uniform random Float
value in the range [a,b)
doubleUniform :: Double -> Double -> RVarT m Double Source #
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) Source #
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 Source #
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 Source #
realFloatStdUniform :: RealFloat a => RVarT m a Source #
Compute a uniform random value in the range [0,1) for any RealFloat
type
fixedStdUniform :: HasResolution r => RVarT m (Fixed r) Source #
Compute a uniform random Fixed
value in the range [0,1), with any
desired precision.
realStdUniformCDF :: Real a => a -> Double Source #
The CDF of the random variable realFloatStdUniform
.
realUniformCDF :: RealFrac a => a -> a -> a -> Double Source #
realUniformCDF a b
is the CDF of the random variable realFloatUniform a b
.