From 00c4b7c44b1364381c65dccbb190d64b3ff4c1e8 Mon Sep 17 00:00:00 2001 From: hachem Date: Sat, 12 Oct 2024 19:01:40 +0200 Subject: Refactor 3: Matrices and fixed complex number matrix printing --- libpsi-core/src/maths/matrix_ops.rs | 62 ------------------------------------- 1 file changed, 62 deletions(-) delete mode 100644 libpsi-core/src/maths/matrix_ops.rs (limited to 'libpsi-core/src/maths/matrix_ops.rs') diff --git a/libpsi-core/src/maths/matrix_ops.rs b/libpsi-core/src/maths/matrix_ops.rs deleted file mode 100644 index 15ab28b..0000000 --- a/libpsi-core/src/maths/matrix_ops.rs +++ /dev/null @@ -1,62 +0,0 @@ -use super::{Float, Matrix}; -use core::ops; - -impl ops::Add<&Matrix> for Matrix { - type Output = Option>; - - fn add(self, other: &Matrix) -> Self::Output { - self.add_to(other) - } -} - -impl ops::Sub<&Matrix> for Matrix { - type Output = Option>; - - fn sub(self, other: &Matrix) -> Self::Output { - self.subtract(other) - } -} - -impl ops::Mul for Matrix { - type Output = Matrix; - - fn mul(self, scalar: T) -> Self::Output { - self.scale(scalar) - } -} - -impl ops::Div for Matrix { - type Output = Matrix; - - fn div(self, scalar: T) -> Self::Output { - self.scale(T::one() / scalar) - } -} - -impl ops::AddAssign<&Matrix> for Matrix { - fn add_assign(&mut self, other: &Matrix) { - if let Some(result) = self.add_to(other) { - *self = result; - } - } -} - -impl ops::SubAssign<&Matrix> for Matrix { - fn sub_assign(&mut self, other: &Matrix) { - if let Some(result) = self.subtract(other) { - *self = result; - } - } -} - -impl ops::MulAssign for Matrix { - fn mul_assign(&mut self, scalar: T) { - *self = self.scale(scalar); - } -} - -impl ops::DivAssign for Matrix { - fn div_assign(&mut self, scalar: T) { - *self = self.scale(T::one() / scalar); - } -} -- cgit v1.3