Handbook
Glossary
random* ( obj rnd -- elt )
Vocabulary
random
Inputs
obj
an
object
rnd
a random number generator
Outputs
elt
a random element
Word description
Outputs a random element of the input object, or outputs
f
if the object contains no elements.
See also
random
,
randoms
,
randoms-as
Definition
IN:
random
GENERIC#:
random*
1
( obj rnd -- elt )
Methods
USING:
assocs
kernel
random
;
M:
assoc
random*
[
>alist
]
dip
random*
;
USING:
accessors
kernel
random
;
M:
bernoulli-distribution
random*
[
p>>
]
dip
bernoulli-random*
;
USING:
accessors
kernel
random
;
M:
beta-distribution
random*
[
[
alpha>>
]
[
beta>>
]
bi
]
dip
beta-random*
;
USING:
math
random
random.private
;
M:
bignum
random*
random-integer
;
USING:
accessors
kernel
random
;
M:
binomial-distribution
random*
[
[
n>>
]
[
p>>
]
bi
]
dip
binomial-random*
;
USING:
accessors
kernel
random
;
M:
cauchy-distribution
random*
[
[
median>>
]
[
scale>>
]
bi
]
dip
cauchy-random*
;
USING:
accessors
kernel
random
;
M:
chi-square-distribution
random*
[
dof>>
]
dip
chi-square-random*
;
USING:
accessors
kernel
random
;
M:
exponential-distribution
random*
[
lambda>>
]
dip
exponential-random*
;
USING:
accessors
kernel
random
;
M:
f-distribution
random*
[
[
dof-num>>
]
[
dof-den>>
]
bi
]
dip
f-random*
;
USING:
math
random
random.private
;
M:
fixnum
random*
random-integer
;
USING:
kernel
math
random
;
M:
float
random*
[
f
]
swap
[
[
0.0
]
]
dip
[
uniform-random*
]
curry
compose
if-zero
;
inline
USING:
accessors
kernel
random
;
M:
gamma-distribution
random*
[
[
alpha>>
]
[
beta>>
]
bi
]
dip
gamma-random*
;
USING:
accessors
kernel
random
;
M:
geometric-distribution
random*
[
p>>
]
dip
geometric-random*
;
USING:
accessors
kernel
random
;
M:
gumbel-distribution
random*
[
[
loc>>
]
[
scale>>
]
bi
]
dip
gumbel-random*
;
USING:
accessors
hash-sets
hashtables.private
kernel
math
random
sequences.private
sets
;
M:
hash-set
random*
[
dup
cardinality
[
drop
f
]
]
dip
[
random*
]
curry
[
[
[
0
]
[
array>>
]
]
]
dip
[
tri*
1
+
[
[
2dup
array-nth
tombstone?
[
1
+
]
2dip
]
loop
]
times
[
1
-
]
dip
array-nth
]
curry
compose
if-zero
;
USING:
accessors
arrays
assocs
hashtables
hashtables.private
kernel
math
random
sequences.private
;
M:
hashtable
random*
[
dup
assoc-size
[
drop
f
]
]
dip
[
random*
]
curry
[
[
[
0
]
[
array>>
]
]
]
dip
[
tri*
1
+
[
[
2dup
array-nth
tombstone?
[
2
+
]
2dip
]
loop
]
times
[
2
-
]
dip
[
array-nth
]
[
[
1
+
]
dip
array-nth
]
2bi
2array
]
curry
compose
if-zero
;
USING:
accessors
kernel
random
;
M:
inv-gamma-distribution
random*
[
[
shape>>
]
[
scale>>
]
bi
]
dip
inv-gamma-random*
;
USING:
accessors
kernel
random
;
M:
laplace-distribution
random*
[
[
mean>>
]
[
scale>>
]
bi
]
dip
laplace-random*
;
USING:
accessors
kernel
random
;
M:
logistic-distribution
random*
[
[
loc>>
]
[
scale>>
]
bi
]
dip
logistic-random*
;
USING:
generic
math.functions
random
;
M:
lognormal-distribution
random*
M\
lognormal-distribution
random*
(call-next-method)
e^
;
USING:
accessors
kernel
random
;
M:
logseries-distribution
random*
[
p>>
]
dip
logseries-random*
;
USING:
accessors
kernel
random
;
M:
normal-distribution
random*
[
[
mean>>
]
[
sigma>>
]
bi
]
dip
normal-random*
;
USING:
accessors
kernel
random
;
M:
pareto-distribution
random*
[
[
k>>
]
[
alpha>>
]
bi
]
dip
pareto-random*
;
USING:
accessors
kernel
random
;
M:
poisson-distribution
random*
[
mean>>
]
dip
poisson-random*
;
USING:
accessors
kernel
random
;
M:
power-distribution
random*
[
alpha>>
]
dip
power-random*
;
USING:
accessors
kernel
random
;
M:
rayleigh-distribution
random*
[
mode>>
]
dip
rayleigh-random*
;
USING:
kernel
random
sequences
;
M:
sequence
random*
[
f
]
swap
[
[
length
]
]
dip
[
random*
]
curry
compose
[
keep
nth
]
curry
if-empty
;
USING:
kernel
random
sets
;
M:
set
random*
[
members
]
dip
random*
;
USING:
accessors
kernel
random
;
M:
student-t-distribution
random*
[
dof>>
]
dip
student-t-random*
;
USING:
accessors
kernel
random
;
M:
triangular-distribution
random*
[
[
low>>
]
[
high>>
]
bi
]
dip
triangular-random*
;
USING:
accessors
kernel
random
;
M:
uniform-distribution
random*
[
[
min>>
]
[
max>>
]
bi
]
dip
uniform-random*
;
USING:
accessors
kernel
random
;
M:
von-mises-distribution
random*
[
[
mu>>
]
[
kappa>>
]
bi
]
dip
von-mises-random*
;
USING:
accessors
kernel
kernel.private
math
math.extras
random
sequences.private
;
M::
vose
random*
( obj rnd -- elt )
obj
n>>
rnd
random*
{
fixnum
}
declare
dup
obj
probs>>
nth-unsafe
{
float
}
declare
rnd
random-unit*
>=
[
obj
alias>>
nth-unsafe
{
fixnum
}
declare
]
unless
obj
items>>
nth-unsafe
;
USING:
accessors
kernel
random
;
M:
wald-distribution
random*
[
[
mean>>
]
[
scale>>
]
bi
]
dip
wald-random*
;
USING:
accessors
kernel
random
;
M:
weibull-distribution
random*
[
[
alpha>>
]
[
beta>>
]
bi
]
dip
weibull-random*
;
USING:
accessors
kernel
random
;
M:
zipf-distribution
random*
[
a>>
]
dip
zipf-random*
;