[#absl-discrete_distribution-2constructor-02]
= xref:absl.adoc[absl]::xref:absl/discrete_distribution.adoc[discrete&lowbar;distribution]::discrete&lowbar;distribution
:relfileprefix: ../../
:mrdocs:

Constructs a distribution by sampling a weight function&period;

== Synopsis

Declared in `&lt;absl&sol;random&sol;discrete&lowbar;distribution&period;h&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
template&lt;class UnaryOperation&gt;
explicit
discrete&lowbar;distribution(
    size&lowbar;t nw,
    double xmin,
    double xmax,
    UnaryOperation fw);
----

== Parameters

[cols="1,4"]
|===
| Name| Description
| *nw*
| The number of weights to generate&period;
| *xmin*
| The lower bound of the sampled interval&period;
| *xmax*
| The upper bound of the sampled interval&period;
| *fw*
| The unary weight function to sample&period;
|===


[.small]#Created with https://www.mrdocs.com[MrDocs]#
