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

Spring Boot + JPA + Hibernate: Unable to locate persister -

go - Golang: panic: runtime error: invalid memory address or nil pointer dereference using bufio.Scanner -

c - double free or corruption (fasttop) -