[Haskell-cafe] multMM :: Matrix -> Matrix -> Matrix --multiplies two matrices question (Homework)

조광래 kwangraecho at gmail.com
Wed Feb 3 01:38:17 EST 2010


hi i was trying to solve it but

All i got is
type Matrix=[[Double]]

multMM :: Matrix -> Matrix -> Matrix --multiplies two matrices
multMM m t =    [[sum (zipWith (*) (head m)(a)) ] ]where  a = [head a | a<-
t]


 Main> multMM [[2,1,-6],[1,-3,2]] [[1,0,-3],[0,4,20],[-2,1,1]]
[[14.0]]

from this i could get only the first multiplication 14    that is by  2*1 +
1*0 + -6*-2 = 14

how can i make this go throw all rows and colums to get multiple of matrixs?

Thank you~
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.haskell.org/pipermail/haskell-cafe/attachments/20100203/5379796e/attachment.html


More information about the Haskell-Cafe mailing list