diff -r 9f2214c961cb -r cf8ef9463664 src/bisection_tree/either.rs --- a/src/bisection_tree/either.rs Fri Apr 28 14:02:18 2023 +0300 +++ b/src/bisection_tree/either.rs Tue Jul 18 15:44:10 2023 +0300 @@ -190,17 +190,34 @@ } } -impl Differentiable for EitherSupport -where S1 : Differentiable, - S2 : Differentiable { - type Output = F; +impl Differentiable for EitherSupport +where S1 : Differentiable + Apply, + S2 : Differentiable + Apply { + type Output = D; + #[inline] - fn differential(&self, x : X) -> F { + fn differential(&self, x : X) -> D { match self { EitherSupport::Left(ref a) => a.differential(x), EitherSupport::Right(ref b) => b.differential(x), } } + + #[inline] + fn linearisation_error(&self, x : X, y : X) -> F { + match self { + EitherSupport::Left(ref a) => a.linearisation_error(x, y), + EitherSupport::Right(ref b) => b.linearisation_error(x, y), + } + } + + #[inline] + fn linearisation_error_gen(&self, x : X, y : X, z : X) -> F { + match self { + EitherSupport::Left(ref a) => a.linearisation_error_gen(x, y, z), + EitherSupport::Right(ref b) => b.linearisation_error_gen(x, y, z), + } + } } macro_rules! make_either_scalarop_rhs {