[#absl-discrete_distribution-2constructor-02] = xref:absl.adoc[absl]::xref:absl/discrete_distribution.adoc[discrete_distribution]::discrete_distribution :relfileprefix: ../../ :mrdocs: Constructs a distribution by sampling a weight function. == Synopsis Declared in `<absl/random/discrete_distribution.h>` [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- template<class UnaryOperation> explicit discrete_distribution( size_t nw, double xmin, double xmax, UnaryOperation fw); ---- == Parameters [cols="1,4"] |=== | Name| Description | *nw* | The number of weights to generate. | *xmin* | The lower bound of the sampled interval. | *xmax* | The upper bound of the sampled interval. | *fw* | The unary weight function to sample. |=== [.small]#Created with https://www.mrdocs.com[MrDocs]#