From 2efb30876e9f7f2b3c1e7c07223610097387ae2b Mon Sep 17 00:00:00 2001 From: mitchmindtree Date: Sun, 21 Jun 2015 01:08:23 +1000 Subject: [PATCH] Added missing ops implementations for DMat --- src/structs/dmat.rs | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) 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;