From 0cd1f377cbf1a555d6de211b5ef02f9c65f1db2e Mon Sep 17 00:00:00 2001 From: Christoph Groth Date: Thu, 24 Oct 2024 13:32:20 +0200 Subject: Make matmul generic over dimensions --- src/main.rs | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'src/main.rs') diff --git a/src/main.rs b/src/main.rs index edd202d..1627396 100644 --- a/src/main.rs +++ b/src/main.rs @@ -1,7 +1,10 @@ -use mdarray::{view, tensor, DSlice, Expression}; +use mdarray::{view, tensor, Slice, Expression, Dim}; // Indexing convention: C_ij <- A_ik * B_kj -fn matmul(a: &DSlice, b: &DSlice, c: &mut DSlice) { +fn matmul( + a: &Slice, + b: &Slice, + c: &mut Slice) { for (mut ci, ai) in c.rows_mut().zip(a.rows()) { for (aik, bk) in ai.zip(b.rows()) { for (cij, bkj) in ci.expr_mut().zip(bk) { -- cgit v1.2.3-74-g4815