matfuns.spad line 344 [edit on github]
RectangularMatrixCategoryFunctions2 provides functions between two matrix domains. The functions provided are map and reduce.
map(f, m) applies the function f to the elements of the matrix m.
reduce(f, m, r) returns a matrix n where n[i, j] = f(m[i, j], r) for all indices spadi and j.