diff --git a/src/structs/dmat.rs b/src/structs/dmat.rs index 3c8b2c53..b55227fb 100644 --- a/src/structs/dmat.rs +++ b/src/structs/dmat.rs @@ -700,6 +700,15 @@ impl> Add> for DMat { } } +impl<'a, N: Copy + Add> Add> for &'a DMat { + type Output = DMat; + + #[inline] + fn add(self, right: DMat) -> DMat { + right + self + } +} + impl<'a, N: Copy + Add> Add<&'a DMat> for DMat { type Output = DMat; @@ -742,6 +751,15 @@ impl> Sub> for DMat { } } +impl<'a, N: Copy + Sub> Sub> for &'a DMat { + type Output = DMat; + + #[inline] + fn sub(self, right: DMat) -> DMat { + right - self + } +} + impl<'a, N: Copy + Sub> Sub<&'a DMat> for DMat { type Output = DMat;