diff --git a/src/structs/dvec_macros.rs b/src/structs/dvec_macros.rs index a33b64c7..92b745f1 100644 --- a/src/structs/dvec_macros.rs +++ b/src/structs/dvec_macros.rs @@ -186,6 +186,22 @@ macro_rules! dvec_impl( } } + impl + Zero> $mul> for $dvec { + #[inline] + fn binop(left: &$dvec, right: &$dvec) -> $dvec { + assert!(left.len() == right.len()); + FromIterator::from_iter(left.as_slice().iter().zip(right.as_slice().iter()).map(|(a, b)| *a * *b)) + } + } + + impl + Zero> $div> for $dvec { + #[inline] + fn binop(left: &$dvec, right: &$dvec) -> $dvec { + assert!(left.len() == right.len()); + FromIterator::from_iter(left.as_slice().iter().zip(right.as_slice().iter()).map(|(a, b)| *a / *b)) + } + } + impl + Zero> $add> for $dvec { #[inline] fn binop(left: &$dvec, right: &$dvec) -> $dvec {