diff options
author | Alberto Ruiz <aruiz@um.es> | 2007-11-23 13:25:42 +0000 |
---|---|---|
committer | Alberto Ruiz <aruiz@um.es> | 2007-11-23 13:25:42 +0000 |
commit | 30fdf02aff2ac1c4da2bb9292fc08cc8330580d0 (patch) | |
tree | 82b062214626c20922959c82581decb3df2ba5ec /lib/Numeric/GSL/Matrix.hs | |
parent | 48139eb50c9052406839ee8375e378374e973207 (diff) |
removed many -Wall warnings
Diffstat (limited to 'lib/Numeric/GSL/Matrix.hs')
-rw-r--r-- | lib/Numeric/GSL/Matrix.hs | 24 |
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 | ||
25 | import Data.Packed.Internal | 25 | import Data.Packed.Internal |
26 | import Data.Packed.Matrix(fromLists,ident,takeDiag) | 26 | import Data.Packed.Matrix(ident) |
27 | import Numeric.GSL.Vector | 27 | import Numeric.GSL.Vector |
28 | import Foreign | 28 | import Foreign |
29 | import Complex | 29 | import Complex |
@@ -44,7 +44,7 @@ import Complex | |||
44 | 44 | ||
45 | -} | 45 | -} |
46 | eigSg :: Matrix Double -> (Vector Double, Matrix Double) | 46 | eigSg :: Matrix Double -> (Vector Double, Matrix Double) |
47 | eigSg = eigSg . cmat | 47 | eigSg = eigSg' . cmat |
48 | 48 | ||
49 | eigSg' m | 49 | eigSg' 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) | |||
159 | qrPacked = qrPacked' . cmat | 159 | qrPacked = qrPacked' . cmat |
160 | 160 | ||
161 | qrPacked' x = unsafePerformIO $ do | 161 | qrPacked' 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 |
168 | foreign import ccall "gsl-aux.h QRpacked" c_qrPacked :: TMMV | 168 | foreign import ccall "gsl-aux.h QRpacked" c_qrPacked :: TMMV |
169 | 169 | ||
170 | unpackQR :: (Matrix Double, Vector Double) -> (Matrix Double, Matrix Double) | 170 | unpackQR :: (Matrix Double, Vector Double) -> (Matrix Double, Matrix Double) |
171 | unpackQR (qr,tau) = unpackQR' (cmat qr, tau) | 171 | unpackQR (qrp,tau) = unpackQR' (cmat qrp, tau) |
172 | 172 | ||
173 | unpackQR' (qr,tau) = unsafePerformIO $ do | 173 | unpackQR' (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 |
180 | foreign import ccall "gsl-aux.h QRunpack" c_qrUnpack :: TMVMM | 180 | foreign 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 | ||
263 | foreign import ccall "gsl-aux.h luRaux" c_luRaux :: TMV | 262 | foreign 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 | ||
276 | foreign import ccall "gsl-aux.h luCaux" c_luCaux :: TCMCV | 274 | foreign 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>. |