src/bisection_tree/either.rs

branch
dev
changeset 29
7fd0984743b5
parent 27
00029c20c0ee
child 47
a0db98c16ab5
child 77
cf8ef9463664
equal deleted inserted replaced
28:331345346e7b 29:7fd0984743b5
1 1
2 use std::iter::Chain; 2 use std::iter::Chain;
3 use std::sync::Arc; 3 use std::sync::Arc;
4 4
5 use crate::types::*; 5 use crate::types::*;
6 use crate::mapping::{Apply, Differentiate}; 6 use crate::mapping::{Apply, Differentiable};
7 use crate::iter::{Mappable, MapF, MapZ}; 7 use crate::iter::{Mappable, MapF, MapZ};
8 use crate::sets::Cube; 8 use crate::sets::Cube;
9 use crate::loc::Loc; 9 use crate::loc::Loc;
10 10
11 use super::support::*; 11 use super::support::*;
188 EitherSupport::Right(ref b) => b.apply(x), 188 EitherSupport::Right(ref b) => b.apply(x),
189 } 189 }
190 } 190 }
191 } 191 }
192 192
193 impl<F, S1, S2, X> Differentiate<X> for EitherSupport<S1, S2> 193 impl<F, S1, S2, X> Differentiable<X> for EitherSupport<S1, S2>
194 where S1 : Differentiate<X, Output=F>, 194 where S1 : Differentiable<X, Output=F>,
195 S2 : Differentiate<X, Output=F> { 195 S2 : Differentiable<X, Output=F> {
196 type Output = F; 196 type Output = F;
197 #[inline] 197 #[inline]
198 fn differential(&self, x : X) -> F { 198 fn differential(&self, x : X) -> F {
199 match self { 199 match self {
200 EitherSupport::Left(ref a) => a.differential(x), 200 EitherSupport::Left(ref a) => a.differential(x),

mercurial