internal static void refmul <M, N, T>(BlockMatrix <M, N, T> A, BlockVector <N, T> B, BlockVector <M, T> X) where M : ITypeNat, new() where N : ITypeNat, new() where T : struct { var m = nati <M>(); for (var i = 0; i < m; i++) { X[i] = t_dot.dot(A.GetRow(i), B); } }
static ref BlockMatrix <M, N, double> Mul <M, K, N>(BlockMatrix <M, K, double> A, BlockMatrix <K, N, double> B, ref BlockMatrix <M, N, double> X) where M : ITypeNat, new() where K : ITypeNat, new() where N : ITypeNat, new() { var m = nati <M>(); var n = nati <N>(); for (var i = 0; i < m; i++) { var row = A.GetRow(i); for (var j = 0; j < n; j++) { var col = B.GetCol(j); X[i, j] = Dot(row, col); } } return(ref X); }