(derandomize ctx prng-val)
Inputs: [ctx :- tsk/KeyMap prng-val :- s/Int] Returns: BigInteger
Given an PRNG context, reverts an N-bit 'randomized' integer to the original N-bit index.
Inputs: [ctx :- tsk/KeyMap prng-val :- s/Int] Returns: BigInteger Given an PRNG context, reverts an N-bit 'randomized' integer to the original N-bit index.
(gen-slope nbits random-gen)
Inputs: [nbits :- s/Int random-gen :- Random] Returns: BigInteger
Generate a positive, odd slope value
Inputs: [nbits :- s/Int random-gen :- Random] Returns: BigInteger Generate a positive, odd slope value
(int->bitchars ival bits-width)
Inputs: [ival :- s/Int bits-width :- s/Int] Returns: tsk/Vec
Inputs: [ival :- s/Int bits-width :- s/Int] Returns: tsk/Vec
(int->bitstr ival bits-width)
Inputs: [ival :- s/Int bits-width :- s/Int] Returns: s/Str
Inputs: [ival :- s/Int bits-width :- s/Int] Returns: s/Str
(iterate-n N f x)
Inputs: [N :- s/Int f :- tsk/Fn x :- s/Any] Returns: s/Any
Calls (iterate f x)
n times, returning that result (indexed from 0); i.e.
n=0 => x
n=1 => (f x)
n=2 => (f (f x))
Inputs: [N :- s/Int f :- tsk/Fn x :- s/Any] Returns: s/Any Calls `(iterate f x)` n times, returning that result (indexed from 0); i.e. n=0 => x n=1 => (f x) n=2 => (f (f x))
(new-ctx opts)
Inputs: [opts :- tsk/KeyMap] Returns: tsk/KeyMap
Creates a new PRNG context map. Usage:
(new-ctx <params-map>)
where <params-map> is of the form:
{:num-bits <long> ; REQUIRED: (minimum: 4): input/output integers in [0..2^n)
:rand-seed <long> ; optional: PRNG seed (default: randomized)
:num-rounds <long> ; optional: positive int (default: 3)
}
Inputs: [opts :- tsk/KeyMap] Returns: tsk/KeyMap Creates a new PRNG context map. Usage: (new-ctx <params-map>) where <params-map> is of the form: {:num-bits <long> ; REQUIRED: (minimum: 4): input/output integers in [0..2^n) :rand-seed <long> ; optional: PRNG seed (default: randomized) :num-rounds <long> ; optional: positive int (default: 3) }
(randomize ctx idx)
Inputs: [ctx :- tsk/KeyMap idx :- s/Int] Returns: BigInteger
Given an PRNG context, converts an N-bit index to a unique N-bit 'randomized' value.
Inputs: [ctx :- tsk/KeyMap idx :- s/Int] Returns: BigInteger Given an PRNG context, converts an N-bit index to a unique N-bit 'randomized' value.
cljdoc is a website building & hosting documentation for Clojure/Script libraries
× close