new dependency num. use traits from num.

This commit is contained in:
John P Mayer Jr 2015-04-04 22:57:56 -04:00
parent 0e7116e3bb
commit c5dfa22b7f
3 changed files with 5 additions and 2 deletions

View File

@ -22,6 +22,7 @@ arbitrary = ["quickcheck"]
[dependencies] [dependencies]
rustc-serialize = "*" rustc-serialize = "*"
rand = "*" rand = "*"
num = "*"
[dependencies.quickcheck] [dependencies.quickcheck]
optional = true optional = true

View File

@ -85,6 +85,7 @@ Feel free to add your project to this list if you happen to use **nalgebra**!
#![cfg_attr(test, feature(test))] #![cfg_attr(test, feature(test))]
#![doc(html_root_url = "http://nalgebra.org/doc")] #![doc(html_root_url = "http://nalgebra.org/doc")]
extern crate num;
extern crate rustc_serialize; extern crate rustc_serialize;
extern crate rand; extern crate rand;

View File

@ -1,7 +1,7 @@
//! Traits giving structural informations on linear algebra objects or the space they live in. //! Traits giving structural informations on linear algebra objects or the space they live in.
use num::Float;
use std::{f32, f64, i8, i16, i32, i64, u8, u16, u32, u64, isize, usize}; use std::{f32, f64, i8, i16, i32, i64, u8, u16, u32, u64, isize, usize};
use std::num::Float;
use std::slice::{Iter, IterMut}; use std::slice::{Iter, IterMut};
use std::ops::{Add, Sub, Mul, Div, Rem, Index, IndexMut}; use std::ops::{Add, Sub, Mul, Div, Rem, Index, IndexMut};
use traits::operations::{RMul, LMul, Axpy, Transpose, Inv, Absolute}; use traits::operations::{RMul, LMul, Axpy, Transpose, Inv, Absolute};
@ -16,7 +16,8 @@ pub trait BaseNum: Copy + Zero + One +
} }
/// Basic floating-point number numeric trait. /// Basic floating-point number numeric trait.
pub trait BaseFloat: Float + Cast<f64> + BaseNum { /// (Note: Clone could be a constraint on BaseNum instead)
pub trait BaseFloat: Float + Clone + Cast<f64> + BaseNum {
/// Archimedes' constant. /// Archimedes' constant.
fn pi() -> Self; fn pi() -> Self;
/// 2.0 * pi. /// 2.0 * pi.