MatrixCategoryFunctions2(R1, Row1, Col1, M1, R2, Row2, Col2, M2)

matfuns.spad line 276 [edit on github]

MatrixCategoryFunctions2 provides functions between two matrix domains. The functions provided are map and reduce.

map : (Mapping(R2, R1), M1) -> M2

map(f, m) applies the function f to the elements of the matrix m.

map : (Mapping(Union(R2, "failed"), R1), M1) -> Union(M2, "failed")

map(f, m) applies the function f to the elements of the matrix m.

reduce : (Mapping(R2, R1, R2), M1, R2) -> R2

reduce(f, m, r) traverses m row by row passing m(i, j) as first argument to f. The second argument to f works as accumulator, value from previous call is passed to next call. On first call r is passed as second argument to f. Return value is the last result returned by f.