Remove the {Any,Float}{Pnt,Vec}Ext traits.
They are meaningless and too hard to implement in an ad-hoc way to be really useful.
This commit is contained in:
parent
074c9356bf
commit
eb24c4063f
@ -115,9 +115,7 @@ pub use traits::{
|
|||||||
Absolute,
|
Absolute,
|
||||||
AbsoluteRotate,
|
AbsoluteRotate,
|
||||||
AnyPnt,
|
AnyPnt,
|
||||||
AnyPntExt,
|
|
||||||
AnyVec,
|
AnyVec,
|
||||||
AnyVecExt,
|
|
||||||
ApproxEq,
|
ApproxEq,
|
||||||
Axpy,
|
Axpy,
|
||||||
Basis,
|
Basis,
|
||||||
@ -133,9 +131,7 @@ pub use traits::{
|
|||||||
Dot,
|
Dot,
|
||||||
Eye,
|
Eye,
|
||||||
FloatPnt,
|
FloatPnt,
|
||||||
FloatPntExt,
|
|
||||||
FloatVec,
|
FloatVec,
|
||||||
FloatVecExt,
|
|
||||||
FromHomogeneous,
|
FromHomogeneous,
|
||||||
Indexable,
|
Indexable,
|
||||||
Inv,
|
Inv,
|
||||||
|
@ -4,9 +4,9 @@ pub use self::geometry::{AbsoluteRotate, Cross, CrossMatrix, Dot, FromHomogeneou
|
|||||||
Rotate, Rotation, RotationMatrix, RotationWithTranslation, ToHomogeneous,
|
Rotate, Rotation, RotationMatrix, RotationWithTranslation, ToHomogeneous,
|
||||||
Transform, Transformation, Translate, Translation, UniformSphereSample};
|
Transform, Transformation, Translate, Translation, UniformSphereSample};
|
||||||
|
|
||||||
pub use self::structure::{FloatVec, FloatVecExt, FloatPnt, FloatPntExt, Basis, Cast, Col, Dim,
|
pub use self::structure::{FloatVec, FloatPnt, Basis, Cast, Col, Dim, Indexable, Iterable,
|
||||||
Indexable, Iterable, IterableMut, Mat, Row, AnyVec, AnyVecExt, AnyPnt,
|
IterableMut, Mat, Row, AnyVec, AnyPnt, PntAsVec, VecAsPnt, ColSlice,
|
||||||
AnyPntExt, PntAsVec, VecAsPnt, ColSlice, RowSlice, Diag, Eye};
|
RowSlice, Diag, Eye};
|
||||||
|
|
||||||
pub use self::operations::{Absolute, ApproxEq, Axpy, Cov, Det, Inv, LMul, Mean, Outer, POrd,
|
pub use self::operations::{Absolute, ApproxEq, Axpy, Cov, Det, Inv, LMul, Mean, Outer, POrd,
|
||||||
RMul, ScalarAdd, ScalarSub, ScalarMul, ScalarDiv, Transpose};
|
RMul, ScalarAdd, ScalarSub, ScalarMul, ScalarDiv, Transpose};
|
||||||
|
@ -1,9 +1,9 @@
|
|||||||
//! 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 std::num::{Zero, Bounded};
|
use std::num::Zero;
|
||||||
use std::slice::{Items, MutItems};
|
use std::slice::{Items, MutItems};
|
||||||
use traits::operations::{RMul, LMul, ScalarAdd, ScalarSub, Axpy};
|
use traits::operations::{RMul, LMul, Axpy};
|
||||||
use traits::geometry::{Dot, Norm, UniformSphereSample, Orig};
|
use traits::geometry::{Dot, Norm, Orig};
|
||||||
|
|
||||||
/// Traits of objects which can be created from an object of type `T`.
|
/// Traits of objects which can be created from an object of type `T`.
|
||||||
pub trait Cast<T> {
|
pub trait Cast<T> {
|
||||||
@ -164,28 +164,11 @@ pub trait AnyVec<N>: Dim + Sub<Self, Self> + Add<Self, Self> + Neg<Self> + Zero
|
|||||||
pub trait FloatVec<N: Float>: AnyVec<N> + Norm<N> {
|
pub trait FloatVec<N: Float>: AnyVec<N> + Norm<N> {
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Trait grouping uncommon, low-level and borderline (from the mathematical point of view)
|
|
||||||
/// operations on vectors.
|
|
||||||
pub trait AnyVecExt<N>: AnyVec<N> + Indexable<uint, N> + Index<uint, N> + IndexMut<uint, N> +
|
|
||||||
Iterable<N> + UniformSphereSample + ScalarAdd<N> + ScalarSub<N> + Bounded
|
|
||||||
{ }
|
|
||||||
|
|
||||||
/// Trait grouping uncommon, low-level and borderline (from the mathematical point of view)
|
|
||||||
/// operations on vectors.
|
|
||||||
pub trait FloatVecExt<N: Float>: FloatVec<N> + AnyVecExt<N> { }
|
|
||||||
|
|
||||||
impl<N, V: Dim + Sub<V, V> + Add<V, V> + Neg<V> + Zero + PartialEq + Mul<N, V> + Div<N, V> + Dot<N> + Axpy<N> + Basis>
|
impl<N, V: Dim + Sub<V, V> + Add<V, V> + Neg<V> + Zero + PartialEq + Mul<N, V> + Div<N, V> + Dot<N> + Axpy<N> + Basis>
|
||||||
AnyVec<N> for V { }
|
AnyVec<N> for V { }
|
||||||
|
|
||||||
impl<N: Float, V: AnyVec<N> + Norm<N>> FloatVec<N> for V { }
|
impl<N: Float, V: AnyVec<N> + Norm<N>> FloatVec<N> for V { }
|
||||||
|
|
||||||
impl<N,
|
|
||||||
V: AnyVec<N> + Indexable<uint, N> + Index<uint, N> + IndexMut<uint, N> + Iterable<N> +
|
|
||||||
UniformSphereSample + ScalarAdd<N> + ScalarSub<N> + Bounded>
|
|
||||||
AnyVecExt<N> for V { }
|
|
||||||
|
|
||||||
impl<N: Float, V: FloatVec<N> + AnyVecExt<N>> FloatVecExt<N> for V { }
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Pnt related traits.
|
* Pnt related traits.
|
||||||
*/
|
*/
|
||||||
@ -226,20 +209,6 @@ pub trait FloatPnt<N: Float, V: Norm<N>>: AnyPnt<N, V> {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Trait grouping uncommon, low-level and borderline (from the mathematical point of view)
|
|
||||||
/// operations on points.
|
|
||||||
pub trait AnyPntExt<N, V>: AnyPnt<N, V> + Indexable<uint, N> + Index<uint, N> + IndexMut<uint, N> +
|
|
||||||
Iterable<N> + ScalarAdd<N> + ScalarSub<N> + Bounded + Axpy<N>
|
|
||||||
{ }
|
|
||||||
|
|
||||||
/// Trait grouping uncommon, low-level and borderline (from the mathematical point of view)
|
|
||||||
/// operations on points.
|
|
||||||
pub trait FloatPntExt<N: Float, V: Norm<N>> : FloatPnt<N, V> + AnyPntExt<N, V> { }
|
|
||||||
|
|
||||||
|
|
||||||
impl<N, V, P: PntAsVec<V> + Dim + Sub<P, V> + Add<V, P> + Orig + Neg<P> + PartialEq + Mul<N, P> + Div<N, P>>
|
impl<N, V, P: PntAsVec<V> + Dim + Sub<P, V> + Add<V, P> + Orig + Neg<P> + PartialEq + Mul<N, P> + Div<N, P>>
|
||||||
AnyPnt<N, V> for P { }
|
AnyPnt<N, V> for P { }
|
||||||
impl<N: Float, V: Norm<N>, P: AnyPnt<N, V>> FloatPnt<N, V> for P { }
|
impl<N: Float, V: Norm<N>, P: AnyPnt<N, V>> FloatPnt<N, V> for P { }
|
||||||
impl<N, V, P: AnyPnt<N, V> + Indexable<uint, N> + Index<uint, N> + IndexMut<uint, N> + Iterable<N> + ScalarAdd<N> + ScalarSub<N> + Bounded + Axpy<N>>
|
|
||||||
AnyPntExt<N, V> for P { }
|
|
||||||
impl<N: Float, V: Norm<N>, P: FloatPnt<N, V> + AnyPntExt<N, V>> FloatPntExt<N, V> for P { }
|
|
||||||
|
Loading…
Reference in New Issue
Block a user