43 } |
43 } |
44 } |
44 } |
45 |
45 |
46 impl<M : ManifoldPoint> Desc<M> for DistToSquaredDiv2<M> { |
46 impl<M : ManifoldPoint> Desc<M> for DistToSquaredDiv2<M> { |
47 fn desc(&self, τ : f64, x : M) -> M { |
47 fn desc(&self, τ : f64, x : M) -> M { |
48 x.exp(&(self.grad(&x) * τ)) |
48 let t = self.grad(&x) * τ; |
|
49 x.exp(&t) |
49 } |
50 } |
50 } |
51 } |
51 |
52 |
52 impl<M : ManifoldPoint> Grad<M> for DistToSquaredDiv2<M> { |
53 impl<M : ManifoldPoint> Grad<M> for DistToSquaredDiv2<M> { |
53 fn grad(&self, x : &M) -> M::Tangent { |
54 fn grad(&self, x : &M) -> M::Tangent { |