diff -r 6be459f08b66 -r 943c6b3b9414 src/convex.rs --- a/src/convex.rs Wed Apr 30 00:48:56 2025 -0500 +++ b/src/convex.rs Wed Apr 30 01:06:25 2025 -0500 @@ -16,10 +16,8 @@ /// /// TODO: should constrain `Mapping::Codomain` to implement a partial order, /// but this makes everything complicated with little benefit. -pub trait ConvexMapping: Mapping { - /// Returns (a lower estimate of) the factor of strong convexity. - /// - /// TODO: should include a specification of the respective norm. +pub trait ConvexMapping, F: Num = f64>: Mapping { + /// Returns (a lower estimate of) the factor of strong convexity in the norm of `Domain`. fn factor_of_strong_convexity(&self) -> F { F::ZERO } @@ -43,7 +41,7 @@ /// but a `Preconjugable` mapping has to be convex. pub trait Preconjugable: ConvexMapping where - Domain: Space, + Domain: Normed, Predual: HasDual, { type Preconjugate<'a>: Mapping @@ -90,7 +88,7 @@ impl ConvexMapping for NormMapping where - Domain: Space, + Domain: Normed, E: NormExponent, F: Float, Self: Mapping, @@ -116,7 +114,7 @@ impl ConvexMapping for NormConstraint where - Domain: Space, + Domain: Normed, E: NormExponent, F: Float, Self: Mapping, @@ -127,7 +125,7 @@ where E: HasDualExponent, F: Float, - Domain: HasDual + Norm + Space, + Domain: HasDual + Norm + Normed, >::DualSpace: Norm, { type Conjugate<'a> @@ -209,7 +207,7 @@ impl Mapping for NormProjection where - Domain: Space + Projection, + Domain: Normed + Projection, F: Float, E: NormExponent, { @@ -239,7 +237,7 @@ } } -impl ConvexMapping for Zero {} +impl, F: Float> ConvexMapping for Zero {} impl, F: Float> Conjugable for Zero { type Conjugate<'a> @@ -255,7 +253,7 @@ impl Preconjugable for Zero where - Domain: Space, + Domain: Normed, Predual: HasDual, { type Preconjugate<'a>