From fdf8d8778d52cf14aec493ef5ab18d363b900ed7 Mon Sep 17 00:00:00 2001 From: Reiner Pope Date: Sat, 7 Jan 2012 11:47:06 +1100 Subject: Make Matrix a product type --- lib/Numeric/LinearAlgebra/LAPACK.hs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'lib/Numeric') diff --git a/lib/Numeric/LinearAlgebra/LAPACK.hs b/lib/Numeric/LinearAlgebra/LAPACK.hs index d1aa564..349650c 100644 --- a/lib/Numeric/LinearAlgebra/LAPACK.hs +++ b/lib/Numeric/LinearAlgebra/LAPACK.hs @@ -58,11 +58,11 @@ foreign import ccall "multiplyC" zgemmc :: CInt -> CInt -> TCMCMCM foreign import ccall "multiplyF" sgemmc :: CInt -> CInt -> TFMFMFM foreign import ccall "multiplyQ" cgemmc :: CInt -> CInt -> TQMQMQM -isT MF{} = 0 -isT MC{} = 1 +isT Matrix{order = ColumnMajor} = 0 +isT Matrix{order = RowMajor} = 1 -tt x@MF{} = x -tt x@MC{} = trans x +tt x@Matrix{order = RowMajor} = x +tt x@Matrix{order = ColumnMajor} = trans x multiplyAux f st a b = unsafePerformIO $ do when (cols a /= rows b) $ error $ "inconsistent dimensions in matrix product "++ -- cgit v1.2.3