diff -r c5f70e767511 -r e5fab0125a8e src/mapping.rs --- a/src/mapping.rs Tue Dec 31 08:48:50 2024 -0500 +++ b/src/mapping.rs Thu Dec 26 12:35:53 2024 -0500 @@ -127,53 +127,6 @@ } } -/// A sum of [`Mapping`]s. -#[derive(Serialize, Debug, Clone)] -pub struct Sum { - components : Vec, - _domain : PhantomData, -} - -impl Sum { - /// Construct from an iterator. - pub fn new>(iter : I) -> Self { - Sum { components : iter.collect(), _domain : PhantomData } - } - - /// Iterate over the component functions of the sum - pub fn iter(&self) -> std::slice::Iter<'_, M> { - self.components.iter() - } -} - - -impl Mapping for Sum -where - Domain : Space + Clone, - M : Mapping, - M::Codomain : std::iter::Sum + Clone -{ - type Codomain = M::Codomain; - - fn apply>(&self, x : I) -> Self::Codomain { - let xr = x.ref_instance(); - self.components.iter().map(|c| c.apply(xr)).sum() - } -} - -impl DifferentiableImpl for Sum -where - Domain : Space + Clone, - M : DifferentiableMapping, - M :: DerivativeDomain : std::iter::Sum -{ - type Derivative = M::DerivativeDomain; - - fn differential_impl>(&self, x : I) -> Self::Derivative { - let xr = x.ref_instance(); - self.components.iter().map(|c| c.differential(xr)).sum() - } -} /// Container for the differential [`Mapping`] of a [`Differentiable`] mapping. pub struct Differential<'a, X, G : Clone> {