Update to the last Rust.

This commit is contained in:
Sébastien Crozet 2013-09-26 17:05:11 +02:00
parent 410bbd1d25
commit b61d621090
3 changed files with 12 additions and 11 deletions

View File

@ -241,7 +241,7 @@ impl<N: Neg<N>> Neg<DVec<N>> for DVec<N> {
}
}
impl<N: Num> Dot<N> for DVec<N> {
impl<N: Num + Clone> Dot<N> for DVec<N> {
#[inline]
fn dot(&self, other: &DVec<N>) -> N {
assert!(self.at.len() == other.at.len());
@ -249,7 +249,7 @@ impl<N: Num> Dot<N> for DVec<N> {
let mut res: N = Zero::zero();
for i in range(0u, self.at.len()) {
res = res + self.at[i] * other.at[i];
res = res + unsafe { self.at_fast(i) * other.at_fast(i) };
}
res
@ -260,7 +260,7 @@ impl<N: Num> Dot<N> for DVec<N> {
let mut res: N = Zero::zero();
for i in range(0u, self.at.len()) {
res = res + (self.at[i] - a.at[i]) * b.at[i];
res = res + unsafe { (self.at_fast(i) - a.at_fast(i)) * b.at_fast(i) };
}
res

View File

@ -254,4 +254,5 @@ pub trait RotationWithTranslation<LV: Neg<LV>, AV>: Rotation<AV> + Translation<L
}
}
impl<LV: Neg<LV>, AV, M: Rotation<AV> + Translation<LV>> RotationWithTranslation<LV, AV> for M;
impl<LV: Neg<LV>, AV, M: Rotation<AV> + Translation<LV>> RotationWithTranslation<LV, AV> for M {
}

View File

@ -8,7 +8,8 @@ use traits::geometry::{Dot, Norm, UniformSphereSample};
/// A matrix has rows and columns and are able to multiply them.
pub trait Mat<R, C> : Row<R> + Col<C> + RMul<R> + LMul<C> { }
impl<M: Row<R> + Col<C> + RMul<R> + LMul<C>, R, C> Mat<R, C> for M;
impl<M: Row<R> + Col<C> + RMul<R> + LMul<C>, R, C> Mat<R, C> for M {
}
/// Trait of matrices which can be converted to another matrix.
///
@ -39,20 +40,19 @@ pub trait VecExt<N>: Vec<N> + Basis + Indexable<uint, N> + Iterable<N> + Round +
/// Trait grouping uncommon, low-level and borderline (from the mathematical point of view)
/// operations on vectors.
pub trait AlgebraicVecExt<N: Algebraic>: AlgebraicVec<N> + VecExt<N>
{ }
pub trait AlgebraicVecExt<N: Algebraic>: AlgebraicVec<N> + VecExt<N> { }
impl<N, V: Dim + Sub<V, V> + Add<V, V> + Neg<V> + Zero + Eq + Mul<N, V> + Div<N, V> + Dot<N>>
Vec<N> for V;
Vec<N> for V { }
impl<N: Algebraic, V: Vec<N> + Norm<N>> AlgebraicVec<N> for V;
impl<N: Algebraic, V: Vec<N> + Norm<N>> AlgebraicVec<N> for V { }
impl<N,
V: Vec<N> + Basis + Indexable<uint, N> + Iterable<N> + Round +
UniformSphereSample + ScalarAdd<N> + ScalarSub<N> + Bounded + Orderable>
VecExt<N> for V;
VecExt<N> for V { }
impl<N: Algebraic, V: AlgebraicVec<N> + VecExt<N>> AlgebraicVecExt<N> for V;
impl<N: Algebraic, V: AlgebraicVec<N> + VecExt<N>> AlgebraicVecExt<N> for V { }
/// Trait of vectors which can be converted to another vector. Used to change the type of a vector
/// components.