src/mapping.rs

branch
dev
changeset 110
a1278320be26
parent 105
103aa137fcb2
child 122
495448cca603
--- a/src/mapping.rs	Wed Apr 30 01:06:25 2025 -0500
+++ b/src/mapping.rs	Wed Apr 30 16:39:01 2025 -0500
@@ -2,6 +2,7 @@
 Traits for mathematical functions.
 */
 
+use crate::error::DynResult;
 pub use crate::instance::{BasicDecomposition, Decomposition, Instance, Space};
 use crate::loc::Loc;
 use crate::norms::{Norm, NormExponent};
@@ -324,7 +325,7 @@
     type FloatType: Float;
 
     /// Returns the Lipschitz factor of `self` with respect to the (semi)norm `D`.
-    fn lipschitz_factor(&self, seminorm: M) -> Option<Self::FloatType>;
+    fn lipschitz_factor(&self, seminorm: M) -> DynResult<Self::FloatType>;
 }
 
 /// Helper trait for implementing [`Lipschitz`] for mappings that implement [`DifferentiableImpl`].
@@ -332,7 +333,7 @@
     type FloatType: Float;
 
     /// Compute the lipschitz factor of the derivative of `f`.
-    fn diff_lipschitz_factor(&self, seminorm: M) -> Option<Self::FloatType>;
+    fn diff_lipschitz_factor(&self, seminorm: M) -> DynResult<Self::FloatType>;
 }
 
 impl<'b, M, X, A> Lipschitz<M> for Differential<'b, X, A>
@@ -342,7 +343,7 @@
 {
     type FloatType = A::FloatType;
 
-    fn lipschitz_factor(&self, seminorm: M) -> Option<Self::FloatType> {
+    fn lipschitz_factor(&self, seminorm: M) -> DynResult<Self::FloatType> {
         (*self.g).diff_lipschitz_factor(seminorm)
     }
 }

mercurial