src/dist.rs

changeset 53
60928f1440e0
parent 17
ad68dacabe4f
child 55
15f01efc034b
equal deleted inserted replaced
52:1d8e5731a4d3 53:60928f1440e0
59 x.log(&self.0) 59 x.log(&self.0)
60 } 60 }
61 } 61 }
62 62
63 impl<M : ManifoldPoint> Prox<M> for DistTo<M> { 63 impl<M : ManifoldPoint> Prox<M> for DistTo<M> {
64 /// This is proximal map is a type of soft-thresholding on manifolds. 64 /// This proximal map is a type of soft-thresholding on manifolds.
65 fn prox(&self, τ : f64, x : M) -> M { 65 fn prox(&self, τ : f64, x : M) -> M {
66 let v = x.log(&self.0); 66 let v = x.log(&self.0);
67 let d = v.norm2(); 67 let d = v.norm2();
68 if d <= τ { 68 if d <= τ {
69 self.0.clone() 69 self.0.clone()

mercurial