From 0412ac54d5654273a3412590e22c3ea4ebacfded Mon Sep 17 00:00:00 2001 From: Zhongheng Liu Date: Thu, 23 Jan 2025 00:28:43 +0200 Subject: [PATCH] feat!: method stubs for mult and sub --- Cargo.lock | 2 +- Cargo.toml | 2 +- src/types/matrix.rs | 14 +++++++++++++- 3 files changed, 15 insertions(+), 3 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 1cb9447..221110f 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -4,4 +4,4 @@ version = 3 [[package]] name = "matrix" -version = "0.1.3" +version = "0.1.5" diff --git a/Cargo.toml b/Cargo.toml index 526884d..1480575 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "matrix" -version = "0.1.4-1" +version = "0.1.5" edition = "2021" authors = ["Zhongheng Liu "] homepage = "https://stvnliu.gitlab.io" diff --git a/src/types/matrix.rs b/src/types/matrix.rs index e3a04ff..40ecedf 100644 --- a/src/types/matrix.rs +++ b/src/types/matrix.rs @@ -10,7 +10,7 @@ //! //! TODO:: Create matrix multiplication method -use std::{fmt::Display, ops::Add, str::FromStr}; +use std::{fmt::Display, ops::{Add, Mul, Sub}, str::FromStr}; use super::matrix_err::{MatrixSetValueError, ParseMatrixError}; #[derive(Debug, PartialEq, Eq)] @@ -86,6 +86,18 @@ impl<'a, 'b> Add<&'b Matrix> for &'a Matrix { x } } +impl<'a, 'b> Sub<&'b Matrix> for &'a Matrix { + type Output = Matrix; + fn sub(self, rhs: &'b Matrix) -> Self::Output { + todo!() + } +} +impl<'a, 'b> Mul<&'b Matrix> for &'a Matrix { + type Output = Matrix; + fn mul(self, rhs: &'b Matrix) -> Self::Output { + todo!() + } +} impl Matrix { /// Matrix initialiser function.