i dont know how to declare the function for matrix multiplication.
i want to do matrix.mult(other_mat) .
i have this right now:
pub fn mul(self: Self, comptime other_cols: usize, other: Matrix(T, cols, other_cols)) Matrix(T, rows, other_cols) {
const p = other_cols;
var out = Matrix(T, rows, p).init();
for (0..rows) |i| {
for (0..p) |j| {
var s: T = 0;
for (0..cols) |k| {
s += self.get(i, k) * other.get(k, j);
}
out.set(i, j, s);
}
}
return out;
}
but using this is very wierd:
mat.mult(2, other_mat); // 2 is the number of cols of other_mat