src/direct_product.rs

branch
dev
changeset 130
0a689881b0f1
parent 129
d2994e34a5f5
child 131
8264d72aa347
child 132
89371dc4d637
equal deleted inserted replaced
129:d2994e34a5f5 130:0a689881b0f1
177 // } 177 // }
178 }; 178 };
179 } 179 }
180 180
181 impl_scalar!(Mul, mul); 181 impl_scalar!(Mul, mul);
182 //impl_scalar!(Mul, mul, f64); 182 impl_scalar!(Div, div);
183 impl_scalar!(Sub, sub);
184 //impl_scalar!(Sub, sub, f64);
185 183
186 macro_rules! impl_scalar_lhs { 184 macro_rules! impl_scalar_lhs {
187 ($trait:ident, $fn:ident, $F:ty) => { 185 ($trait:ident, $fn:ident, $F:ty) => {
188 impl<A, B> $trait<Pair<A, B>> for $F 186 impl<A, B> $trait<Pair<A, B>> for $F
189 where 187 where
209 }; 207 };
210 } 208 }
211 209
212 impl_scalar_lhs!(Mul, mul, f32); 210 impl_scalar_lhs!(Mul, mul, f32);
213 impl_scalar_lhs!(Mul, mul, f64); 211 impl_scalar_lhs!(Mul, mul, f64);
212 impl_scalar_lhs!(Div, div, f32);
213 impl_scalar_lhs!(Div, div, f64);
214 214
215 macro_rules! impl_binary_mut { 215 macro_rules! impl_binary_mut {
216 ($trait:ident, $fn:ident) => { 216 ($trait:ident, $fn:ident) => {
217 impl<'a, A, B, C, D> $trait<Pair<C, D>> for Pair<A, B> 217 impl<'a, A, B, C, D> $trait<Pair<C, D>> for Pair<A, B>
218 where 218 where
306 U: Space, 306 U: Space,
307 V: Space, 307 V: Space,
308 A: AXPY<U, Field = F>, 308 A: AXPY<U, Field = F>,
309 B: AXPY<V, Field = F>, 309 B: AXPY<V, Field = F>,
310 F: Num, 310 F: Num,
311 Self: MulAssign<F>, 311 Self: MulAssign<F> + DivAssign<F>,
312 Pair<A, B>: MulAssign<F>, 312 Pair<A, B>: MulAssign<F> + DivAssign<F>,
313 //A::Owned: MulAssign<F>, 313 //A::Owned: MulAssign<F>,
314 //B::Owned: MulAssign<F>, 314 //B::Owned: MulAssign<F>,
315 //Pair<A::Owned, B::Owned>: AXPY<Pair<U, V>, Field = F>, 315 //Pair<A::Owned, B::Owned>: AXPY<Pair<U, V>, Field = F>,
316 { 316 {
317 type Field = F; 317 type Field = F;

mercurial