Update dependencies, and fix tests from fallout

This commit is contained in:
George Burton 2018-12-18 14:44:53 +00:00
parent 8b8f127f8d
commit 9c37c51203
5 changed files with 18 additions and 13 deletions

View File

@ -28,21 +28,22 @@ alloc = [ ]
[dependencies]
typenum = "1.10"
generic-array = "0.11"
rand = { version = "0.5", default-features = false }
generic-array = "0.12"
rand = { version = "0.6", default-features = false }
num-traits = { version = "0.2", default-features = false }
num-complex = { version = "0.2", default-features = false }
approx = { version = "0.3", default-features = false }
alga = { version = "0.7", default-features = false }
matrixmultiply = { version = "0.1", optional = true }
matrixmultiply = { version = "0.2", optional = true }
serde = { version = "1.0", optional = true }
serde_derive = { version = "1.0", optional = true }
abomonation = { version = "0.5", optional = true }
abomonation = { version = "0.7", optional = true }
mint = { version = "0.5", optional = true }
quickcheck = { version = "0.6", optional = true }
quickcheck = { version = "0.7", optional = true }
[dev-dependencies]
serde_json = "1.0"
rand_xorshift = "0.1"
[workspace]
members = [ "nalgebra-lapack", "nalgebra-glm" ]

View File

@ -34,6 +34,6 @@ lapack-src = { version = "0.2", default-features = false }
[dev-dependencies]
nalgebra = { version = "0.16", path = "..", features = [ "arbitrary" ] }
quickcheck = "0.6"
quickcheck = "0.7"
approx = "0.3"
rand = "0.5"
rand = "0.6"

View File

@ -693,12 +693,13 @@ where
#[cfg(test)]
mod tests {
extern crate rand_xorshift;
use super::*;
use rand::{self, SeedableRng};
use rand::SeedableRng;
#[test]
fn random_unit_quats_are_unit() {
let mut rng = rand::prng::XorShiftRng::from_seed([0xAB; 16]);
let mut rng = rand_xorshift::XorShiftRng::from_seed([0xAB; 16]);
for _ in 0..1000 {
let x = rng.gen::<UnitQuaternion<f32>>();
assert!(relative_eq!(x.into_inner().norm(), 1.0))

View File

@ -107,9 +107,10 @@ impl<N: Real> Rotation2<N> {
///
/// # Example
/// ```
/// # #[macro_use] extern crate approx;
/// # use nalgebra::Rotation2;
/// let rot = Rotation2::new(1.78);
/// assert_eq!(rot.angle(), 1.78);
/// assert_relative_eq!(rot.angle(), 1.78);
/// ```
#[inline]
pub fn angle(&self) -> N {
@ -158,10 +159,11 @@ impl<N: Real> Rotation2<N> {
///
/// # Example
/// ```
/// # #[macro_use] extern crate approx;
/// # use nalgebra::Rotation2;
/// let rot = Rotation2::new(0.78);
/// let pow = rot.powf(2.0);
/// assert_eq!(pow.angle(), 2.0 * 0.78);
/// assert_relative_eq!(pow.angle(), 2.0 * 0.78);
/// ```
#[inline]
pub fn powf(&self, n: N) -> Rotation2<N> {
@ -566,7 +568,7 @@ impl<N: Real> Rotation3<N> {
/// # use nalgebra::{Unit, Rotation3, Vector3};
/// let axis = Unit::new_normalize(Vector3::new(1.0, 2.0, 3.0));
/// let rot = Rotation3::from_axis_angle(&axis, 1.78);
/// assert_relative_eq!(rot.angle(), 1.78);
/// assert_eq!(rot.angle(), 1.78);
/// ```
#[inline]
pub fn angle(&self) -> N {

View File

@ -212,10 +212,11 @@ impl<N: Real> UnitComplex<N> {
///
/// # Example
/// ```
/// # #[macro_use] extern crate approx;
/// # use nalgebra::UnitComplex;
/// let rot = UnitComplex::new(0.78);
/// let pow = rot.powf(2.0);
/// assert_eq!(pow.angle(), 2.0 * 0.78);
/// assert_relative_eq!(pow.angle(), 2.0 * 0.78);
/// ```
#[inline]
pub fn powf(&self, n: N) -> Self {