src/mapping.rs

branch
dev
changeset 36
6a4b44b2cdf2
parent 35
3b82a9d16307
child 39
dd144a972722
--- a/src/mapping.rs	Wed Oct 04 08:59:29 2023 -0500
+++ b/src/mapping.rs	Wed Oct 04 09:03:47 2023 -0500
@@ -42,13 +42,22 @@
     type Codomain = Codomain;
 }
 
-
+/// Automatically implemented shorthand for referring to [`Mapping`]s from [`Loc<F, N>`] to `F`.
 pub trait RealMapping<F : Float, const N : usize>
 : Mapping<Loc<F, N>, Codomain = F> {}
 
 impl<F : Float, T, const N : usize> RealMapping<F, N> for T
 where T : Mapping<Loc<F, N>, Codomain = F> {}
 
+/// Automatically implemented shorthand for referring to differentiable [`Mapping`]s from
+/// [`Loc<F, N>`] to `F`.
+pub trait DifferentiableRealMapping<F : Float, const N : usize>
+: DifferentiableMapping<Loc<F, N>, Codomain = F, Differential=Loc<F, N>> {}
+
+impl<F : Float, T, const N : usize> DifferentiableRealMapping<F, N> for T
+where T : DifferentiableMapping<Loc<F, N>, Codomain = F, Differential=Loc<F, N>> {}
+
+
 /// A helper trait alias for referring to [`Mapping`]s from [`Loc<F, N>`] to [`Loc<F, M>`].
 pub trait RealVectorField<F : Float, const N : usize, const M : usize>
 : Mapping<Loc<F, N>, Codomain = Loc<F, M>> {}

mercurial