package randii
A pure OCaml port of the Random123 counter based random number generator from DEShaw Research
Install
Dune Dependency
Authors
Maintainers
Sources
1.0.0.tar.gz
md5=1f8f3a98495497cece0131f11c0297e7
sha512=4377b604e5debe94ba98e980ffdbb92e936306460b7db65eee2d1d5493f0abc12f54982527d49351b8461e3208ac158aed79a932575872956e849a432d058e85
doc/src/randii.cbrn/types.ml.html
Source file types.ml
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87
type digits_two type digits_four type word_32 type word_64 (* factor out dependence on UInt32 / UInt64 and word size (32/64 bit) *) module type NUM = sig type digits type word type ('digits, 'word) t (* ctors *) val of_int : int -> (digits, word) t val of_string : string -> (digits, word) t (* dtors *) val to_int : ('digits, 'word) t -> int val to_string : ('digits, 'word) t -> string (* consts *) val zero : (digits, word) t val one : (digits, word) t val max_int : (digits, word) t val skein_ks_parity : (digits, word) t val rotations_0 : (digits, word) t Rotations.t val rotations_1 : (digits, word) t Rotations.t val digits : int (* ops *) val equal : ('digits, 'word) t -> ('digits, 'word) t -> bool val succ : ('digits, 'word) t -> ('digits, 'word) t val pred : ('digits, 'word) t -> ('digits, 'word) t val add : ('digits, 'word) t -> ('digits, 'word) t -> ('digits, 'word) t val sub : ('digits, 'word) t -> ('digits, 'word) t -> ('digits, 'word) t val rem : ('digits, 'word) t -> ('digits, 'word) t -> ('digits, 'word) t val logxor : ('digits, 'word) t -> ('digits, 'word) t -> ('digits, 'word) t val rotL : ('digits, 'word) t -> ('digits, 'word) t -> ('digits, 'word) t end (* NOTE also that this implementation swaps around the args key/ctr as compared to the original C implementation *) module type RNG_MAKER = sig type digits (* sentinal type to allow for constraints *) module Make : functor (Num:NUM) -> sig val rand_R : of_int:(int -> (Num.digits, Num.word) Num.t) -> rounds:int -> key:(Num.digits, Num.word) Num.t array -> ctr:(Num.digits, Num.word) Num.t array -> (Num.digits, Num.word) Num.t array end end type kind = Rand | Uniform01 | Uniform of int module type GEN = sig type t val of_int_array : int array -> t val to_int_array : t -> int array val of_string_array : string array -> t val to_string_array : t -> string array val succ : t -> t val pred : t -> t val rand : ?rounds:int -> key:t -> ctr:t -> unit -> t val uniform : ?upper:int -> ?rounds:int -> key:t -> ctr:t -> unit -> int array val uniform01 : ?rounds:int -> key:t -> ctr:t -> unit -> float array val draw_from : rand:(?rounds:int -> key:t -> ctr:t -> unit -> t) -> uniform01:(?rounds:int -> key:t -> ctr:t -> unit -> float array) -> uniform:(?upper:int -> ?rounds:int -> key:t -> ctr:t -> unit -> int array) -> key:t -> ctr:t -> kind -> string array val digits : int val is_zero : t -> bool end
sectionYPositions = computeSectionYPositions($el), 10)"
x-init="setTimeout(() => sectionYPositions = computeSectionYPositions($el), 10)"
>