matrix - How to sum two matrices in Scala? -
suppose define type matrix
vector[vector[int]]
, sum 2 matrices this:
type matrix = vector[vector[int]] val addup: (matrix, matrix) => matrix = (_, _).zipped map ((_, _).zipped map (_ + _))
is there library, provides generic zipped map
can simplify addup
?
Comments
Post a Comment