summaryrefslogtreecommitdiff
path: root/lib/Numeric/LinearAlgebra/LAPACK.hs
diff options
context:
space:
mode:
Diffstat (limited to 'lib/Numeric/LinearAlgebra/LAPACK.hs')
-rw-r--r--lib/Numeric/LinearAlgebra/LAPACK.hs16
1 files changed, 14 insertions, 2 deletions
diff --git a/lib/Numeric/LinearAlgebra/LAPACK.hs b/lib/Numeric/LinearAlgebra/LAPACK.hs
index a1ac1cf..5d4eb0d 100644
--- a/lib/Numeric/LinearAlgebra/LAPACK.hs
+++ b/lib/Numeric/LinearAlgebra/LAPACK.hs
@@ -18,6 +18,7 @@ module Numeric.LinearAlgebra.LAPACK (
18 -- * Linear systems 18 -- * Linear systems
19 linearSolveR, linearSolveC, 19 linearSolveR, linearSolveC,
20 lusR, lusC, 20 lusR, lusC,
21 cholSolveR, cholSolveC,
21 linearSolveLSR, linearSolveLSC, 22 linearSolveLSR, linearSolveLSC,
22 linearSolveSVDR, linearSolveSVDC, 23 linearSolveSVDR, linearSolveSVDC,
23 -- * SVD 24 -- * SVD
@@ -312,8 +313,10 @@ eigOnlyH = vrev . fst. eigSHAux (zheev 1) "eigH'" . fmat
312vrev = flatten . flipud . reshape 1 313vrev = flatten . flipud . reshape 1
313 314
314----------------------------------------------------------------------------- 315-----------------------------------------------------------------------------
315foreign import ccall "LAPACK/lapack-aux.h linearSolveR_l" dgesv :: TMMM 316foreign import ccall "linearSolveR_l" dgesv :: TMMM
316foreign import ccall "LAPACK/lapack-aux.h linearSolveC_l" zgesv :: TCMCMCM 317foreign import ccall "linearSolveC_l" zgesv :: TCMCMCM
318foreign import ccall "cholSolveR_l" dpotrs :: TMMM
319foreign import ccall "cholSolveC_l" zpotrs :: TCMCMCM
317 320
318linearSolveSQAux f st a b 321linearSolveSQAux f st a b
319 | n1==n2 && n1==r = unsafePerformIO $ do 322 | n1==n2 && n1==r = unsafePerformIO $ do
@@ -334,6 +337,15 @@ linearSolveR a b = linearSolveSQAux dgesv "linearSolveR" (fmat a) (fmat b)
334linearSolveC :: Matrix (Complex Double) -> Matrix (Complex Double) -> Matrix (Complex Double) 337linearSolveC :: Matrix (Complex Double) -> Matrix (Complex Double) -> Matrix (Complex Double)
335linearSolveC a b = linearSolveSQAux zgesv "linearSolveC" (fmat a) (fmat b) 338linearSolveC a b = linearSolveSQAux zgesv "linearSolveC" (fmat a) (fmat b)
336 339
340
341-- | Solves a symmetric positive definite system of linear equations using a precomputed Cholesky factorization obtained by 'cholS'.
342cholSolveR :: Matrix Double -> Matrix Double -> Matrix Double
343cholSolveR a b = linearSolveSQAux dpotrs "cholSolveR" (fmat a) (fmat b)
344
345-- | Solves a Hermitian positive definite system of linear equations using a precomputed Cholesky factorization obtained by 'cholH'.
346cholSolveC :: Matrix (Complex Double) -> Matrix (Complex Double) -> Matrix (Complex Double)
347cholSolveC a b = linearSolveSQAux zpotrs "cholSolveC" (fmat a) (fmat b)
348
337----------------------------------------------------------------------------------- 349-----------------------------------------------------------------------------------
338foreign import ccall "LAPACK/lapack-aux.h linearSolveLSR_l" dgels :: TMMM 350foreign import ccall "LAPACK/lapack-aux.h linearSolveLSR_l" dgels :: TMMM
339foreign import ccall "LAPACK/lapack-aux.h linearSolveLSC_l" zgels :: TCMCMCM 351foreign import ccall "LAPACK/lapack-aux.h linearSolveLSC_l" zgels :: TCMCMCM