| 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() |