src/convex.rs

branch
dev
changeset 146
3f9a03f95457
parent 132
89371dc4d637
child 150
c4e394a9c84c
equal deleted inserted replaced
145:0b9aecd7bb76 146:3f9a03f95457
133 = NormConstraint<F, E::DualExp> 133 = NormConstraint<F, E::DualExp>
134 where 134 where
135 Self: 'a; 135 Self: 'a;
136 136
137 fn conjugate(&self) -> Self::Conjugate<'_> { 137 fn conjugate(&self) -> Self::Conjugate<'_> {
138 NormConstraint { 138 NormConstraint { radius: F::ONE, norm: self.exponent.dual_exponent().as_mapping() }
139 radius: F::ONE,
140 norm: self.exponent.dual_exponent().as_mapping(),
141 }
142 } 139 }
143 } 140 }
144 141
145 impl<C, E, F, Domain> Conjugable<Domain, F> for Weighted<NormMapping<F, E>, C> 142 impl<C, E, F, Domain> Conjugable<Domain, F> for Weighted<NormMapping<F, E>, C>
146 where 143 where
176 Self: 'a; 173 Self: 'a;
177 174
178 #[inline] 175 #[inline]
179 fn prox_mapping(&self, _τ: Self::Codomain) -> Self::Prox<'_> { 176 fn prox_mapping(&self, _τ: Self::Codomain) -> Self::Prox<'_> {
180 assert!(self.radius >= F::ZERO); 177 assert!(self.radius >= F::ZERO);
181 NormProjection { 178 NormProjection { radius: self.radius, exponent: self.norm.exponent }
182 radius: self.radius,
183 exponent: self.norm.exponent,
184 }
185 } 179 }
186 } 180 }
187 181
188 /// Projection to the unit ball of the norm described by `E`. 182 /// Projection to the unit ball of the norm described by `E`.
189 #[derive(Copy, Clone, Debug, Serialize, Deserialize)] 183 #[derive(Copy, Clone, Debug, Serialize, Deserialize)]

mercurial