src/dist.rs

changeset 8
17d71ca4ce84
parent 7
8979a6638424
child 13
f67949050a32
equal deleted inserted replaced
7:8979a6638424 8:17d71ca4ce84
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 {

mercurial