A-M baby
This commit is contained in:
parent
764da6cbbb
commit
db842d013d
19005 changed files with 197040 additions and 7 deletions
|
|
@ -0,0 +1,6 @@
|
|||
def mult[A](a: Array[Array[A]], b: Array[Array[A]])(implicit n: Numeric[A]) = {
|
||||
import n._
|
||||
for (row <- a)
|
||||
yield for(col <- b.transpose)
|
||||
yield row zip col map Function.tupled(_*_) reduceLeft (_+_)
|
||||
}
|
||||
|
|
@ -0,0 +1,7 @@
|
|||
def mult[A, CC[X] <: Seq[X], DD[Y] <: Seq[Y]](a: CC[DD[A]], b: CC[DD[A]])
|
||||
(implicit n: Numeric[A]): CC[DD[A]] = {
|
||||
import n._
|
||||
for (row <- a)
|
||||
yield for(col <- b.transpose)
|
||||
yield row zip col map Function.tupled(_*_) reduceLeft (_+_)
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue