MatrixCategoryFunctions2(R1, Row1, Col1, M1, R2, Row2, Col2, M2)ΒΆ
matfuns.spad line 276 [edit on github]
R1: Join(SemiRng, AbelianMonoid)
Row1: FiniteLinearAggregate R1
Col1: FiniteLinearAggregate R1
M1: MatrixCategory(R1, Row1, Col1)
R2: Join(SemiRng, AbelianMonoid)
Row2: FiniteLinearAggregate R2
Col2: FiniteLinearAggregate R2
M2: MatrixCategory(R2, Row2, Col2)
MatrixCategoryFunctions2 provides functions between two matrix domains. The functions provided are map and reduce.
- map: (R1 -> R2, M1) -> M2
map(f, m)
applies the functionf
to the elements of the matrixm
.
- map: (R1 -> Union(R2, failed), M1) -> Union(M2, failed)
map(f, m)
applies the functionf
to the elements of the matrixm
.
- reduce: ((R1, R2) -> R2, M1, R2) -> R2
reduce(f, m, r)
traversesm
row by row passingm
(i
,j
) as first argument tof
. The second argument tof
works as accumulator, value from previous call is passed to next call. On first callr
is passed as second argument tof
. Return value is the last result returned byf
.