aboutsummaryrefslogtreecommitdiff
path: root/mu/src/main.rs
diff options
context:
space:
mode:
authorhachem <im@hachem.wtf>2024-09-16 09:41:54 +0200
committerhachem <im@hachem.wtf>2024-09-16 09:41:54 +0200
commit6d750e1ca95f7c4dcf4423b9cebc30fdc471d083 (patch)
tree45e3206a25556b3a4b21b3e873f85137fb467f49 /mu/src/main.rs
parentfea812469ad0a2099e100a4f232b121f5adeec79 (diff)
Matrix struct
Diffstat (limited to 'mu/src/main.rs')
-rw-r--r--mu/src/main.rs19
1 files changed, 18 insertions, 1 deletions
diff --git a/mu/src/main.rs b/mu/src/main.rs
index f328e4d..e3f23b2 100644
--- a/mu/src/main.rs
+++ b/mu/src/main.rs
@@ -1 +1,18 @@
-fn main() {}
+use libmu::Matrix;
+
+fn main() {
+ let mat1 = Matrix::<f32>::new(2, 2, vec![1.0, 2.0, 3.0, 4.0]);
+ let mat2 = Matrix::<f32>::new(2, 2, vec![5.0, 6.0, 7.0, 8.0]);
+
+ let dot_product = mat1.dot(&mat2);
+ let kronecker_product = mat1.kronecker(&mat2);
+
+ println!("Matrix 1:\n{}", mat1);
+ println!("Matrix 2:\n{}", mat2);
+
+ if let Some(dp) = dot_product {
+ println!("Dot Product Matrix:\n{}", dp);
+ }
+
+ println!("Kronecker Product Matrix:\n{}", kronecker_product);
+}