--- a/src/mapping.rs Tue Sep 02 15:18:30 2025 -0500 +++ b/src/mapping.rs Wed Sep 03 08:40:17 2025 -0500 @@ -17,7 +17,7 @@ type Codomain: ClosedSpace; /// Compute the value of `self` at `x`. - fn apply<I: Instance<Domain>>(&self, x: I) -> Self::Codomain; + fn apply<I: Instance<Domain::OwnedSpace>>(&self, x: I) -> Self::Codomain; #[inline] /// Form the composition `self ∘ other` @@ -81,7 +81,7 @@ Self: 'b; /// Calculate differential at `x` - fn differential<I: Instance<Domain>>(&self, x: I) -> Self::DerivativeDomain; + fn differential<I: Instance<Domain::OwnedSpace>>(&self, x: I) -> Self::DerivativeDomain; /// Form the differential mapping of `self`. fn diff(self) -> Self::Differential<'static>; @@ -107,7 +107,7 @@ type Derivative: ClosedSpace; /// Compute the differential of `self` at `x`, consuming the input. - fn differential_impl<I: Instance<X>>(&self, x: I) -> Self::Derivative; + fn differential_impl<I: Instance<X::OwnedSpace>>(&self, x: I) -> Self::Derivative; } impl<T, Domain> DifferentiableMapping<Domain> for T @@ -122,7 +122,7 @@ Self: 'b; #[inline] - fn differential<I: Instance<Domain>>(&self, x: I) -> Self::DerivativeDomain { + fn differential<I: Instance<Domain::OwnedSpace>>(&self, x: I) -> Self::DerivativeDomain { self.differential_impl(x) } @@ -155,7 +155,7 @@ type Codomain = G::DerivativeDomain; #[inline] - fn apply<I: Instance<X>>(&self, x: I) -> Self::Codomain { + fn apply<I: Instance<X::OwnedSpace>>(&self, x: I) -> Self::Codomain { (*self.g).differential(x) } } @@ -175,7 +175,7 @@ type Codomain = F; #[inline] - fn apply<I: Instance<X>>(&self, x: I) -> Self::Codomain { + fn apply<I: Instance<X::OwnedSpace>>(&self, x: I) -> Self::Codomain { self.g.apply(x).flatten1d() } } @@ -207,7 +207,7 @@ type Codomain = F; #[inline] - fn apply<I: Instance<X>>(&self, x: I) -> Self::Codomain { + fn apply<I: Instance<X::OwnedSpace>>(&self, x: I) -> Self::Codomain { let tmp: [F; N] = (*self.g).apply(x).into(); // Safety: `slice_codomain` below checks the range. unsafe { *tmp.get_unchecked(self.slice) } @@ -253,7 +253,7 @@ type Codomain = S::Codomain; #[inline] - fn apply<I: Instance<X>>(&self, x: I) -> Self::Codomain { + fn apply<I: Instance<X::OwnedSpace>>(&self, x: I) -> Self::Codomain { self.outer.apply(self.inner.apply(x)) } } @@ -273,7 +273,7 @@ type Derivative = Y; /// Compute the differential of `self` at `x`, consuming the input. - fn differential_impl<I: Instance<X>>(&self, x: I) -> Self::Derivative { + fn differential_impl<I: Instance<X::OwnedSpace>>(&self, x: I) -> Self::Derivative { // Composition { // outer: self // .outer