module Alea
Overview
Alea is a library for generating pseudo-random samples from most known probability distributions,
written in pure Crystal.
Algorithms in this library are heavily derived from NumPy and Julia lang. Disclaimer in LICENSE file.
Defined in:
alea.cralea/core/cerr.cr
alea/prob/cdf.cr
alea/rand/random.cr
alea/rand/rbeta.cr
alea/rand/rchisq.cr
alea/rand/rexp.cr
alea/rand/rfloat.cr
alea/rand/rgamma.cr
alea/rand/rgen/prng.cr
alea/rand/rgen/xsr.cr
alea/rand/rint.cr
alea/rand/rlaplace.cr
alea/rand/rlognor.cr
alea/rand/rnorm.cr
alea/rand/rpoiss.cr
Constant Summary
-
VERSION =
"0.3.0"
Macro Summary
-
param_check(x, op, y, param, caller)
Compile-time expansion for dist.
-
sanity_check(x, param, caller)
Compile-time expansion for sanity (NaN/Infinity) checks over arguments.
Macro Detail
macro param_check(x, op, y, param, caller)
#
Compile-time expansion for dist. definition checks over arguments.
@parameters:
{{x}}: parameter to check through{{op}}with{{y}}.{{op}}: operator that performs the comparison.{{y}}: parameter to check through{{op}}with{{x}}.{{param}}: name of the parameter to display in exception messages.{{caller}}: name of the method to display in exception messages.
@exceptions:
Alea::UndefinedErrorif{{x}}{{op}}{{y}}returnstrue.
macro sanity_check(x, param, caller)
#
Compile-time expansion for sanity (NaN/Infinity) checks over arguments.
@parameters:
{{x}}: parameter to check.{{param}}: name of the parameter to display in exception messages.{{caller}}: name of the method to display in exception messages.
@exceptions:
Alea::NaNErrorif{{x}}isNaN.Alea::InfinityErrorif{{x}}isInfinity.