87:72968cf30033 | 88:086a59b3a2b4 |
---|---|
66 *y = self.prox(τ, &*y); | 66 *y = self.prox(τ, &*y); |
67 } | 67 } |
68 } | 68 } |
69 | 69 |
70 | 70 |
71 /// Constraint to the unit ball of the norm described by `E`. | |
71 pub struct NormConstraint<F : Float, E : NormExponent> { | 72 pub struct NormConstraint<F : Float, E : NormExponent> { |
72 radius : F, | 73 radius : F, |
73 norm : NormMapping<F, E>, | 74 norm : NormMapping<F, E>, |
74 } | 75 } |
75 | |
76 | 76 |
77 impl<Domain, E, F> ConvexMapping<Domain, F> for NormMapping<F, E> | 77 impl<Domain, E, F> ConvexMapping<Domain, F> for NormMapping<F, E> |
78 where | 78 where |
79 Domain : Space, | 79 Domain : Space, |
80 E : NormExponent, | 80 E : NormExponent, |
158 assert!(self.radius >= F::ZERO); | 158 assert!(self.radius >= F::ZERO); |
159 NormProjection{ radius : self.radius, exponent : self.norm.exponent } | 159 NormProjection{ radius : self.radius, exponent : self.norm.exponent } |
160 } | 160 } |
161 } | 161 } |
162 | 162 |
163 /// Projection to the unit ball of the norm described by `E`. | |
163 pub struct NormProjection<F : Float, E : NormExponent> { | 164 pub struct NormProjection<F : Float, E : NormExponent> { |
164 radius : F, | 165 radius : F, |
165 exponent : E, | 166 exponent : E, |
166 } | 167 } |
167 | 168 |