Hello. How can I multiply matrices (of Doubles) with dph (-0.4.0)? (ghc-6.12.1) - I was trying
type Vector = [:Double:]
type Matrix = [:Vector:]
times :: Matrix -> Matrix -> Matrix
times a b =
mapP
( \ row -> mapP ( \ col -> sumP ( zipWithP (*) row col ) )
( transposeP b )
) a
but there is no such thing as transposeP.
When I try any kind of index manipulations,
the compiler invariably tells me
that it does not want to build [: :] - lists of indices
(e.g., there is no enumFromToP)
(I guess because I'm using Data.Array.Parallel.Prelude.Double)
Puzzled - J.W.
PS: what's the recommended way to multiply matrices
(better modelled as Array (Int,Int) Double or [[Double]] ?)
with the par/pseq approach (if this is recommended at all)?
As I said earlier, I just want to have some nice and easy benchmarks
for demonstration in a lecture (to be run on 2, 4, or 8 cores).
Of course if they work, I'd use them in real life as well...
signature.asc
Description: OpenPGP digital signature
_______________________________________________ Haskell-Cafe mailing list [email protected] http://www.haskell.org/mailman/listinfo/haskell-cafe
