src/direct_product.rs

branch
dev
changeset 132
89371dc4d637
parent 130
0a689881b0f1
child 133
2b13f8a0c8ba
equal deleted inserted replaced
130:0a689881b0f1 132:89371dc4d637
268 where 268 where
269 A: Euclidean<F>, 269 A: Euclidean<F>,
270 B: Euclidean<F>, 270 B: Euclidean<F>,
271 //Pair<A, B>: Euclidean<F>, 271 //Pair<A, B>: Euclidean<F>,
272 Self: Sized 272 Self: Sized
273 + Mul<F, Output = Pair<A, B>> 273 + Mul<F, Output = <Self as AXPY>::Owned>
274 + MulAssign<F> 274 + MulAssign<F>
275 + Div<F, Output = Pair<A, B>> 275 + Div<F, Output = <Self as AXPY>::Owned>
276 + DivAssign<F> 276 + DivAssign<F>
277 + Add<Self, Output = Pair<A, B>> 277 + Add<Self, Output = <Self as AXPY>::Owned>
278 + Sub<Self, Output = Pair<A, B>> 278 + Sub<Self, Output = <Self as AXPY>::Owned>
279 + for<'b> Add<&'b Self, Output = Pair<A, B>> 279 + for<'b> Add<&'b Self, Output = <Self as AXPY>::Owned>
280 + for<'b> Sub<&'b Self, Output = Pair<A, B>> 280 + for<'b> Sub<&'b Self, Output = <Self as AXPY>::Owned>
281 + AddAssign<Self> 281 + AddAssign<Self>
282 + for<'b> AddAssign<&'b Self> 282 + for<'b> AddAssign<&'b Self>
283 + SubAssign<Self> 283 + SubAssign<Self>
284 + for<'b> SubAssign<&'b Self> 284 + for<'b> SubAssign<&'b Self>
285 + Neg<Output = Pair<A, B>>, 285 + Neg<Output = <Self as AXPY>::Owned>,
286 { 286 {
287 type Output = Pair<A, B>;
288
289 fn dot<I: Instance<Self>>(&self, other: I) -> F { 287 fn dot<I: Instance<Self>>(&self, other: I) -> F {
290 let Pair(u, v) = other.decompose(); 288 let Pair(u, v) = other.decompose();
291 self.0.dot(u) + self.1.dot(v) 289 self.0.dot(u) + self.1.dot(v)
292 } 290 }
293 291

mercurial