rgsl/randist/hypergeometric.rs
1//
2// A rust binding for the GSL library by Guillaume Gomez (guillaume1.gomez@gmail.com)
3//
4
5/// This function computes the probability p(k) of obtaining k from a hypergeometric distribution with parameters n1, n2, t, using the formula given above.
6#[doc(alias = "gsl_ran_hypergeometric_pdf")]
7pub fn hypergeometric_pdf(k: u32, n1: u32, n2: u32, t: u32) -> f64 {
8 unsafe { sys::gsl_ran_hypergeometric_pdf(k, n1, n2, t) }
9}
10
11/// This function computes the cumulative distribution functions P(k), Q(k) for the hypergeometric distribution with parameters n1, n2 and t.
12#[doc(alias = "gsl_cdf_hypergeometric_P")]
13pub fn hypergeometric_P(k: u32, n1: u32, n2: u32, t: u32) -> f64 {
14 unsafe { sys::gsl_cdf_hypergeometric_P(k, n1, n2, t) }
15}
16
17/// This function computes the cumulative distribution functions P(k), Q(k) for the hypergeometric distribution with parameters n1, n2 and t.
18#[doc(alias = "gsl_cdf_hypergeometric_Q")]
19pub fn hypergeometric_Q(k: u32, n1: u32, n2: u32, t: u32) -> f64 {
20 unsafe { sys::gsl_cdf_hypergeometric_Q(k, n1, n2, t) }
21}