src/euclidean.rs

branch
dev
changeset 62
d8305c9b6fdf
parent 59
9226980e45a7
child 63
f7b87d84864d
equal deleted inserted replaced
61:05089fbc0310 62:d8305c9b6fdf
28 + for<'b> Sub<&'b Self, Output=<Self as Euclidean<F>>::Output> 28 + for<'b> Sub<&'b Self, Output=<Self as Euclidean<F>>::Output>
29 + AddAssign<Self> + for<'b> AddAssign<&'b Self> 29 + AddAssign<Self> + for<'b> AddAssign<&'b Self>
30 + SubAssign<Self> + for<'b> SubAssign<&'b Self> 30 + SubAssign<Self> + for<'b> SubAssign<&'b Self>
31 + Neg<Output=<Self as Euclidean<F>>::Output> { 31 + Neg<Output=<Self as Euclidean<F>>::Output> {
32 type Output : Euclidean<F>; 32 type Output : Euclidean<F>;
33
34 /// Returns origin of same dimensions as `self`.
35 fn similar_origin(&self) -> <Self as Euclidean<F>>::Output;
36 33
37 /// Calculate the square of the 2-norm, $\frac{1}{2}\\|x\\|_2^2$, where `self` is $x$. 34 /// Calculate the square of the 2-norm, $\frac{1}{2}\\|x\\|_2^2$, where `self` is $x$.
38 #[inline] 35 #[inline]
39 fn norm2_squared(&self) -> F { 36 fn norm2_squared(&self) -> F {
40 self.dot(self) 37 self.dot(self)

mercurial