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

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:


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: