missing `Copy` impls for distributions.
diff --git a/src/distributions/gamma.rs b/src/distributions/gamma.rs
index 5f6aaa4..f7ee4fc 100644
--- a/src/distributions/gamma.rs
+++ b/src/distributions/gamma.rs
@@ -51,10 +51,12 @@
/// for Generating Gamma Variables" *ACM Trans. Math. Softw.* 26, 3
/// (September 2000),
/// 363-372. DOI:[10.1145/358407.358414](http://doi.acm.org/10.1145/358407.358414)
+#[derive(Copy)]
pub struct Gamma {
repr: GammaRepr,
}
+#[derive(Copy)]
enum GammaRepr {
Large(GammaLargeShape),
One(Exp),
@@ -75,6 +77,7 @@
///
/// See `Gamma` for sampling from a Gamma distribution with general
/// shape parameters.
+#[derive(Copy)]
struct GammaSmallShape {
inv_shape: f64,
large_shape: GammaLargeShape
@@ -84,6 +87,7 @@
///
/// See `Gamma` for sampling from a Gamma distribution with general
/// shape parameters.
+#[derive(Copy)]
struct GammaLargeShape {
scale: f64,
c: f64,
@@ -192,10 +196,12 @@
/// let v = chi.ind_sample(&mut rand::thread_rng());
/// println!("{} is from a χ²(11) distribution", v)
/// ```
+#[derive(Copy)]
pub struct ChiSquared {
repr: ChiSquaredRepr,
}
+#[derive(Copy)]
enum ChiSquaredRepr {
// k == 1, Gamma(alpha, ..) is particularly slow for alpha < 1,
// e.g. when alpha = 1/2 as it would be for this case, so special-
@@ -248,6 +254,7 @@
/// let v = f.ind_sample(&mut rand::thread_rng());
/// println!("{} is from an F(2, 32) distribution", v)
/// ```
+#[derive(Copy)]
pub struct FisherF {
numer: ChiSquared,
denom: ChiSquared,
@@ -291,6 +298,7 @@
/// let v = t.ind_sample(&mut rand::thread_rng());
/// println!("{} is from a t(11) distribution", v)
/// ```
+#[derive(Copy)]
pub struct StudentT {
chi: ChiSquared,
dof: f64
diff --git a/src/distributions/mod.rs b/src/distributions/mod.rs
index 703b316..571411b 100644
--- a/src/distributions/mod.rs
+++ b/src/distributions/mod.rs
@@ -58,6 +58,8 @@
_marker: marker::PhantomData<fn() -> Sup>,
}
+impl<Sup> Copy for RandSample<Sup> {}
+
impl<Sup: Rand> Sample<Sup> for RandSample<Sup> {
fn sample<R: Rng>(&mut self, rng: &mut R) -> Sup { self.ind_sample(rng) }
}
@@ -75,6 +77,7 @@
}
/// A value with a particular weight for use with `WeightedChoice`.
+#[derive(Copy)]
pub struct Weighted<T> {
/// The numerical weight of this item
pub weight: u32,
diff --git a/src/distributions/range.rs b/src/distributions/range.rs
index 4fe281c..932bfae 100644
--- a/src/distributions/range.rs
+++ b/src/distributions/range.rs
@@ -47,6 +47,7 @@
/// println!("{}", sum);
/// }
/// ```
+#[derive(Copy)]
pub struct Range<X> {
low: X,
range: X,