Added missing ops implementations for DMat

This commit is contained in:
mitchmindtree 2015-06-21 01:08:23 +10:00
parent 51381ff84d
commit 2efb30876e
1 changed files with 18 additions and 0 deletions

View File

@ -700,6 +700,15 @@ impl<N: Copy + Add<N, Output = N>> Add<DMat<N>> for DMat<N> {
} }
} }
impl<'a, N: Copy + Add<N, Output = N>> Add<DMat<N>> for &'a DMat<N> {
type Output = DMat<N>;
#[inline]
fn add(self, right: DMat<N>) -> DMat<N> {
right + self
}
}
impl<'a, N: Copy + Add<N, Output = N>> Add<&'a DMat<N>> for DMat<N> { impl<'a, N: Copy + Add<N, Output = N>> Add<&'a DMat<N>> for DMat<N> {
type Output = DMat<N>; type Output = DMat<N>;
@ -742,6 +751,15 @@ impl<N: Copy + Sub<N, Output = N>> Sub<DMat<N>> for DMat<N> {
} }
} }
impl<'a, N: Copy + Sub<N, Output = N>> Sub<DMat<N>> for &'a DMat<N> {
type Output = DMat<N>;
#[inline]
fn sub(self, right: DMat<N>) -> DMat<N> {
right - self
}
}
impl<'a, N: Copy + Sub<N, Output = N>> Sub<&'a DMat<N>> for DMat<N> { impl<'a, N: Copy + Sub<N, Output = N>> Sub<&'a DMat<N>> for DMat<N> {
type Output = DMat<N>; type Output = DMat<N>;