src/run.rs

changeset 98
b9818eb24b47
parent 96
5ba25d740dfc
--- a/src/run.rs	Fri Aug 14 10:38:27 2026 -0500
+++ b/src/run.rs	Fri Oct 02 12:03:25 2026 -0500
@@ -55,7 +55,7 @@
 };
 use alg_tools::maputil::map3;
 use alg_tools::nalgebra_support::ToNalgebraRealField;
-use alg_tools::norms::{Dist, NormExponent, L1, L2};
+use alg_tools::norms::{Dist, Norm, NormExponent, L1, L2};
 use alg_tools::operator_arithmetic::Weighted;
 use alg_tools::sets::Cube;
 use alg_tools::sets::SetOrd;
@@ -73,6 +73,7 @@
 use serde_json;
 use std::collections::HashMap;
 use std::hash::Hash;
+//use std::ops::Mul;
 use std::time::Instant;
 use thiserror::Error;
 
@@ -402,6 +403,10 @@
     pruned: usize,
     this_iters: usize,
     epsilon: F,
+    discrepancy: F,
+    aux_discrepancy: F,
+    joint_discrepancy: F,
+    radon_norm: F,
 }
 
 /// Collected experiment statistics
@@ -974,7 +979,7 @@
     A::Observable: AXPY,
     Reg: SlidingRegTerm<Loc<N, F>, F>,
     P: ProxPenalty<Loc<N, F>, A::PreadjointCodomain, Reg, F> + StepLengthBoundPD<F, A, RNDM<N, F>>,
