rgsl/randist/
gumbel.rs

1//
2// A rust binding for the GSL library by Guillaume Gomez (guillaume1.gomez@gmail.com)
3//
4
5pub mod type_1 {
6    /// This function computes the probability density p(x) at x for a Type-1 Gumbel distribution with parameters a and b, using the formula given above.
7    #[doc(alias = "gsl_ran_gumbel1_pdf")]
8    pub fn gumbel1_pdf(x: f64, a: f64, b: f64) -> f64 {
9        unsafe { sys::gsl_ran_gumbel1_pdf(x, a, b) }
10    }
11
12    /// This function computes the cumulative distribution functions P(x), Q(x) and their inverses for the Type-1 Gumbel distribution with parameters a and b.
13    #[doc(alias = "gsl_cdf_gumbel1_P")]
14    pub fn gumbel1_P(x: f64, a: f64, b: f64) -> f64 {
15        unsafe { sys::gsl_cdf_gumbel1_P(x, a, b) }
16    }
17
18    /// This function computes the cumulative distribution functions P(x), Q(x) and their inverses for the Type-1 Gumbel distribution with parameters a and b.
19    #[doc(alias = "gsl_cdf_gumbel1_Q")]
20    pub fn gumbel1_Q(x: f64, a: f64, b: f64) -> f64 {
21        unsafe { sys::gsl_cdf_gumbel1_Q(x, a, b) }
22    }
23
24    /// This function computes the cumulative distribution functions P(x), Q(x) and their inverses for the Type-1 Gumbel distribution with parameters a and b.
25    #[doc(alias = "gsl_cdf_gumbel1_Pinv")]
26    pub fn gumbel1_Pinv(P: f64, a: f64, b: f64) -> f64 {
27        unsafe { sys::gsl_cdf_gumbel1_Pinv(P, a, b) }
28    }
29
30    /// This function computes the cumulative distribution functions P(x), Q(x) and their inverses for the Type-1 Gumbel distribution with parameters a and b.
31    #[doc(alias = "gsl_cdf_gumbel1_Qinv")]
32    pub fn gumbel1_Qinv(Q: f64, a: f64, b: f64) -> f64 {
33        unsafe { sys::gsl_cdf_gumbel1_Qinv(Q, a, b) }
34    }
35}
36
37pub mod type_2 {
38    /// This function computes the probability density p(x) at x for a Type-2 Gumbel distribution with parameters a and b, using the formula given above.
39    #[doc(alias = "gsl_ran_gumbel2_pdf")]
40    pub fn gumbel2_pdf(x: f64, a: f64, b: f64) -> f64 {
41        unsafe { sys::gsl_ran_gumbel2_pdf(x, a, b) }
42    }
43
44    /// This function computes the cumulative distribution functions P(x), Q(x) and their inverses for the Type-2 Gumbel distribution with parameters a and b.
45    #[doc(alias = "gsl_cdf_gumbel2_P")]
46    pub fn gumbel2_P(x: f64, a: f64, b: f64) -> f64 {
47        unsafe { sys::gsl_cdf_gumbel2_P(x, a, b) }
48    }
49
50    /// This function computes the cumulative distribution functions P(x), Q(x) and their inverses for the Type-2 Gumbel distribution with parameters a and b.
51    #[doc(alias = "gsl_cdf_gumbel2_Q")]
52    pub fn gumbel2_Q(x: f64, a: f64, b: f64) -> f64 {
53        unsafe { sys::gsl_cdf_gumbel2_Q(x, a, b) }
54    }
55
56    /// This function computes the cumulative distribution functions P(x), Q(x) and their inverses for the Type-2 Gumbel distribution with parameters a and b.
57    #[doc(alias = "gsl_cdf_gumbel2_Pinv")]
58    pub fn gumbel2_Pinv(P: f64, a: f64, b: f64) -> f64 {
59        unsafe { sys::gsl_cdf_gumbel2_Pinv(P, a, b) }
60    }
61
62    /// This function computes the cumulative distribution functions P(x), Q(x) and their inverses for the Type-2 Gumbel distribution with parameters a and b.
63    #[doc(alias = "gsl_cdf_gumbel2_Qinv")]
64    pub fn gumbel2_Qinv(Q: f64, a: f64, b: f64) -> f64 {
65        unsafe { sys::gsl_cdf_gumbel2_Qinv(Q, a, b) }
66    }
67}