From 6058e1b17c005be1ea95ebb7d98d9fd15bb538d2 Mon Sep 17 00:00:00 2001 From: Alberto Ruiz Date: Thu, 26 Aug 2010 17:49:45 +0000 Subject: Float matrix product --- lib/Numeric/LinearAlgebra/LAPACK.hs | 18 ++++++++++++++---- 1 file changed, 14 insertions(+), 4 deletions(-) (limited to 'lib/Numeric/LinearAlgebra/LAPACK.hs') diff --git a/lib/Numeric/LinearAlgebra/LAPACK.hs b/lib/Numeric/LinearAlgebra/LAPACK.hs index 7f057ba..eec3035 100644 --- a/lib/Numeric/LinearAlgebra/LAPACK.hs +++ b/lib/Numeric/LinearAlgebra/LAPACK.hs @@ -14,7 +14,7 @@ module Numeric.LinearAlgebra.LAPACK ( -- * Matrix product - multiplyR, multiplyC, + multiplyR, multiplyC, multiplyF, multiplyQ, -- * Linear systems linearSolveR, linearSolveC, lusR, lusC, @@ -51,8 +51,10 @@ import Control.Monad(when) ----------------------------------------------------------------------------------- -foreign import ccall "LAPACK/lapack-aux.h multiplyR" dgemmc :: CInt -> CInt -> TMMM -foreign import ccall "LAPACK/lapack-aux.h multiplyC" zgemmc :: CInt -> CInt -> TCMCMCM +foreign import ccall "multiplyR" dgemmc :: CInt -> CInt -> TMMM +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 @@ -69,12 +71,20 @@ multiplyAux f st a b = unsafePerformIO $ do -- | Matrix product based on BLAS's /dgemm/. multiplyR :: Matrix Double -> Matrix Double -> Matrix Double -multiplyR a b = multiplyAux dgemmc "dgemmc" a b +multiplyR a b = {-# SCC "multiplyR" #-} multiplyAux dgemmc "dgemmc" a b -- | Matrix product based on BLAS's /zgemm/. multiplyC :: Matrix (Complex Double) -> Matrix (Complex Double) -> Matrix (Complex Double) multiplyC a b = multiplyAux zgemmc "zgemmc" a b +-- | Matrix product based on BLAS's /sgemm/. +multiplyF :: Matrix Float -> Matrix Float -> Matrix Float +multiplyF a b = multiplyAux sgemmc "sgemmc" a b + +-- | Matrix product based on BLAS's /cgemm/. +multiplyQ :: Matrix (Complex Float) -> Matrix (Complex Float) -> Matrix (Complex Float) +multiplyQ a b = multiplyAux cgemmc "cgemmc" a b + ----------------------------------------------------------------------------- foreign import ccall "svd_l_R" dgesvd :: TMMVM foreign import ccall "svd_l_C" zgesvd :: TCMCMVCM -- cgit v1.2.3