Fix Xargo build.

This commit is contained in:
sebcrozet 2018-07-20 16:10:12 +02:00 committed by Sébastien Crozet
parent 378b39db9c
commit afb6317893
4 changed files with 16 additions and 9 deletions

View File

@ -4,14 +4,16 @@ use base::storage::Owned;
use quickcheck::{Arbitrary, Gen}; use quickcheck::{Arbitrary, Gen};
use num::{Bounded, One, Zero}; use num::{Bounded, One, Zero};
#[cfg(feature = "std")]
use rand::{self, distributions::StandardNormal};
use rand::distributions::{Distribution, Standard}; use rand::distributions::{Distribution, Standard};
use rand::Rng; use rand::Rng;
#[cfg(feature = "std")]
use rand::{self, distributions::StandardNormal};
use std::iter; use std::iter;
use typenum::{self, Cmp, Greater}; use typenum::{self, Cmp, Greater};
use alga::general::{ClosedAdd, ClosedMul, Real}; #[cfg(feature = "std")]
use alga::general::Real;
use alga::general::{ClosedAdd, ClosedMul};
use base::allocator::Allocator; use base::allocator::Allocator;
use base::dimension::{Dim, DimName, Dynamic, U1, U2, U3, U4, U5, U6}; use base::dimension::{Dim, DimName, Dynamic, U1, U2, U3, U4, U5, U6};
@ -510,11 +512,15 @@ where
/// Generate a uniformly distributed random unit vector. /// Generate a uniformly distributed random unit vector.
#[inline] #[inline]
fn sample<'a, G: Rng + ?Sized>(&self, rng: &'a mut G) -> Unit<VectorN<N, D>> { fn sample<'a, G: Rng + ?Sized>(&self, rng: &'a mut G) -> Unit<VectorN<N, D>> {
Unit::new_normalize(VectorN::from_distribution_generic(D::name(), U1, &mut StandardNormal, rng)) Unit::new_normalize(VectorN::from_distribution_generic(
D::name(),
U1,
&mut StandardNormal,
rng,
))
} }
} }
/* /*
* *
* Constructors for small matrices and vectors. * Constructors for small matrices and vectors.

View File

@ -9,7 +9,7 @@ use std::ops::Mul;
use std::ptr; use std::ptr;
#[cfg(all(feature = "alloc", not(feature = "std")))] #[cfg(all(feature = "alloc", not(feature = "std")))]
use alloc::Vec; use alloc::vec::Vec;
use generic_array::ArrayLength; use generic_array::ArrayLength;
use typenum::Prod; use typenum::Prod;

View File

@ -1,5 +1,5 @@
#[cfg(all(feature = "alloc", not(feature = "std")))] #[cfg(all(feature = "alloc", not(feature = "std")))]
use alloc::Vec; use alloc::vec::Vec;
use num::{One, Zero}; use num::{One, Zero};
@ -411,7 +411,8 @@ where
for i in 0..shape.0.value() * shape.1.value() { for i in 0..shape.0.value() * shape.1.value() {
unsafe { unsafe {
let mj = self.data let mj = self
.data
.get_unchecked_linear(i) .get_unchecked_linear(i)
.meet_join(other.data.get_unchecked_linear(i)); .meet_join(other.data.get_unchecked_linear(i));
*mres.data.get_unchecked_linear_mut(i) = mj.0; *mres.data.get_unchecked_linear_mut(i) = mj.0;

View File

@ -3,7 +3,7 @@ use std::io::{Result as IOResult, Write};
use std::ops::Deref; use std::ops::Deref;
#[cfg(all(feature = "alloc", not(feature = "std")))] #[cfg(all(feature = "alloc", not(feature = "std")))]
use alloc::Vec; use alloc::vec::Vec;
use base::allocator::Allocator; use base::allocator::Allocator;
use base::default_allocator::DefaultAllocator; use base::default_allocator::DefaultAllocator;