From 23f57dd133056af63682f3ce01cf1ccba77d99f0 Mon Sep 17 00:00:00 2001 From: Delma Date: Mon, 28 Nov 2016 22:29:09 +0200 Subject: [PATCH] Made BaseNum to be a blanket implementation. --- src/traits/structure.rs | 32 ++++++++++++++------------------ 1 file changed, 14 insertions(+), 18 deletions(-) diff --git a/src/traits/structure.rs b/src/traits/structure.rs index 02e6d165..a3ac2f78 100644 --- a/src/traits/structure.rs +++ b/src/traits/structure.rs @@ -229,14 +229,14 @@ pub trait IterableMut { pub trait NumVector: Add + Sub + // Mul + Div + - // Add + Sub + - Mul + Div + + // Add + Sub + + Mul + Div + AddAssign + SubAssign + - // MulAssign + DivAssign + + // MulAssign + DivAssign + - // AddAssign + SubAssign + - MulAssign + DivAssign + + // AddAssign + SubAssign + + MulAssign + DivAssign + Dimension + Index + Zero + PartialEq + Dot + Axpy { @@ -253,7 +253,7 @@ pub trait FloatVector: NumVector + Norm + Neg Self::Vector; @@ -424,18 +424,14 @@ macro_rules! impl_base_float( } ); -impl BaseNum for i8 { } -impl BaseNum for i16 { } -impl BaseNum for i32 { } -impl BaseNum for i64 { } -impl BaseNum for isize { } -impl BaseNum for u8 { } -impl BaseNum for u16 { } -impl BaseNum for u32 { } -impl BaseNum for u64 { } -impl BaseNum for usize { } -impl BaseNum for f32 { } -impl BaseNum for f64 { } +impl + Sub + + Mul + Div + + Rem + + AddAssign + SubAssign + + MulAssign + DivAssign + + RemAssign + + PartialEq + Absolute + Axpy> BaseNum for T {} impl_base_float!(f32); impl_base_float!(f64);