[Haskell-cafe] Matrices

Cetin Sert cetin.sert at gmail.com
Sun Apr 19 05:53:43 EDT 2009


given two matrices,

Prelude Data.Matrix.Dense Data.Vector.Dense> m
listMatrix (2,2) [46.0,37.0,71.0,83.0]
Prelude Data.Matrix.Dense Data.Vector.Dense> es
listMatrix (2,2)

how can I flatten them to do:
[ (o-e)^2 / e | o <- m, e <- es ]

or use a function that will apply a given function to every
corresponding elements of 2 or n matrices and create a result matrix?

If I should use a different matrix type or library altogether, please
specify which one and how ^__^"

Best Regards,
Cetin Sert

More information about the Haskell-Cafe mailing list