scalar
sparse matrix (CSR format)
dense matrix
scalar
dense matrix
c = alpha * aᵀ × b + beta * c if beta does not equal null and c = alpha * aᵀ × b otherwise.
import mir.ndslice; import mir.sparse; auto sp = sparse!int(5, 3); sp[] = [[-5, -1, -5], [1, -5, -2], [7, 6, -3], [7, 3, 6], [-4, -3, 0]]; auto a = sp.compress; auto b = slice!double(5, 4); b[] = [[-5.0, -3, 3, 1], [4.0, 3, 6, 4], [-4.0, -2, -2, 2], [-1.0, 9, 4, 8], [9.0, 8, 3, -2]]; auto c = slice!double(3, 4); gemtm(1.0, a, b, 0, c); assert(c == [[-42.0, 35, -7, 77], [-69.0, -21, -42, 21], [23.0, 69, 3, 29]]);
General matrix-matrix multiplication with transformation.