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

Popular posts from this blog

PHP while loop dynamic rowspan -

timer - Java TimerTask cancel -

android - How to read a column value in parse.com without accessing an object or a pointer -