Function smartnoise_runtime::utilities::noise::sample_geometric_censored [−][src]
pub fn sample_geometric_censored(
prob: f64,
max_trials: i64,
enforce_constant_time: bool
) -> Result<i64>
Sample from the censored geometric distribution with parameter “prob” and maximum number of trials “max_trials”.
Arguments
prob
- Parameter for the geometric distribution, the probability of success on any given trials.max_trials
- The maximum number of trials allowed.enforce_constant_time
- Whether or not to enforce the algorithm to run in constant time; if true, it will always run for “max_trials” trials.
Return
A draw from the censored geometric distribution.
Example
use smartnoise_runtime::utilities::noise::sample_geometric_censored; let geom = sample_geometric_censored(0.1, 20, false);