| 3 */ |
3 */ |
| 4 |
4 |
| 5 use crate::error::DynResult; |
5 use crate::error::DynResult; |
| 6 use crate::euclidean::Euclidean; |
6 use crate::euclidean::Euclidean; |
| 7 use crate::instance::{DecompositionMut, Instance, InstanceMut}; |
7 use crate::instance::{DecompositionMut, Instance, InstanceMut}; |
| 8 use crate::linops::{IdOp, Scaled}; |
8 use crate::linops::{IdOp, Scaled, SimpleZeroOp, AXPY}; |
| 9 use crate::mapping::{DifferentiableImpl, LipschitzDifferentiableImpl, Mapping, Space}; |
9 use crate::mapping::{DifferentiableImpl, LipschitzDifferentiableImpl, Mapping, Space}; |
| 10 use crate::norms::*; |
10 use crate::norms::*; |
| 11 use crate::operator_arithmetic::{Constant, Weighted}; |
11 use crate::operator_arithmetic::{Constant, Weighted}; |
| 12 use crate::types::*; |
12 use crate::types::*; |
| 13 use serde::{Deserialize, Serialize}; |
13 use serde::{Deserialize, Serialize}; |
| 331 fn preconjugate(&self) -> Self::Preconjugate<'_> { |
331 fn preconjugate(&self) -> Self::Preconjugate<'_> { |
| 332 Zero::new() |
332 Zero::new() |
| 333 } |
333 } |
| 334 } |
334 } |
| 335 |
335 |
| |
336 impl<Domain, F> Prox<Domain> for ZeroIndicator<Domain, F> |
| |
337 where |
| |
338 Domain: AXPY<Field = F, Owned = Domain> + Normed<F>, |
| |
339 F: Float, |
| |
340 { |
| |
341 type Prox<'a> |
| |
342 = SimpleZeroOp |
| |
343 where |
| |
344 Self: 'a; |
| |
345 |
| |
346 /// Returns a proximal mapping with weight τ |
| |
347 fn prox_mapping(&self, _τ: F) -> Self::Prox<'_> { |
| |
348 return SimpleZeroOp; |
| |
349 } |
| |
350 } |
| |
351 |
| 336 /// The squared Euclidean norm divided by two |
352 /// The squared Euclidean norm divided by two |
| 337 #[derive(Copy, Clone, Serialize, Deserialize)] |
353 #[derive(Copy, Clone, Serialize, Deserialize)] |
| 338 pub struct Norm222<F: Float>(PhantomData<F>); |
354 pub struct Norm222<F: Float>(PhantomData<F>); |
| 339 |
355 |
| 340 impl</*Domain: Euclidean<F>,*/ F: Float> Norm222<F> { |
356 impl</*Domain: Euclidean<F>,*/ F: Float> Norm222<F> { |