summaryrefslogtreecommitdiff
path: root/packages/base/src/Internal/LAPACK.hs
diff options
context:
space:
mode:
authorAlberto Ruiz <aruiz@um.es>2015-06-06 18:42:42 +0200
committerAlberto Ruiz <aruiz@um.es>2015-06-06 18:42:42 +0200
commitc680fbb7a743b2fc519987a4d5f24bb9b675655f (patch)
treedfe7ad57aa6fe8c0a8427884db1b7a0ca85f73ba /packages/base/src/Internal/LAPACK.hs
parent66db67b299bd91f3cf35f93500e05eaf6c8085d3 (diff)
support for Int64 elements
Diffstat (limited to 'packages/base/src/Internal/LAPACK.hs')
-rw-r--r--packages/base/src/Internal/LAPACK.hs9
1 files changed, 9 insertions, 0 deletions
diff --git a/packages/base/src/Internal/LAPACK.hs b/packages/base/src/Internal/LAPACK.hs
index d6a2e6e..469b0d5 100644
--- a/packages/base/src/Internal/LAPACK.hs
+++ b/packages/base/src/Internal/LAPACK.hs
@@ -37,6 +37,7 @@ foreign import ccall unsafe "multiplyC" zgemmc :: CInt -> CInt -> TMMM C
37foreign import ccall unsafe "multiplyF" sgemmc :: CInt -> CInt -> TMMM F 37foreign import ccall unsafe "multiplyF" sgemmc :: CInt -> CInt -> TMMM F
38foreign import ccall unsafe "multiplyQ" cgemmc :: CInt -> CInt -> TMMM Q 38foreign import ccall unsafe "multiplyQ" cgemmc :: CInt -> CInt -> TMMM Q
39foreign import ccall unsafe "multiplyI" c_multiplyI :: CInt ::> CInt ::> CInt ::> Ok 39foreign import ccall unsafe "multiplyI" c_multiplyI :: CInt ::> CInt ::> CInt ::> Ok
40foreign import ccall unsafe "multiplyL" c_multiplyL :: Z ::> Z ::> Z ::> Ok
40 41
41isT Matrix{order = ColumnMajor} = 0 42isT Matrix{order = ColumnMajor} = 0
42isT Matrix{order = RowMajor} = 1 43isT Matrix{order = RowMajor} = 1
@@ -75,6 +76,14 @@ multiplyI a b = unsafePerformIO $ do
75 app3 c_multiplyI omat a omat b omat s "c_multiplyI" 76 app3 c_multiplyI omat a omat b omat s "c_multiplyI"
76 return s 77 return s
77 78
79multiplyL :: Matrix Z -> Matrix Z -> Matrix Z
80multiplyL a b = unsafePerformIO $ do
81 when (cols a /= rows b) $ error $
82 "inconsistent dimensions in matrix product "++ shSize a ++ " x " ++ shSize b
83 s <- createMatrix ColumnMajor (rows a) (cols b)
84 app3 c_multiplyL omat a omat b omat s "c_multiplyL"
85 return s
86
78----------------------------------------------------------------------------- 87-----------------------------------------------------------------------------
79 88
80type TSVD t = t ..> t ..> R :> t ..> Ok 89type TSVD t = t ..> t ..> R :> t ..> Ok