# HG changeset patch # User Tuomo Valkonen # Date 1745992136 18000 # Node ID 6be459f08b66b242eec5a81e0a1a8b776d8a3f5d # Parent 441d30e66a4ad449dc6fb841efb7b75e21cc3422 factor_of_strong_convexity diff -r 441d30e66a4a -r 6be459f08b66 src/convex.rs --- a/src/convex.rs Wed Apr 30 00:29:16 2025 -0500 +++ b/src/convex.rs Wed Apr 30 00:48:56 2025 -0500 @@ -16,7 +16,14 @@ /// /// TODO: should constrain `Mapping::Codomain` to implement a partial order, /// but this makes everything complicated with little benefit. -pub trait ConvexMapping: Mapping {} +pub trait ConvexMapping: Mapping { + /// Returns (a lower estimate of) the factor of strong convexity. + /// + /// TODO: should include a specification of the respective norm. + fn factor_of_strong_convexity(&self) -> F { + F::ZERO + } +} /// Trait for mappings with a Fenchel conjugate /// @@ -293,7 +300,11 @@ } } -impl, F: Float> ConvexMapping for ZeroIndicator {} +impl, F: Float> ConvexMapping for ZeroIndicator { + fn factor_of_strong_convexity(&self) -> F { + F::INFINITY + } +} impl, F: Float> Conjugable for ZeroIndicator { type Conjugate<'a> @@ -342,7 +353,11 @@ } } -impl, F: Float> ConvexMapping for Norm222 {} +impl, F: Float> ConvexMapping for Norm222 { + fn factor_of_strong_convexity(&self) -> F { + F::ONE + } +} impl, F: Float> Conjugable for Norm222 { type Conjugate<'a>