feat!: method stubs for mult and sub

This commit is contained in:
Zhongheng Liu 2025-01-23 00:28:43 +02:00
commit 0412ac54d5
Signed by: steven
GPG key ID: 805A28B071DAD84B
3 changed files with 15 additions and 3 deletions

2
Cargo.lock generated
View file

@ -4,4 +4,4 @@ version = 3
[[package]]
name = "matrix"
version = "0.1.3"
version = "0.1.5"

View file

@ -1,6 +1,6 @@
[package]
name = "matrix"
version = "0.1.4-1"
version = "0.1.5"
edition = "2021"
authors = ["Zhongheng Liu <z.liu@outlook.com.gr>"]
homepage = "https://stvnliu.gitlab.io"

View file

@ -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.