| 379 /// Iteratively solve the pointsource localisation with an additional variable |
382 /// Iteratively solve the pointsource localisation with an additional variable |
| 380 /// using sliding forward-backward splitting. |
383 /// using sliding forward-backward splitting. |
| 381 /// |
384 /// |
| 382 /// The implementation uses [`pointsource_sliding_pdps_pair`] with appropriate dummy |
385 /// The implementation uses [`pointsource_sliding_pdps_pair`] with appropriate dummy |
| 383 /// variables, operators, and functions. |
386 /// variables, operators, and functions. |
| |
387 #[replace_float_literals(F::cast_from(literal))] |
| |
388 pub fn pointsource_sliding_fb_pair_dom<F, I, S, Dat, Reg, P, Z, R, Plot, const N: usize>( |
| |
389 f: &Dat, |
| |
390 reg: &Reg, |
| |
391 prox_penalty: &P, |
| |
392 config: &SlidingFBConfig<F>, |
| |
393 iterator: I, |
| |
394 plotter: Plot, |
| |
395 (μ0, z): (Option<RNDM<N, F>>, Z), |
| |
396 //opKμ : KOpM, |
| |
397 fnR: &R, |
| |
398 domain: Option<&P::Dom> |
| |
399 ) -> DynResult<MeasureZ<F, Z, N>> |
| |
400 where |
| |
401 F: Float + ToNalgebraRealField, |
| |
402 I: AlgIteratorFactory<IterInfo<F>>, |
| |
403 Dat: DifferentiableMapping<MeasureZ<F, Z, N>, Codomain = F, DerivativeDomain = Pair<S, Z>> |
| |
404 + BoundedCurvature<F>, |
| |
405 S: DifferentiableRealMapping<N, F> + ClosedMul<F> + MinMaxMapping<Loc<N, F>, F>, |
| |
406 RNDM<N, F>: SpikeMerging<F>, |
| |
407 Reg: SlidingRegTerm<Loc<N, F>, F>, |
| |
408 P: TransportProxPenalty<Loc<N, F>, S, Reg, F>, |
| |
409 for<'a> Pair<&'a P, &'a IdOp<Z>>: StepLengthBoundPair<F, Dat>, |
| |
410 Z: ClosedEuclidean<F> + AXPY + Clone, |
| |
411 for<'b> &'b Z: Instance<Z>, |
| |
412 R: Prox<Z, Codomain = F>, |
| |
413 Plot: Plotter<P::ReturnMapping, S, RNDM<N, F>>, |
| |
414 // We should not need to explicitly require this: |
| |
415 for<'b> &'b Loc<0, F>: Instance<Loc<0, F>>, |
| |
416 // Loc<0, F>: StaticEuclidean<Field = F, PrincipalE = Loc<0, F>> |
| |
417 // + Instance<Loc<0, F>> |
| |
418 // + VectorSpace<Field = F>, |
| |
419 { |
| |
420 let opKz: ZeroOp<Z, Loc<0, F>, _, _, F> = |
| |
421 ZeroOp::new_dualisable(StaticEuclideanOriginGenerator, z.dual_origin()); |
| |
422 let fnH = Zero::new(); |
| |
423 // Convert config. We don't implement From (that could be done with the o2o crate), as σd0 |
| |
424 // needs to be chosen in a general case; for the problem of this fucntion, anything is valid. |
| |
425 let &SlidingFBConfig { τ0, σp0, insertion, transport, guess } = config; |
| |
426 let pdps_config = SlidingPDPSConfig { τ0, σp0, insertion, transport, guess, σd0: 0.0 }; |
| |
427 |
| |
428 pointsource_sliding_pdps_pair_dom( |
| |
429 f, |
| |
430 reg, |
| |
431 prox_penalty, |
| |
432 &pdps_config, |
| |
433 iterator, |
| |
434 plotter, |
| |
435 (μ0, z, Loc([])), |
| |
436 &opKz, |
| |
437 fnR, |
| |
438 &fnH, |
| |
439 domain |
| |
440 ) |
| |
441 } |
| |
442 |
| |
443 |
| |
444 #[deprecated] |
| |
445 /// Version of [`pointsource_sliding_pdps_pair`] without domain specification. |
| |
446 #[replace_float_literals(F::cast_from(literal))] |
| |
447 pub fn pointsource_sliding_pdps_pair< |
| |
448 F, |
| |
449 I, |
| |
450 S, |
| |
451 Dat, |
| |
452 Reg, |
| |
453 P, |
| |
454 Z, |
| |
455 R, |
| |
456 Y, |
| |
457 Plot, |
| |
458 /*KOpM, */ KOpZ, |
| |
459 H, |
| |
460 const N: usize, |
| |
461 >( |
| |
462 f: &Dat, |
| |
463 reg: &Reg, |
| |
464 prox_penalty: &P, |
| |
465 config: &SlidingPDPSConfig<F>, |
| |
466 iterator: I, |
| |
467 plotter: Plot, |
| |
468 init: (Option<RNDM<N, F>>, Z, Y), |
| |
469 //opKμ : KOpM, |
| |
470 opKz: &KOpZ, |
| |
471 fnR: &R, |
| |
472 fnH: &H, |
| |
473 ) -> DynResult<MeasureZ<F, Z, N>> |
| |
474 where |
| |
475 F: Float + ToNalgebraRealField, |
| |
476 I: AlgIteratorFactory<IterInfo<F>>, |
| |
477 Dat: DifferentiableMapping<MeasureZ<F, Z, N>, Codomain = F, DerivativeDomain = Pair<S, Z>> |
| |
478 + BoundedCurvature<F>, |
| |
479 S: DifferentiableRealMapping<N, F> + ClosedMul<F> + MinMaxMapping<Loc<N, F>, F>, |
| |
480 for<'a> Pair<&'a P, &'a IdOp<Z>>: StepLengthBoundPair<F, Dat>, |
| |
481 //Pair<S, Z>: ClosedMul<F>, |
| |
482 RNDM<N, F>: SpikeMerging<F>, |
| |
483 Reg: SlidingRegTerm<Loc<N, F>, F>, |
| |
484 P: TransportProxPenalty<Loc<N, F>, S, Reg, F>, |
| |
485 // KOpM : Linear<RNDM<N, F>, Codomain=Y> |
| |
486 // + GEMV<F, RNDM<N, F>> |
| |
487 // + Preadjointable< |
| |
488 // RNDM<N, F>, Y, |
| |
489 // PreadjointCodomain = S, |
| |
490 // > |
| |
491 // + TransportLipschitz<L2Squared, FloatType=F> |
| |
492 // + AdjointProductBoundedBy<RNDM<N, F>, 𝒟, FloatType=F>, |
| |
493 // for<'b> KOpM::Preadjoint<'b> : GEMV<F, Y>, |
| |
494 // Since Z is Hilbert, we may just as well use adjoints for K_z. |
| |
495 KOpZ: BoundedLinear<Z, L2, L2, F, Codomain = Y> |
| |
496 + GEMV<F, Z> |
| |
497 + SimplyAdjointable<Z, Y, AdjointCodomain = Z>, |
| |
498 KOpZ::SimpleAdjoint: GEMV<F, Y>, |
| |
499 Y: ClosedEuclidean<F>, |
| |
500 for<'b> &'b Y: Instance<Y>, |
| |
501 Z: ClosedEuclidean<F> + AXPY, |
| |
502 for<'b> &'b Z: Instance<Z>, |
| |
503 R: Prox<Z, Codomain = F>, |
| |
504 H: Conjugable<Y, F, Codomain = F>, |
| |
505 for<'b> H::Conjugate<'b>: Prox<Y>, |
| |
506 Plot: Plotter<P::ReturnMapping, S, RNDM<N, F>>, |
| |
507 { |
| |
508 pointsource_sliding_pdps_pair_dom( |
| |
509 f, |
| |
510 reg, |
| |
511 prox_penalty, |
| |
512 config, |
| |
513 iterator, |
| |
514 plotter, |
| |
515 init, |
| |
516 opKz, |
| |
517 fnR, |
| |
518 fnH, |
| |
519 None, |
| |
520 ) |
| |
521 } |
| |
522 |
| |
523 #[deprecated] |
| |
524 /// Version of [`pointsource_sliding_fb_pair_dom`] without domain specification |
| 384 #[replace_float_literals(F::cast_from(literal))] |
525 #[replace_float_literals(F::cast_from(literal))] |
| 385 pub fn pointsource_sliding_fb_pair<F, I, S, Dat, Reg, P, Z, R, Plot, const N: usize>( |
526 pub fn pointsource_sliding_fb_pair<F, I, S, Dat, Reg, P, Z, R, Plot, const N: usize>( |
| 386 f: &Dat, |
527 f: &Dat, |
| 387 reg: &Reg, |
528 reg: &Reg, |
| 388 prox_penalty: &P, |
529 prox_penalty: &P, |