189 } |
189 } |
190 } |
190 } |
191 } |
191 } |
192 |
192 |
193 impl<F, S1, S2, X> Differentiable<X> for EitherSupport<S1, S2> |
193 impl<F, S1, S2, X> Differentiable<X> for EitherSupport<S1, S2> |
194 where S1 : Differentiable<X, Output=F>, |
194 where S1 : Differentiable<X, Derivative=F>, |
195 S2 : Differentiable<X, Output=F> { |
195 S2 : Differentiable<X, Derivative=F> { |
196 type Output = F; |
196 type Derivative = 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), |
201 EitherSupport::Right(ref b) => b.differential(x), |
201 EitherSupport::Right(ref b) => b.differential(x), |