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:
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.