-    RNDM<N, F>: SpikeMerging<F>,
+    RNDM<N, F>: SpikeMerging<F> + Norm<Radon, F>,
     I: AlgIteratorFactory<IterInfo<F>>,
     Plot: Plotter<P::ReturnMapping, A::PreadjointCodomain, RNDM<N, F>>,
 {
@@ -1421,10 +1426,10 @@
     I: AlgIteratorFactory<IterInfo<F>>,
     Dat: DifferentiableMapping<MeasureZ<F, Z, U>, Codomain = F, DerivativeDomain = Pair<S, Z>>
         + BoundedCurvature<F>,
-    S: ClosedMul<F>,
+    S: ClosedMul<F> + MinMaxMapping<U, F>,
     for<'a> Pair<&'a P, &'a IdOp<Z>>: StepLengthBoundPair<F, Dat>,
     //Pair<S, Z>: ClosedMul<F>,
-    DiscreteMeasure<U, F>: SpikeMerging<F>,
+    DiscreteMeasure<U, F>: SpikeMerging<F> + Norm<Radon, F>,
     Reg: SlidingRegTerm<U, F>,
     P: TransportProxPenalty<U, S, Reg, F>,
     KOpZ: BoundedLinear<Z, L2, L2, F, Codomain = Y>
@@ -1434,7 +1439,7 @@
     Y: ClosedEuclidean<F> + Clone,
     for<'b> &'b Y: Instance<Y>,
     Z: ClosedEuclidean<F> + Clone + ClosedMul<F> + AXPY,
-    for<'b> &'b Z: Instance<Z>,
+    for<'b> &'b Z: Instance<Z>, // compiler overflow  + Mul<F, Output = Z>,
     R: Prox<Z, Codomain = F>,
     H: Conjugable<Y, F, Codomain = F>,
     for<'b> H::Conjugate<'b>: Prox<Y>,
@@ -1485,10 +1490,10 @@
     I: AlgIteratorFactory<IterInfo<F>>,
     Dat: DifferentiableMapping<MeasureZ<F, Z, U>, Codomain = F, DerivativeDomain = Pair<S, Z>>
         + BoundedCurvature<F>,
-    S: ClosedMul<F>,
+    S: ClosedMul<F> + MinMaxMapping<U, F>,
     for<'a> Pair<&'a P, &'a IdOp<Z>>: StepLengthBoundPair<F, Dat>,
     //Pair<S, Z>: ClosedMul<F>,
-    DiscreteMeasure<U, F>: SpikeMerging<F>,
+    DiscreteMeasure<U, F>: SpikeMerging<F> + Norm<Radon, F>,
     Reg: SlidingRegTerm<U, F>,
     P: TransportProxPenalty<U, S, Reg, F>,
     KOpZ: BoundedLinear<Z, L2, L2, F, Codomain = Y>
@@ -1498,7 +1503,7 @@
     Y: ClosedEuclidean<F> + Clone,
     for<'b> &'b Y: Instance<Y>,
     Z: ClosedEuclidean<F> + Clone + ClosedMul<F> + AXPY,
-    for<'b> &'b Z: Instance<Z>,
+    for<'b> &'b Z: Instance<Z>, // compiler overflow  + Mul<F, Output = Z>,
     R: Prox<Z, Codomain = F>,
     H: Conjugable<Y, F, Codomain = F>,
     for<'b> H::Conjugate<'b>: Prox<Y>,
@@ -1572,13 +1577,13 @@
     I: AlgIteratorFactory<IterInfo<F>>,
     Dat: DifferentiableMapping<MeasureZ<F, Z, U>, Codomain = F, DerivativeDomain = Pair<S, Z>>
         + BoundedCurvature<F>,
-    S: ClosedMul<F>,
-    DiscreteMeasure<U, F>: SpikeMerging<F>,
+    S: ClosedMul<F> + MinMaxMapping<U, F>,
+    DiscreteMeasure<U, F>: SpikeMerging<F> + Norm<Radon, F>,
     Reg: SlidingRegTerm<U, F>,
     P: TransportProxPenalty<U, S, Reg, F>,
     for<'a> Pair<&'a P, &'a IdOp<Z>>: StepLengthBoundPair<F, Dat>,
     Z: ClosedEuclidean<F> + AXPY + Clone,
-    for<'b> &'b Z: Instance<Z>,
+    for<'b> &'b Z: Instance<Z>, // compiler overflow  + Mul<F, Output = Z>,
     R: Prox<Z, Codomain = F>,
     Plot: Plotter<P::ReturnMapping, S, DiscreteMeasure<U, F>>,
 {
@@ -1615,13 +1620,13 @@
     I: AlgIteratorFactory<IterInfo<F>>,
     Dat: DifferentiableMapping<MeasureZ<F, Z, U>, Codomain = F, DerivativeDomain = Pair<S, Z>>
         + BoundedCurvature<F>,
-    S: ClosedMul<F>,
-    DiscreteMeasure<U, F>: SpikeMerging<F>,
+    S: ClosedMul<F> + MinMaxMapping<U, F>,
+    DiscreteMeasure<U, F>: SpikeMerging<F> + Norm<Radon, F>,
     Reg: SlidingRegTerm<U, F>,
     P: TransportProxPenalty<U, S, Reg, F>,
     for<'a> Pair<&'a P, &'a IdOp<Z>>: StepLengthBoundPair<F, Dat>,
     Z: ClosedEuclidean<F> + AXPY + Clone,
-    for<'b> &'b Z: Instance<Z>,
+    for<'b> &'b Z: Instance<Z>, // compiler overflow  + Mul<F, Output = Z>,
     R: Prox<Z, Codomain = F>,
     Plot: Plotter<P::ReturnMapping, S, DiscreteMeasure<U, F>>,
 {
@@ -1712,8 +1717,12 @@
             inner_iters,
             merged,
             pruned,
+            discrepancy,
+            aux_discrepancy,
+            joint_discrepancy,
             //postprocessing,
             this_iters,
+            μ_norm,
             ε,
             ..
         } = data;
@@ -1742,7 +1751,11 @@
             merged,
             pruned,
             this_iters,
+            radon_norm: μ_norm,
             epsilon: ε,
+            discrepancy: discrepancy.unwrap_or(F::NEG_INFINITY),
+            aux_discrepancy: aux_discrepancy.unwrap_or(F::NEG_INFINITY),
+            joint_discrepancy: joint_discrepancy.unwrap_or(F::NEG_INFINITY),
         }
     };
 

mercurial