factor_of_strong_convexity dev

Wed, 30 Apr 2025 00:48:56 -0500

author
Tuomo Valkonen <tuomov@iki.fi>
date
Wed, 30 Apr 2025 00:48:56 -0500
branch
dev
changeset 108
6be459f08b66
parent 107
441d30e66a4a
child 109
943c6b3b9414

factor_of_strong_convexity

src/convex.rs file | annotate | diff | comparison | revisions
--- 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<Domain: Space, F: Num = f64>: Mapping<Domain, Codomain = F> {}
+pub trait ConvexMapping<Domain: Space, F: Num = f64>: Mapping<Domain, Codomain = F> {
+    /// 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<Domain: Normed<F>, F: Float> ConvexMapping<Domain, F> for ZeroIndicator<Domain, F> {}
+impl<Domain: Normed<F>, F: Float> ConvexMapping<Domain, F> for ZeroIndicator<Domain, F> {
+    fn factor_of_strong_convexity(&self) -> F {
+        F::INFINITY
+    }
+}
 
 impl<Domain: HasDual<F>, F: Float> Conjugable<Domain, F> for ZeroIndicator<Domain, F> {
     type Conjugate<'a>
@@ -342,7 +353,11 @@
     }
 }
 
-impl<Domain: Euclidean<F>, F: Float> ConvexMapping<Domain, F> for Norm222<F> {}
+impl<Domain: Euclidean<F>, F: Float> ConvexMapping<Domain, F> for Norm222<F> {
+    fn factor_of_strong_convexity(&self) -> F {
+        F::ONE
+    }
+}
 
 impl<Domain: Euclidean<F>, F: Float> Conjugable<Domain, F> for Norm222<F> {
     type Conjugate<'a>

mercurial