src/mapping.rs

branch
dev
changeset 36
6a4b44b2cdf2
parent 35
3b82a9d16307
child 39
dd144a972722
equal deleted inserted replaced
35:3b82a9d16307 36:6a4b44b2cdf2
40 impl<Domain, Codomain, T> Mapping<Domain> for T 40 impl<Domain, Codomain, T> Mapping<Domain> for T
41 where T : Apply<Domain, Output=Codomain> + for<'a> Apply<&'a Domain, Output=Codomain> { 41 where T : Apply<Domain, Output=Codomain> + for<'a> Apply<&'a Domain, Output=Codomain> {
42 type Codomain = Codomain; 42 type Codomain = Codomain;
43 } 43 }
44 44
45 45 /// Automatically implemented shorthand for referring to [`Mapping`]s from [`Loc<F, N>`] to `F`.
46 pub trait RealMapping<F : Float, const N : usize> 46 pub trait RealMapping<F : Float, const N : usize>
47 : Mapping<Loc<F, N>, Codomain = F> {} 47 : Mapping<Loc<F, N>, Codomain = F> {}
48 48
49 impl<F : Float, T, const N : usize> RealMapping<F, N> for T 49 impl<F : Float, T, const N : usize> RealMapping<F, N> for T
50 where T : Mapping<Loc<F, N>, Codomain = F> {} 50 where T : Mapping<Loc<F, N>, Codomain = F> {}
51
52 /// Automatically implemented shorthand for referring to differentiable [`Mapping`]s from
53 /// [`Loc<F, N>`] to `F`.
54 pub trait DifferentiableRealMapping<F : Float, const N : usize>
55 : DifferentiableMapping<Loc<F, N>, Codomain = F, Differential=Loc<F, N>> {}
56
57 impl<F : Float, T, const N : usize> DifferentiableRealMapping<F, N> for T
58 where T : DifferentiableMapping<Loc<F, N>, Codomain = F, Differential=Loc<F, N>> {}
59
51 60
52 /// A helper trait alias for referring to [`Mapping`]s from [`Loc<F, N>`] to [`Loc<F, M>`]. 61 /// A helper trait alias for referring to [`Mapping`]s from [`Loc<F, N>`] to [`Loc<F, M>`].
53 pub trait RealVectorField<F : Float, const N : usize, const M : usize> 62 pub trait RealVectorField<F : Float, const N : usize, const M : usize>
54 : Mapping<Loc<F, N>, Codomain = Loc<F, M>> {} 63 : Mapping<Loc<F, N>, Codomain = Loc<F, M>> {}
55 64

mercurial