Skip to content

Commit 99766f6

Browse files
committed
ndarray-rand: Remove deprecated F32
1 parent 708de94 commit 99766f6

File tree

1 file changed

+0
-29
lines changed

1 file changed

+0
-29
lines changed

ndarray-rand/src/lib.rs

Lines changed: 0 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -310,32 +310,3 @@ fn get_rng() -> SmallRng
310310
{
311311
SmallRng::from_rng(thread_rng()).expect("create SmallRng from thread_rng failed")
312312
}
313-
314-
/// A wrapper type that allows casting f64 distributions to f32
315-
///
316-
/// ```
317-
/// use ndarray::Array;
318-
/// use ndarray_rand::{RandomExt, F32};
319-
/// use ndarray_rand::rand_distr::Normal;
320-
///
321-
/// # fn main() {
322-
/// let distribution_f64 = Normal::new(0., 1.).expect("Failed to create normal distribution");
323-
/// let a = Array::random((2, 5), F32(distribution_f64));
324-
/// println!("{:8.4}", a);
325-
/// // Example Output:
326-
/// // [[ -0.6910, 1.1730, 1.0902, -0.4092, -1.7340],
327-
/// // [ -0.6810, 0.1678, -0.9487, 0.3150, 1.2981]]
328-
/// # }
329-
#[derive(Copy, Clone, Debug)]
330-
#[deprecated(since = "0.14.0", note = "Redundant with rand 0.8")]
331-
pub struct F32<S>(pub S);
332-
333-
#[allow(deprecated)]
334-
impl<S> Distribution<f32> for F32<S>
335-
where S: Distribution<f64>
336-
{
337-
fn sample<R: Rng + ?Sized>(&self, rng: &mut R) -> f32
338-
{
339-
self.0.sample(rng) as f32
340-
}
341-
}

0 commit comments

Comments
 (0)