src/prox_penalty.rs

branch
dev
changeset 62
32328a74c790
parent 61
4f468d35fa29
--- a/src/prox_penalty.rs	Thu Feb 26 11:38:43 2026 -0500
+++ b/src/prox_penalty.rs	Fri Jan 16 19:39:22 2026 -0500
@@ -203,13 +203,24 @@
     }
 }
 
+/// Value for [`StepLengthBound`].
+#[derive(Copy, Clone, Debug, Serialize, Deserialize, PartialEq)]
+pub enum StepLengthBoundValue<F: Float> {
+    /// Lipschitz factor
+    LipschitzFactor(F),
+    /// Lipschitz factor, but should not be trusted, use adaptation instead
+    UnreliableLipschitzFactor(F),
+    /// None, failure
+    Failure,
+}
+
 /// Trait to calculate step length bound by `Dat` when the proximal penalty is `Self`,
 /// which is typically also a [`ProxPenalty`]. If it is given by a (squared) norm $\|.\|_*$, and
 /// and `Dat` respresents the function $f$, then this trait should calculate `L` such that
 /// $\|f'(x)-f'(y)\| ≤ L\|x-y\|_*, where the step length is supposed to satisfy $τ L ≤ 1$.
 pub trait StepLengthBound<F: Float, Dat> {
     /// Returns $L$.
-    fn step_length_bound(&self, f: &Dat) -> DynResult<F>;
+    fn step_length_bound(&self, f: &Dat) -> StepLengthBoundValue<F>;
 }
 
 /// A variant of [`StepLengthBound`] for step length parameters for [`Pair`]s of variables.

mercurial