Commit c7c5edee authored by Egor Larionov's avatar Egor Larionov

Bump nalgebra and rand and fix warnings

parent b4a8a1a4
[package]
name = "hrbf"
version = "0.2.0"
version = "0.2.1"
authors = ["Egor Larionov <[email protected]>"]
[dependencies]
num-traits = "0.2"
nalgebra = "0.17"
nalgebra = "0.18"
[dev-dependencies]
approx = "0.3"
autodiff = "0.1"
rand = "0.5"
rand = "0.6"
......@@ -7,13 +7,13 @@ pub use kernel::*;
use na::storage::Storage;
use na::{
DMatrix, DVector, Matrix3, Matrix3x4, Matrix4, Point3, U1, U3, U4, Vector, Vector3,
Vector4,
Vector4, RealField,
};
use num_traits::{Float, Zero};
/// Floating point real trait used throughout this library.
pub trait Real: Float + na::Real + ::std::fmt::Debug {}
impl<T> Real for T where T: Float + na::Real + ::std::fmt::Debug {}
pub trait Real: Float + RealField + ::std::fmt::Debug {}
impl<T> Real for T where T: Float + RealField + ::std::fmt::Debug {}
/// Shorthand for an HRBF with a constant `x^3` kernel.
pub type Pow3HRBF<T> = HRBF<T, kernel::Pow3<T>>;
......
......@@ -8,6 +8,7 @@ extern crate approx;
use hrbf::*;
use nalgebra::{Matrix3, Point3, Vector3};
use num_traits::Float;
use rand::prelude::*;
fn rel_compare(a: f64, b: f64) {
assert_relative_eq!(a, b, max_relative = 1e-3, epsilon = 1e-11);
......@@ -117,10 +118,9 @@ fn test_hrbf_derivative_simple<K: Kernel<f64> + Default>(order: usize) {
}
fn test_hrbf_derivative_random<K: Kernel<f64> + Default>(order: usize) {
use self::rand::{distributions::Uniform, Rng, SeedableRng, StdRng};
use self::rand::distributions::Uniform;
let seed = [3u8; 32];
let mut rng = StdRng::from_seed(seed);
let mut rng: StdRng = SeedableRng::from_seed([3u8; 32]);
let range = Uniform::new(-1.0, 1.0);
for _ in 0..99 {
let x = Point3::new(rng.sample(range), rng.sample(range), rng.sample(range));
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment