Sampler.SS is the module type of a module allowing to construct samplers based on the alias method.
create measure constructs auxilliary data to sample from measure after normalization. Complexity: O(n).
It is assumed that the measure is positive. measure can contain zero mass elements: those are removed in a pre-processing step. The total mass of the measure should be strictly positive.
sample auxdata rand creates a sampler from auxdata that follows the distribution associated to the measure specified when creating the auxdata. The parameter rand is a random sampler for the two random values used by the sampling method. The first bound is at most the length of the list passed to create when creating auxdata. The second bound is at most the sum of all items in the list passed to create.
val encoding :
'a Mavryk_protocol_environment_alpha.Data_encoding.t ->
'a t Mavryk_protocol_environment_alpha.Data_encoding.tencoding e constructs an encoding for 'a t given an encoding for 'a.