# HG changeset patch # User Tuomo Valkonen # Date 1682678523 -10800 # Node ID 7fd0984743b5c3d3b138226944fad6d7469bdf98 # Parent 331345346e7b8b9365832b50e001eb61d0e2e27a Rename Differentiate → Differentiable diff -r 331345346e7b -r 7fd0984743b5 src/bisection_tree/btfn.rs --- a/src/bisection_tree/btfn.rs Fri Apr 28 09:03:21 2023 +0300 +++ b/src/bisection_tree/btfn.rs Fri Apr 28 13:42:03 2023 +0300 @@ -4,7 +4,7 @@ use std::marker::PhantomData; use std::sync::Arc; use crate::types::Float; -use crate::mapping::{Apply, Mapping, Differentiate}; +use crate::mapping::{Apply, Mapping, Differentiable}; //use crate::linops::{Apply, Linear}; use crate::sets::Set; use crate::sets::Cube; @@ -420,11 +420,11 @@ } } -impl<'a, F : Float, G, BT, V, const N : usize> Differentiate<&'a Loc> +impl<'a, F : Float, G, BT, V, const N : usize> Differentiable<&'a Loc> for BTFN where BT : BTImpl, G : SupportGenerator, - G::SupportType : LocalAnalysis + Differentiate<&'a Loc, Output = V>, + G::SupportType : LocalAnalysis + Differentiable<&'a Loc, Output = V>, V : Sum { type Output = V; @@ -436,11 +436,11 @@ } } -impl Differentiate> +impl Differentiable> for BTFN where BT : BTImpl, G : SupportGenerator, - G::SupportType : LocalAnalysis + Differentiate, Output = V>, + G::SupportType : LocalAnalysis + Differentiable, Output = V>, V : Sum { type Output = V; diff -r 331345346e7b -r 7fd0984743b5 src/bisection_tree/either.rs --- a/src/bisection_tree/either.rs Fri Apr 28 09:03:21 2023 +0300 +++ b/src/bisection_tree/either.rs Fri Apr 28 13:42:03 2023 +0300 @@ -3,7 +3,7 @@ use std::sync::Arc; use crate::types::*; -use crate::mapping::{Apply, Differentiate}; +use crate::mapping::{Apply, Differentiable}; use crate::iter::{Mappable, MapF, MapZ}; use crate::sets::Cube; use crate::loc::Loc; @@ -190,9 +190,9 @@ } } -impl Differentiate for EitherSupport -where S1 : Differentiate, - S2 : Differentiate { +impl Differentiable for EitherSupport +where S1 : Differentiable, + S2 : Differentiable { type Output = F; #[inline] fn differential(&self, x : X) -> F { diff -r 331345346e7b -r 7fd0984743b5 src/mapping.rs --- a/src/mapping.rs Fri Apr 28 09:03:21 2023 +0300 +++ b/src/mapping.rs Fri Apr 28 13:42:03 2023 +0300 @@ -51,7 +51,7 @@ /// Trait for calculation the differential of `Self` as a mathematical function on `X`. -pub trait Differentiate { +pub trait Differentiable { type Output; /// Compute the differential of `self` at `x`. @@ -65,16 +65,16 @@ /// This is automatically implemented when the relevant [`Differentiate`] are implemented. pub trait DifferentiableMapping : Mapping - + Differentiate - + for<'a> Differentiate<&'a Domain, Output=Self::Differential>{ + + Differentiable + + for<'a> Differentiable<&'a Domain, Output=Self::Differential>{ type Differential; } impl DifferentiableMapping for T where T : Mapping - + Differentiate - + for<'a> Differentiate<&'a Domain, Output=Differential> { + + Differentiable + + for<'a> Differentiable<&'a Domain, Output=Differential> { type Differential = Differential; } @@ -103,7 +103,7 @@ } } -impl Differentiate for Sum +impl Differentiable for Sum where M : DifferentiableMapping, M :: Codomain : std::iter::Sum, M :: Differential : std::iter::Sum,