summaryrefslogtreecommitdiff
path: root/lib/Numeric/GSL/Matrix.hs
diff options
context:
space:
mode:
authorAlberto Ruiz <aruiz@um.es>2007-11-23 13:25:42 +0000
committerAlberto Ruiz <aruiz@um.es>2007-11-23 13:25:42 +0000
commit30fdf02aff2ac1c4da2bb9292fc08cc8330580d0 (patch)
tree82b062214626c20922959c82581decb3df2ba5ec /lib/Numeric/GSL/Matrix.hs
parent48139eb50c9052406839ee8375e378374e973207 (diff)
removed many -Wall warnings
Diffstat (limited to 'lib/Numeric/GSL/Matrix.hs')
-rw-r--r--lib/Numeric/GSL/Matrix.hs24
1 files changed, 11 insertions, 13 deletions
diff --git a/lib/Numeric/GSL/Matrix.hs b/lib/Numeric/GSL/Matrix.hs
index 07d4660..d51728e 100644
--- a/lib/Numeric/GSL/Matrix.hs
+++ b/lib/Numeric/GSL/Matrix.hs
@@ -17,13 +17,13 @@ module Numeric.GSL.Matrix(
17 eigSg, eigHg, 17 eigSg, eigHg,
18 svdg, 18 svdg,
19 qr, qrPacked, unpackQR, 19 qr, qrPacked, unpackQR,
20 cholR, -- cholC, 20 cholR, cholC,
21 luSolveR, luSolveC, 21 luSolveR, luSolveC,
22 luR, luC 22 luR, luC
23) where 23) where
24 24
25import Data.Packed.Internal 25import Data.Packed.Internal
26import Data.Packed.Matrix(fromLists,ident,takeDiag) 26import Data.Packed.Matrix(ident)
27import Numeric.GSL.Vector 27import Numeric.GSL.Vector
28import Foreign 28import Foreign
29import Complex 29import Complex
@@ -44,7 +44,7 @@ import Complex
44 44
45-} 45-}
46eigSg :: Matrix Double -> (Vector Double, Matrix Double) 46eigSg :: Matrix Double -> (Vector Double, Matrix Double)
47eigSg = eigSg . cmat 47eigSg = eigSg' . cmat
48 48
49eigSg' m 49eigSg' m
50 | r == 1 = (fromList [cdat m `at` 0], singleton 1) 50 | r == 1 = (fromList [cdat m `at` 0], singleton 1)
@@ -159,24 +159,24 @@ qrPacked :: Matrix Double -> (Matrix Double, Vector Double)
159qrPacked = qrPacked' . cmat 159qrPacked = qrPacked' . cmat
160 160
161qrPacked' x = unsafePerformIO $ do 161qrPacked' x = unsafePerformIO $ do
162 qr <- createMatrix RowMajor r c 162 qrp <- createMatrix RowMajor r c
163 tau <- createVector (min r c) 163 tau <- createVector (min r c)
164 app3 c_qrPacked mat x mat qr vec tau "qrUnpacked" 164 app3 c_qrPacked mat x mat qrp vec tau "qrUnpacked"
165 return (qr,tau) 165 return (qrp,tau)
166 where r = rows x 166 where r = rows x
167 c = cols x 167 c = cols x
168foreign import ccall "gsl-aux.h QRpacked" c_qrPacked :: TMMV 168foreign import ccall "gsl-aux.h QRpacked" c_qrPacked :: TMMV
169 169
170unpackQR :: (Matrix Double, Vector Double) -> (Matrix Double, Matrix Double) 170unpackQR :: (Matrix Double, Vector Double) -> (Matrix Double, Matrix Double)
171unpackQR (qr,tau) = unpackQR' (cmat qr, tau) 171unpackQR (qrp,tau) = unpackQR' (cmat qrp, tau)
172 172
173unpackQR' (qr,tau) = unsafePerformIO $ do 173unpackQR' (qrp,tau) = unsafePerformIO $ do
174 q <- createMatrix RowMajor r r 174 q <- createMatrix RowMajor r r
175 res <- createMatrix RowMajor r c 175 res <- createMatrix RowMajor r c
176 app4 c_qrUnpack mat qr vec tau mat q mat res "qrUnpack" 176 app4 c_qrUnpack mat qrp vec tau mat q mat res "qrUnpack"
177 return (q,res) 177 return (q,res)
178 where r = rows qr 178 where r = rows qrp
179 c = cols qr 179 c = cols qrp
180foreign import ccall "gsl-aux.h QRunpack" c_qrUnpack :: TMVMM 180foreign import ccall "gsl-aux.h QRunpack" c_qrUnpack :: TMVMM
181 181
182 182
@@ -259,7 +259,6 @@ luRaux' x = unsafePerformIO $ do
259 app2 c_luRaux mat x vec res "luRaux" 259 app2 c_luRaux mat x vec res "luRaux"
260 return res 260 return res
261 where r = rows x 261 where r = rows x
262 c = cols x
263foreign import ccall "gsl-aux.h luRaux" c_luRaux :: TMV 262foreign import ccall "gsl-aux.h luRaux" c_luRaux :: TMV
264 263
265{- | lu decomposition of complex matrix (packed as a vector including l, u, the permutation and sign) 264{- | lu decomposition of complex matrix (packed as a vector including l, u, the permutation and sign)
@@ -272,7 +271,6 @@ luCaux' x = unsafePerformIO $ do
272 app2 c_luCaux mat x vec res "luCaux" 271 app2 c_luCaux mat x vec res "luCaux"
273 return res 272 return res
274 where r = rows x 273 where r = rows x
275 c = cols x
276foreign import ccall "gsl-aux.h luCaux" c_luCaux :: TCMCV 274foreign import ccall "gsl-aux.h luCaux" c_luCaux :: TCMCV
277 275
278{- | The LU decomposition of a square matrix. Is based on /gsl_linalg_LU_decomp/ and /gsl_linalg_complex_LU_decomp/ as described in <http://www.gnu.org/software/Numeric.GSL/manual/Numeric.GSL-ref_13.html#SEC223>. 276{- | The LU decomposition of a square matrix. Is based on /gsl_linalg_LU_decomp/ and /gsl_linalg_complex_LU_decomp/ as described in <http://www.gnu.org/software/Numeric.GSL/manual/Numeric.GSL-ref_13.html#SEC223>.