diff -r 4f468d35fa29 -r 32328a74c790 src/prox_penalty.rs --- 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 { + /// 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 { /// Returns $L$. - fn step_length_bound(&self, f: &Dat) -> DynResult; + fn step_length_bound(&self, f: &Dat) -> StepLengthBoundValue; } /// A variant of [`StepLengthBound`] for step length parameters for [`Pair`]s of variables.