This is the cl-variates Reference Manual, version 0.9.0, generated automatically by Declt version 4.0 beta 2 "William Riker" on Mon Aug 15 04:07:23 2022 GMT+0.
Next: Modules, Previous: The cl-variates Reference Manual, Up: The cl-variates Reference Manual [Contents][Index]
The main system appears first, followed by any subsystem dependency.
Portable Common Lisp Random Number Generation.
Gary Warren King <gwking@metabang.com>
Gary King <gwking@metabang.com>
MIT Style License
0.9.0
Next: Files, Previous: Systems, Up: The cl-variates Reference Manual [Contents][Index]
Modules are listed depth-first from the system components tree.
Next: cl-variates/website, Previous: Modules, Up: Modules [Contents][Index]
cl-variates (system).
Next: cl-variates/website/source, Previous: cl-variates/dev, Up: Modules [Contents][Index]
cl-variates (system).
source (module).
Next: Packages, Previous: Modules, Up: The cl-variates Reference Manual [Contents][Index]
Files are sorted by type and then listed depth-first from the systems components trees.
Next: cl-variates/dev/package.lisp, Previous: Lisp, Up: Lisp [Contents][Index]
cl-variates (system).
Next: cl-variates/dev/variates.lisp, Previous: cl-variates/cl-variates.asd, Up: Lisp [Contents][Index]
dev (module).
Previous: cl-variates/dev/package.lisp, Up: Lisp [Contents][Index]
package.lisp (file).
dev (module).
Next: cl-variates/website/source/index.lml, Previous: Static, Up: Static [Contents][Index]
cl-variates (system).
Previous: cl-variates/COPYING, Up: Static [Contents][Index]
source (module).
Next: Definitions, Previous: Files, Up: The cl-variates Reference Manual [Contents][Index]
Packages are listed by definition order.
Next: cl-variates, Previous: Packages, Up: Packages [Contents][Index]
Previous: asdf-cl-variates, Up: Packages [Contents][Index]
The variates package provides portable random number generation as well as numerous distributions.
variates
common-lisp.
Next: Indexes, Previous: Packages, Up: The cl-variates Reference Manual [Contents][Index]
Definitions are sorted by export status, category, package, and then by lexicographic order.
Next: Internals, Previous: Definitions, Up: Definitions [Contents][Index]
Next: Ordinary functions, Previous: Public Interface, Up: Public Interface [Contents][Index]
The default probably used in calls to flip (and therefore in calls to binomial and geometric).
This variable takes the place of CL’s *random-state*. It can be supplied as a generator to all the functions in the variates package.
Next: Generic functions, Previous: Special variables, Up: Public Interface [Contents][Index]
Flip a coin (using flip) ‘n‘ times with probability ‘p‘ and return the number of heads.
Return a single element from the exponential distribution.
Flip a pseudo-random coin and return true if it comes up heads. The default probably of heads for the coin is *probability-of-heads*.
Returns a sample from the geometric distribution with probability ‘p‘. I.e., it returns the number of flips it takes until a possibly biased coin (using flip) comes up heads.
Returns a integer pseudo random number between low (inclusive) and high (inclusive).
Return a new random number generator of class ‘class’ using ‘seed’ as the initial seed.
Returns a normally distributed double-float pseudo random number with using ’mean’ and ’standard-deviation’.
Simple standin for Common Lisp random function. [[?? remove, just type more]]
Returns T with probability given. Defaults to 0.5d0.
Returns a element selected from sequence uniformly at random. Start and end can be supplied to select an element from a subsequence of sequence.
Returns a pseudo random number between low (inclusive) and high (exclusive or inclusive depending are arguments). If low and high are both integers (fixnums or bignums) this will return an integer, otherwise it will return a double-float.
Returns a pseudo random number between low and high (both inclusive). If low and high are both integers (fixnums or bignums) this will return an integer, otherwise it will return a double-float.
Returns a sub-sequence of ‘seq‘ with probability ‘pr‘ that each element of ‘seq‘ will be included. If a key function is supplied, then it is applied to each included element. [[?? Remove, use select-sample and/or sample-elements instead.]]
Returns a bit vector of size total-size with exactly sample-size
bits set to 1. The one bits are selected uniformly at random. The algorithm
is attributed to Robert Floyd by Jon Bentley in More Programming Pearls.
Returns a double-float pseudo random number between low (inclusive) and high (exclusive).
Next: Standalone methods, Previous: Ordinary functions, Up: Public Interface [Contents][Index]
Returns the next pseudo random number from a random number generator (using the generator as output stream metaphor).
automatically generated reader method
automatically generated reader method
Returns the original random seed of the generator.
automatically generated reader method
Sets the random seed of the generator. Two random generators with of the same class with the same seed will return the same sequence of random numbers.
Destructively rearrange the elements of a container by performing ’times’ swaps. If times is not specified, it will perform 2 times the container’s size swaps.
Next: Classes, Previous: Generic functions, Up: Public Interface [Contents][Index]
Previous: Standalone methods, Up: Public Interface [Contents][Index]
Root superclass for all random number generators.
Initarg | Value |
---|---|
:random-seed | 42 |
:random-seed
This slot is read-only.
From Numerical Recipes in C:
’Minimal’ random number generator of Park and Miller with Bayes-Durham
shuffle and added safeguards. Returns a uniform random deviate between 0.0 and
1.0 (exclusive of the endpoint values). It has a period of 2^31 - 1
(~ 2.1 x 10^9)
0.0d0
:internal-seed
This slot is read-only.
Mixing this class into another class will make it appear to be a random number generator. The new class can be used as a generator in the various random number routines, has a random seed and so on. The mixin also provides two initargs: random-seed and random-number-generator-class. The former is self-explanitory. The latter specifies which random number generator class to use.
Initarg | Value |
---|---|
:random-number-generator-class | (quote ran1-random-number-generator) |
:random-seed | 42 |
:random-number-generator
This slot is read-only.
:random-number-generator-class
This slot is read-only.
From Numerical Recipes in C:
This is a quick and dirty generator which ’is about as good as any 32-bit linear congruential generator. It is only about 1.7 times faster than ran1 because of the extra divide we need. It also conses about 1.7 times less. I believe it has the same period as ran1.
0.0d0
This slot is read-only.
Previous: Public Interface, Up: Definitions [Contents][Index]
Next: Generic functions, Previous: Internals, Up: Internals [Contents][Index]
Gets a single value sampled from the normal distribution with mean ‘mean’ and standard devation ‘standard-deviation.’ This uses the algorithm from Numerical Recipes in C.
Previous: Ordinary functions, Up: Internals [Contents][Index]
automatically generated reader method
am.
automatically generated reader method
automatically generated reader method
ia.
automatically generated reader method
im.
(Internal) (Re)initialize a random number generator. Called when the generator is created and when the seed is changed.
automatically generated reader method
automatically generated reader method
iq.
automatically generated reader method
ir.
automatically generated reader method
iv.
automatically generated reader method
iy.
automatically generated reader method
ndiv.
automatically generated reader method
ntab.
automatically generated reader method
rnmx.
Previous: Definitions, Up: The cl-variates Reference Manual [Contents][Index]
Jump to: | (
A B C E F G I M N P R S U |
---|
Jump to: | (
A B C E F G I M N P R S U |
---|
Next: Data types, Previous: Functions, Up: Indexes [Contents][Index]
Jump to: | *
A C I N R S |
---|
Jump to: | *
A C I N R S |
---|
Jump to: | A B C D F I M P R S V W |
---|
Jump to: | A B C D F I M P R S V W |
---|