Fix compilation errors related to rand.

This commit is contained in:
sebcrozet 2018-12-29 14:22:24 +01:00
parent 6a4323d0ea
commit be8d1ce3ce
3 changed files with 3 additions and 2 deletions

View File

@ -48,6 +48,7 @@ where
Owned<N, D, D>: Clone + Send,
{
fn arbitrary<G: Gen>(g: &mut G) -> Self {
use rand::Rng;
let dim = D::try_to_usize().unwrap_or(g.gen_range(1, 50));
Self::new(D::from_usize(dim), || N::arbitrary(g))
}

View File

@ -49,6 +49,7 @@ where
Owned<N, D, D>: Clone + Send,
{
fn arbitrary<G: Gen>(g: &mut G) -> Self {
use rand::Rng;
let dim = D::try_to_usize().unwrap_or(g.gen_range(1, 50));
Self::new(D::from_usize(dim), || N::arbitrary(g))
}

View File

@ -7,10 +7,9 @@ use rand::distributions::{Distribution, OpenClosed01, Standard};
use rand::Rng;
use alga::general::Real;
use base::allocator::Allocator;
use base::dimension::{U1, U2};
use base::storage::Storage;
use base::{DefaultAllocator, Unit, Vector};
use base::{Unit, Vector};
use geometry::{Rotation2, UnitComplex};
impl<N: Real> UnitComplex<N> {