diff --git a/src/lib.rs b/src/lib.rs index 68d99af5..317ef89e 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -114,8 +114,10 @@ pub use traits::{PartialLess, PartialEqual, PartialGreater, NotComparable}; pub use traits::{ Absolute, AbsoluteRotate, - AnyVec, AnyPnt, + AnyPntExt, + AnyVec, + AnyVecExt, ApproxEq, Axpy, Basis, @@ -148,7 +150,6 @@ pub use traits::{ PartialOrd, PartialOrdering, PntAsVec, - PntExt, RMul, Rotate, Rotation, RotationMatrix, RotationWithTranslation, Row, @@ -159,8 +160,7 @@ pub use traits::{ Translate, Translation, Transpose, UniformSphereSample, - VecAsPnt, - VecExt + VecAsPnt }; pub use structs::{ diff --git a/src/traits/mod.rs b/src/traits/mod.rs index c4c60311..eb7e8f8b 100644 --- a/src/traits/mod.rs +++ b/src/traits/mod.rs @@ -5,8 +5,8 @@ pub use self::geometry::{AbsoluteRotate, Cross, CrossMatrix, Dot, FromHomogeneou Transform, Transformation, Translate, Translation, UniformSphereSample}; pub use self::structure::{FloatVec, FloatVecExt, FloatPnt, FloatPntExt, Basis, Cast, Col, Dim, - Indexable, Iterable, IterableMut, Mat, Row, AnyVec, VecExt, AnyPnt, - PntExt, PntAsVec, VecAsPnt, ColSlice, RowSlice, Diag, Eye}; + Indexable, Iterable, IterableMut, Mat, Row, AnyVec, AnyVecExt, AnyPnt, + AnyPntExt, PntAsVec, VecAsPnt, ColSlice, RowSlice, Diag, Eye}; pub use self::operations::{Absolute, ApproxEq, Axpy, Cov, Det, Inv, LMul, Mean, Outer, PartialOrd, RMul, ScalarAdd, ScalarSub, ScalarMul, ScalarDiv, Transpose}; diff --git a/src/traits/structure.rs b/src/traits/structure.rs index 62ee0b7d..6026ef1f 100644 --- a/src/traits/structure.rs +++ b/src/traits/structure.rs @@ -166,13 +166,13 @@ pub trait FloatVec: AnyVec + Norm { /// Trait grouping uncommon, low-level and borderline (from the mathematical point of view) /// operations on vectors. -pub trait VecExt: AnyVec + Indexable + Iterable + - UniformSphereSample + ScalarAdd + ScalarSub + Bounded +pub trait AnyVecExt: AnyVec + Indexable + Index + IndexMut + + Iterable + UniformSphereSample + ScalarAdd + ScalarSub + Bounded { } /// Trait grouping uncommon, low-level and borderline (from the mathematical point of view) /// operations on vectors. -pub trait FloatVecExt: FloatVec + VecExt + Basis { } +pub trait FloatVecExt: FloatVec + AnyVecExt + Basis { } impl + Add + Neg + Zero + PartialEq + Mul + Div + Dot + Axpy> AnyVec for V { } @@ -180,11 +180,11 @@ AnyVec for V { } impl + Norm> FloatVec for V { } impl + Indexable + Iterable + + V: AnyVec + Indexable + Index + IndexMut + Iterable + UniformSphereSample + ScalarAdd + ScalarSub + Bounded> -VecExt for V { } +AnyVecExt for V { } -impl + VecExt + Basis> FloatVecExt for V { } +impl + AnyVecExt + Basis> FloatVecExt for V { } /* * Pnt related traits. @@ -228,18 +228,18 @@ pub trait FloatPnt>: AnyPnt { /// Trait grouping uncommon, low-level and borderline (from the mathematical point of view) /// operations on points. -pub trait PntExt: AnyPnt + Indexable + Iterable + - ScalarAdd + ScalarSub + Bounded + Axpy +pub trait AnyPntExt: AnyPnt + Indexable + Index + IndexMut + + Iterable + ScalarAdd + ScalarSub + Bounded + Axpy { } /// Trait grouping uncommon, low-level and borderline (from the mathematical point of view) /// operations on points. -pub trait FloatPntExt> : FloatPnt + PntExt { } +pub trait FloatPntExt> : FloatPnt + AnyPntExt { } impl + Dim + Sub + Add + Orig + Neg

+ PartialEq + Mul + Div> AnyPnt for P { } impl, P: AnyPnt> FloatPnt for P { } -impl + Indexable + Iterable + ScalarAdd + ScalarSub + Bounded + Axpy> -PntExt for P { } -impl, P: FloatPnt + PntExt> FloatPntExt for P { } +impl + Indexable + Index + IndexMut + Iterable + ScalarAdd + ScalarSub + Bounded + Axpy> +AnyPntExt for P { } +impl, P: FloatPnt + AnyPntExt> FloatPntExt for P { }