From fb20ffdf8b545668055b1deac13226229ea72038 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Crozet?= Date: Tue, 11 Jun 2013 11:03:16 +0200 Subject: [PATCH] Add automatic implementation of VectorSpace. --- src/traits/vector_space.rs | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/traits/vector_space.rs b/src/traits/vector_space.rs index 85c1d2c0..7b07d370 100644 --- a/src/traits/vector_space.rs +++ b/src/traits/vector_space.rs @@ -6,7 +6,11 @@ use traits::workarounds::scalar_op::{ScalarMul, ScalarDiv}; /// structure, the elements of which have addition, substraction, negation, /// scalar multiplication (the scalar being a element of a `DivisionRing`), and /// has a distinct element (`Zero`) neutral wrt the addition. -pub trait VectorSpace +pub trait VectorSpace : Sub + Add + Neg + Zero + ScalarMul + ScalarDiv { } + +impl + Add + Neg + Zero + + ScalarMul + ScalarDiv, + N: DivisionRing> VectorSpace for V;