Liking cljdoc? Tell your friends :D

tupelo.iuid.prng


derandomizeclj

(derandomize ctx prng-val)

Inputs: [ctx :- tsk/KeyMap prng-val :- s/Int] Returns: BigInteger

Given a 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 a PRNG context, reverts an N-bit 'randomized' integer to the original N-bit index.
sourceraw docstring

gen-slopeclj

(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
sourceraw docstring

new-ctxclj

(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)
      } 
sourceraw docstring

randomizeclj

(randomize ctx idx)

Inputs: [ctx :- tsk/KeyMap idx :- s/Int] Returns: BigInteger

Given a PRNG context, converts an N-bit index to a unique N-bit 'randomized' value.

Inputs: [ctx :- tsk/KeyMap idx :- s/Int]
Returns: BigInteger

Given a PRNG context, converts an N-bit index to a unique N-bit 'randomized' value.
sourceraw docstring

cljdoc is a website building & hosting documentation for Clojure/Script libraries

× close