summaryrefslogtreecommitdiff
path: root/lib/LAPACK.hs
diff options
context:
space:
mode:
Diffstat (limited to 'lib/LAPACK.hs')
-rw-r--r--lib/LAPACK.hs26
1 files changed, 13 insertions, 13 deletions
diff --git a/lib/LAPACK.hs b/lib/LAPACK.hs
index 1531cfb..dc9eda1 100644
--- a/lib/LAPACK.hs
+++ b/lib/LAPACK.hs
@@ -32,7 +32,7 @@ import Foreign
32----------------------------------------------------------------------------- 32-----------------------------------------------------------------------------
33-- dgesvd 33-- dgesvd
34foreign import ccall "LAPACK/lapack-aux.h svd_l_R" 34foreign import ccall "LAPACK/lapack-aux.h svd_l_R"
35 dgesvd :: Double ::> Double ::> (Double :> Double ::> IO Int) 35 dgesvd :: TMMVM -- Double ::> Double ::> (Double :> Double ::> IO Int)
36 36
37-- | Wrapper for LAPACK's /dgesvd/, which computes the full svd decomposition of a real matrix. 37-- | Wrapper for LAPACK's /dgesvd/, which computes the full svd decomposition of a real matrix.
38-- 38--
@@ -50,7 +50,7 @@ svdR' x@M {rows = r, cols = c} = unsafePerformIO $ do
50----------------------------------------------------------------------------- 50-----------------------------------------------------------------------------
51-- dgesdd 51-- dgesdd
52foreign import ccall "LAPACK/lapack-aux.h svd_l_Rdd" 52foreign import ccall "LAPACK/lapack-aux.h svd_l_Rdd"
53 dgesdd :: Double ::> Double ::> (Double :> Double ::> IO Int) 53 dgesdd :: TMMVM --Double ::> Double ::> (Double :> Double ::> IO Int)
54 54
55-- | Wrapper for LAPACK's /dgesvd/, which computes the full svd decomposition of a real matrix. 55-- | Wrapper for LAPACK's /dgesvd/, which computes the full svd decomposition of a real matrix.
56-- 56--
@@ -68,7 +68,7 @@ svdRdd' x@M {rows = r, cols = c} = unsafePerformIO $ do
68----------------------------------------------------------------------------- 68-----------------------------------------------------------------------------
69-- zgesvd 69-- zgesvd
70foreign import ccall "LAPACK/lapack-aux.h svd_l_C" 70foreign import ccall "LAPACK/lapack-aux.h svd_l_C"
71 zgesvd :: (Complex Double) ::> (Complex Double) ::> (Double :> (Complex Double) ::> IO Int) 71 zgesvd :: TCMCMVCM -- (Complex Double) ::> (Complex Double) ::> (Double :> (Complex Double) ::> IO Int)
72 72
73-- | Wrapper for LAPACK's /zgesvd/, which computes the full svd decomposition of a complex matrix. 73-- | Wrapper for LAPACK's /zgesvd/, which computes the full svd decomposition of a complex matrix.
74-- 74--
@@ -87,7 +87,7 @@ svdC' x@M {rows = r, cols = c} = unsafePerformIO $ do
87----------------------------------------------------------------------------- 87-----------------------------------------------------------------------------
88-- zgeev 88-- zgeev
89foreign import ccall "LAPACK/lapack-aux.h eig_l_C" 89foreign import ccall "LAPACK/lapack-aux.h eig_l_C"
90 zgeev :: (Complex Double) ::> (Complex Double) ::> ((Complex Double) :> (Complex Double) ::> IO Int) 90 zgeev :: TCMCMCVCM -- (Complex Double) ::> (Complex Double) ::> ((Complex Double) :> (Complex Double) ::> IO Int)
91 91
92-- | Wrapper for LAPACK's /zgeev/, which computes the eigenvalues and right eigenvectors of a general complex matrix: 92-- | Wrapper for LAPACK's /zgeev/, which computes the eigenvalues and right eigenvectors of a general complex matrix:
93-- 93--
@@ -108,7 +108,7 @@ eigC (m@M {rows = r})
108----------------------------------------------------------------------------- 108-----------------------------------------------------------------------------
109-- dgeev 109-- dgeev
110foreign import ccall "LAPACK/lapack-aux.h eig_l_R" 110foreign import ccall "LAPACK/lapack-aux.h eig_l_R"
111 dgeev :: Double ::> Double ::> ((Complex Double) :> Double ::> IO Int) 111 dgeev :: TMMCVM -- Double ::> Double ::> ((Complex Double) :> Double ::> IO Int)
112 112
113-- | Wrapper for LAPACK's /dgeev/, which computes the eigenvalues and right eigenvectors of a general real matrix: 113-- | Wrapper for LAPACK's /dgeev/, which computes the eigenvalues and right eigenvectors of a general real matrix:
114-- 114--
@@ -144,7 +144,7 @@ scale r v = fromList [r] `outer` v
144----------------------------------------------------------------------------- 144-----------------------------------------------------------------------------
145-- dsyev 145-- dsyev
146foreign import ccall "LAPACK/lapack-aux.h eig_l_S" 146foreign import ccall "LAPACK/lapack-aux.h eig_l_S"
147 dsyev :: Double ::> (Double :> Double ::> IO Int) 147 dsyev :: TMVM -- Double ::> (Double :> Double ::> IO Int)
148 148
149-- | Wrapper for LAPACK's /dsyev/, which computes the eigenvalues and right eigenvectors of a symmetric real matrix: 149-- | Wrapper for LAPACK's /dsyev/, which computes the eigenvalues and right eigenvectors of a symmetric real matrix:
150-- 150--
@@ -168,7 +168,7 @@ eigS' (m@M {rows = r})
168----------------------------------------------------------------------------- 168-----------------------------------------------------------------------------
169-- zheev 169-- zheev
170foreign import ccall "LAPACK/lapack-aux.h eig_l_H" 170foreign import ccall "LAPACK/lapack-aux.h eig_l_H"
171 zheev :: (Complex Double) ::> (Double :> (Complex Double) ::> IO Int) 171 zheev :: TCMVCM -- (Complex Double) ::> (Double :> (Complex Double) ::> IO Int)
172 172
173-- | Wrapper for LAPACK's /zheev/, which computes the eigenvalues and right eigenvectors of a hermitian complex matrix: 173-- | Wrapper for LAPACK's /zheev/, which computes the eigenvalues and right eigenvectors of a hermitian complex matrix:
174-- 174--
@@ -192,7 +192,7 @@ eigH' (m@M {rows = r})
192----------------------------------------------------------------------------- 192-----------------------------------------------------------------------------
193-- dgesv 193-- dgesv
194foreign import ccall "LAPACK/lapack-aux.h linearSolveR_l" 194foreign import ccall "LAPACK/lapack-aux.h linearSolveR_l"
195 dgesv :: Double ::> Double ::> Double ::> IO Int 195 dgesv :: TMMM -- Double ::> Double ::> Double ::> IO Int
196 196
197-- | Wrapper for LAPACK's /dgesv/, which solves a general real linear system (for several right-hand sides) internally using the lu decomposition. 197-- | Wrapper for LAPACK's /dgesv/, which solves a general real linear system (for several right-hand sides) internally using the lu decomposition.
198linearSolveR :: Matrix Double -> Matrix Double -> Matrix Double 198linearSolveR :: Matrix Double -> Matrix Double -> Matrix Double
@@ -206,7 +206,7 @@ linearSolveR a@(M {rows = n1, cols = n2}) b@(M {rows = r, cols = c})
206----------------------------------------------------------------------------- 206-----------------------------------------------------------------------------
207-- zgesv 207-- zgesv
208foreign import ccall "LAPACK/lapack-aux.h linearSolveC_l" 208foreign import ccall "LAPACK/lapack-aux.h linearSolveC_l"
209 zgesv :: (Complex Double) ::> (Complex Double) ::> (Complex Double) ::> IO Int 209 zgesv :: TCMCMCM -- (Complex Double) ::> (Complex Double) ::> (Complex Double) ::> IO Int
210 210
211-- | Wrapper for LAPACK's /zgesv/, which solves a general complex linear system (for several right-hand sides) internally using the lu decomposition. 211-- | Wrapper for LAPACK's /zgesv/, which solves a general complex linear system (for several right-hand sides) internally using the lu decomposition.
212linearSolveC :: Matrix (Complex Double) -> Matrix (Complex Double) -> Matrix (Complex Double) 212linearSolveC :: Matrix (Complex Double) -> Matrix (Complex Double) -> Matrix (Complex Double)
@@ -220,7 +220,7 @@ linearSolveC a@(M {rows = n1, cols = n2}) b@(M {rows = r, cols = c})
220----------------------------------------------------------------------------------- 220-----------------------------------------------------------------------------------
221-- dgels 221-- dgels
222foreign import ccall "LAPACK/lapack-aux.h linearSolveLSR_l" 222foreign import ccall "LAPACK/lapack-aux.h linearSolveLSR_l"
223 dgels :: Double ::> Double ::> Double ::> IO Int 223 dgels :: TMMM -- Double ::> Double ::> Double ::> IO Int
224 224
225-- | Wrapper for LAPACK's /dgels/, which obtains the least squared error solution of an overconstrained real linear system or the minimum norm solution of an underdetermined system, for several right-hand sides. For rank deficient systems use 'linearSolveSVDR'. 225-- | Wrapper for LAPACK's /dgels/, which obtains the least squared error solution of an overconstrained real linear system or the minimum norm solution of an underdetermined system, for several right-hand sides. For rank deficient systems use 'linearSolveSVDR'.
226linearSolveLSR :: Matrix Double -> Matrix Double -> Matrix Double 226linearSolveLSR :: Matrix Double -> Matrix Double -> Matrix Double
@@ -234,7 +234,7 @@ linearSolveLSR_l a@(M {rows = m, cols = n}) b@(M {cols = nrhs}) = unsafePerformI
234----------------------------------------------------------------------------------- 234-----------------------------------------------------------------------------------
235-- zgels 235-- zgels
236foreign import ccall "LAPACK/lapack-aux.h linearSolveLSC_l" 236foreign import ccall "LAPACK/lapack-aux.h linearSolveLSC_l"
237 zgels :: (Complex Double) ::> (Complex Double) ::> (Complex Double) ::> IO Int 237 zgels :: TCMCMCM -- (Complex Double) ::> (Complex Double) ::> (Complex Double) ::> IO Int
238 238
239-- | Wrapper for LAPACK's /zgels/, which obtains the least squared error solution of an overconstrained complex linear system or the minimum norm solution of an underdetermined system, for several right-hand sides. For rank deficient systems use 'linearSolveSVDC'. 239-- | Wrapper for LAPACK's /zgels/, which obtains the least squared error solution of an overconstrained complex linear system or the minimum norm solution of an underdetermined system, for several right-hand sides. For rank deficient systems use 'linearSolveSVDC'.
240linearSolveLSC :: Matrix (Complex Double) -> Matrix (Complex Double) -> Matrix (Complex Double) 240linearSolveLSC :: Matrix (Complex Double) -> Matrix (Complex Double) -> Matrix (Complex Double)
@@ -248,7 +248,7 @@ linearSolveLSC_l a@(M {rows = m, cols = n}) b@(M {cols = nrhs}) = unsafePerformI
248----------------------------------------------------------------------------------- 248-----------------------------------------------------------------------------------
249-- dgelss 249-- dgelss
250foreign import ccall "LAPACK/lapack-aux.h linearSolveSVDR_l" 250foreign import ccall "LAPACK/lapack-aux.h linearSolveSVDR_l"
251 dgelss :: Double -> Double ::> Double ::> Double ::> IO Int 251 dgelss :: Double -> TMMM -- Double ::> Double ::> Double ::> IO Int
252 252
253-- | Wrapper for LAPACK's /dgelss/, which obtains the minimum norm solution to a real linear least squares problem Ax=B using the svd, for several right-hand sides. Admits rank deficient systems but it is slower than 'linearSolveLSR'. The effective rank of A is determined by treating as zero those singular valures which are less than rcond times the largest singular value. If rcond == Nothing machine precision is used. 253-- | Wrapper for LAPACK's /dgelss/, which obtains the minimum norm solution to a real linear least squares problem Ax=B using the svd, for several right-hand sides. Admits rank deficient systems but it is slower than 'linearSolveLSR'. The effective rank of A is determined by treating as zero those singular valures which are less than rcond times the largest singular value. If rcond == Nothing machine precision is used.
254linearSolveSVDR :: Maybe Double -- ^ rcond 254linearSolveSVDR :: Maybe Double -- ^ rcond
@@ -266,7 +266,7 @@ linearSolveSVDR_l rcond a@(M {rows = m, cols = n}) b@(M {cols = nrhs}) = unsafeP
266----------------------------------------------------------------------------------- 266-----------------------------------------------------------------------------------
267-- zgelss 267-- zgelss
268foreign import ccall "LAPACK/lapack-aux.h linearSolveSVDC_l" 268foreign import ccall "LAPACK/lapack-aux.h linearSolveSVDC_l"
269 zgelss :: Double -> (Complex Double) ::> (Complex Double) ::> (Complex Double) ::> IO Int 269 zgelss :: Double -> TCMCMCM -- (Complex Double) ::> (Complex Double) ::> (Complex Double) ::> IO Int
270 270
271-- | Wrapper for LAPACK's /zgelss/, which obtains the minimum norm solution to a complex linear least squares problem Ax=B using the svd, for several right-hand sides. Admits rank deficient systems but it is slower than 'linearSolveLSC'. The effective rank of A is determined by treating as zero those singular valures which are less than rcond times the largest singular value. If rcond == Nothing machine precision is used. 271-- | Wrapper for LAPACK's /zgelss/, which obtains the minimum norm solution to a complex linear least squares problem Ax=B using the svd, for several right-hand sides. Admits rank deficient systems but it is slower than 'linearSolveLSC'. The effective rank of A is determined by treating as zero those singular valures which are less than rcond times the largest singular value. If rcond == Nothing machine precision is used.
272linearSolveSVDC :: Maybe Double -- ^ rcond 272linearSolveSVDC :: Maybe Double -- ^ rcond