diff options
author | Bas van Dijk <v.dijk.bas@gmail.com> | 2011-09-01 14:25:37 +0000 |
---|---|---|
committer | Bas van Dijk <v.dijk.bas@gmail.com> | 2011-09-01 14:25:37 +0000 |
commit | 4e6c686dd496e9b7bdd209da3e8fbd3ac47de65a (patch) | |
tree | e54a0d2639624bd5f40ea25e6539699b68e59261 /lib/Numeric/GSL | |
parent | c236a193ed710a29b6940b87bcbe05cb8f4a086a (diff) |
Get rid of some deprecation warnings & Use more explicit imports
Diffstat (limited to 'lib/Numeric/GSL')
-rw-r--r-- | lib/Numeric/GSL/Differentiation.hs | 5 | ||||
-rw-r--r-- | lib/Numeric/GSL/Fitting.hs | 6 | ||||
-rw-r--r-- | lib/Numeric/GSL/Fourier.hs | 2 | ||||
-rw-r--r-- | lib/Numeric/GSL/Integration.hs | 6 | ||||
-rw-r--r-- | lib/Numeric/GSL/Internal.hs | 5 | ||||
-rw-r--r-- | lib/Numeric/GSL/Minimization.hs | 6 | ||||
-rw-r--r-- | lib/Numeric/GSL/ODE.hs | 6 | ||||
-rw-r--r-- | lib/Numeric/GSL/Polynomials.hs | 2 | ||||
-rw-r--r-- | lib/Numeric/GSL/Root.hs | 6 | ||||
-rw-r--r-- | lib/Numeric/GSL/Vector.hs | 5 |
10 files changed, 34 insertions, 15 deletions
diff --git a/lib/Numeric/GSL/Differentiation.hs b/lib/Numeric/GSL/Differentiation.hs index ebbada0..a3c1aea 100644 --- a/lib/Numeric/GSL/Differentiation.hs +++ b/lib/Numeric/GSL/Differentiation.hs | |||
@@ -22,9 +22,12 @@ module Numeric.GSL.Differentiation ( | |||
22 | derivBackward | 22 | derivBackward |
23 | ) where | 23 | ) where |
24 | 24 | ||
25 | import Foreign | ||
26 | import Foreign.C.Types(CInt) | 25 | import Foreign.C.Types(CInt) |
26 | import Foreign.Marshal.Alloc(malloc, free) | ||
27 | import Foreign.Ptr(Ptr, FunPtr, freeHaskellFunPtr) | ||
28 | import Foreign.Storable(peek) | ||
27 | import Data.Packed.Internal(check,(//)) | 29 | import Data.Packed.Internal(check,(//)) |
30 | import System.IO.Unsafe(unsafePerformIO) | ||
28 | 31 | ||
29 | derivGen :: | 32 | derivGen :: |
30 | CInt -- ^ type: 0 central, 1 forward, 2 backward | 33 | CInt -- ^ type: 0 central, 1 forward, 2 backward |
diff --git a/lib/Numeric/GSL/Fitting.hs b/lib/Numeric/GSL/Fitting.hs index e5aa528..337dc6a 100644 --- a/lib/Numeric/GSL/Fitting.hs +++ b/lib/Numeric/GSL/Fitting.hs | |||
@@ -51,10 +51,12 @@ module Numeric.GSL.Fitting ( | |||
51 | 51 | ||
52 | import Data.Packed.Internal | 52 | import Data.Packed.Internal |
53 | import Numeric.LinearAlgebra | 53 | import Numeric.LinearAlgebra |
54 | import Foreign | ||
55 | import Foreign.C.Types(CInt) | ||
56 | import Numeric.GSL.Internal | 54 | import Numeric.GSL.Internal |
57 | 55 | ||
56 | import Foreign.Ptr(FunPtr, freeHaskellFunPtr) | ||
57 | import Foreign.C.Types(CInt) | ||
58 | import System.IO.Unsafe(unsafePerformIO) | ||
59 | |||
58 | ------------------------------------------------------------------------- | 60 | ------------------------------------------------------------------------- |
59 | 61 | ||
60 | data FittingMethod = LevenbergMarquardtScaled -- ^ Interface to gsl_multifit_fdfsolver_lmsder. This is a robust and efficient version of the Levenberg-Marquardt algorithm as implemented in the scaled lmder routine in minpack. Minpack was written by Jorge J. More, Burton S. Garbow and Kenneth E. Hillstrom. | 62 | data FittingMethod = LevenbergMarquardtScaled -- ^ Interface to gsl_multifit_fdfsolver_lmsder. This is a robust and efficient version of the Levenberg-Marquardt algorithm as implemented in the scaled lmder routine in minpack. Minpack was written by Jorge J. More, Burton S. Garbow and Kenneth E. Hillstrom. |
diff --git a/lib/Numeric/GSL/Fourier.hs b/lib/Numeric/GSL/Fourier.hs index 22782b7..25487d4 100644 --- a/lib/Numeric/GSL/Fourier.hs +++ b/lib/Numeric/GSL/Fourier.hs | |||
@@ -22,8 +22,8 @@ module Numeric.GSL.Fourier ( | |||
22 | 22 | ||
23 | import Data.Packed.Internal | 23 | import Data.Packed.Internal |
24 | import Data.Complex | 24 | import Data.Complex |
25 | import Foreign | ||
26 | import Foreign.C.Types(CInt) | 25 | import Foreign.C.Types(CInt) |
26 | import System.IO.Unsafe (unsafePerformIO) | ||
27 | 27 | ||
28 | genfft code v = unsafePerformIO $ do | 28 | genfft code v = unsafePerformIO $ do |
29 | r <- createVector (dim v) | 29 | r <- createVector (dim v) |
diff --git a/lib/Numeric/GSL/Integration.hs b/lib/Numeric/GSL/Integration.hs index 7103ea4..84e8546 100644 --- a/lib/Numeric/GSL/Integration.hs +++ b/lib/Numeric/GSL/Integration.hs | |||
@@ -20,10 +20,12 @@ module Numeric.GSL.Integration ( | |||
20 | integrateQAGS | 20 | integrateQAGS |
21 | ) where | 21 | ) where |
22 | 22 | ||
23 | import Foreign | ||
24 | import Foreign.C.Types(CInt) | 23 | import Foreign.C.Types(CInt) |
24 | import Foreign.Marshal.Alloc(malloc, free) | ||
25 | import Foreign.Ptr(Ptr, FunPtr, freeHaskellFunPtr) | ||
26 | import Foreign.Storable(peek) | ||
25 | import Data.Packed.Internal(check,(//)) | 27 | import Data.Packed.Internal(check,(//)) |
26 | 28 | import System.IO.Unsafe(unsafePerformIO) | |
27 | 29 | ||
28 | {- | conversion of Haskell functions into function pointers that can be used in the C side | 30 | {- | conversion of Haskell functions into function pointers that can be used in the C side |
29 | -} | 31 | -} |
diff --git a/lib/Numeric/GSL/Internal.hs b/lib/Numeric/GSL/Internal.hs index 2ccc3ef..db2c633 100644 --- a/lib/Numeric/GSL/Internal.hs +++ b/lib/Numeric/GSL/Internal.hs | |||
@@ -13,8 +13,11 @@ | |||
13 | module Numeric.GSL.Internal where | 13 | module Numeric.GSL.Internal where |
14 | 14 | ||
15 | import Data.Packed.Internal | 15 | import Data.Packed.Internal |
16 | import Foreign | 16 | |
17 | import Foreign.Marshal.Array(copyArray) | ||
18 | import Foreign.Ptr(Ptr, FunPtr) | ||
17 | import Foreign.C.Types(CInt) | 19 | import Foreign.C.Types(CInt) |
20 | import System.IO.Unsafe(unsafePerformIO) | ||
18 | 21 | ||
19 | iv :: (Vector Double -> Double) -> (CInt -> Ptr Double -> Double) | 22 | iv :: (Vector Double -> Double) -> (CInt -> Ptr Double -> Double) |
20 | iv f n p = f (createV (fromIntegral n) copy "iv") where | 23 | iv f n p = f (createV (fromIntegral n) copy "iv") where |
diff --git a/lib/Numeric/GSL/Minimization.hs b/lib/Numeric/GSL/Minimization.hs index 729f383..5770c91 100644 --- a/lib/Numeric/GSL/Minimization.hs +++ b/lib/Numeric/GSL/Minimization.hs | |||
@@ -62,10 +62,12 @@ module Numeric.GSL.Minimization ( | |||
62 | 62 | ||
63 | import Data.Packed.Internal | 63 | import Data.Packed.Internal |
64 | import Data.Packed.Matrix | 64 | import Data.Packed.Matrix |
65 | import Foreign | ||
66 | import Foreign.C.Types(CInt) | ||
67 | import Numeric.GSL.Internal | 65 | import Numeric.GSL.Internal |
68 | 66 | ||
67 | import Foreign.Ptr(Ptr, FunPtr, freeHaskellFunPtr) | ||
68 | import Foreign.C.Types(CInt) | ||
69 | import System.IO.Unsafe(unsafePerformIO) | ||
70 | |||
69 | ------------------------------------------------------------------------ | 71 | ------------------------------------------------------------------------ |
70 | 72 | ||
71 | {-# DEPRECATED minimizeNMSimplex "use minimize NMSimplex2 eps maxit sizes f xi" #-} | 73 | {-# DEPRECATED minimizeNMSimplex "use minimize NMSimplex2 eps maxit sizes f xi" #-} |
diff --git a/lib/Numeric/GSL/ODE.hs b/lib/Numeric/GSL/ODE.hs index 912e8a8..ea064d6 100644 --- a/lib/Numeric/GSL/ODE.hs +++ b/lib/Numeric/GSL/ODE.hs | |||
@@ -33,10 +33,12 @@ module Numeric.GSL.ODE ( | |||
33 | ) where | 33 | ) where |
34 | 34 | ||
35 | import Data.Packed.Internal | 35 | import Data.Packed.Internal |
36 | import Foreign | ||
37 | import Foreign.C.Types(CInt) | ||
38 | import Numeric.GSL.Internal | 36 | import Numeric.GSL.Internal |
39 | 37 | ||
38 | import Foreign.Ptr(FunPtr, nullFunPtr, freeHaskellFunPtr) | ||
39 | import Foreign.C.Types(CInt) | ||
40 | import System.IO.Unsafe(unsafePerformIO) | ||
41 | |||
40 | ------------------------------------------------------------------------- | 42 | ------------------------------------------------------------------------- |
41 | 43 | ||
42 | -- | Stepping functions | 44 | -- | Stepping functions |
diff --git a/lib/Numeric/GSL/Polynomials.hs b/lib/Numeric/GSL/Polynomials.hs index 19e8944..9885920 100644 --- a/lib/Numeric/GSL/Polynomials.hs +++ b/lib/Numeric/GSL/Polynomials.hs | |||
@@ -21,7 +21,7 @@ module Numeric.GSL.Polynomials ( | |||
21 | 21 | ||
22 | import Data.Packed.Internal | 22 | import Data.Packed.Internal |
23 | import Data.Complex | 23 | import Data.Complex |
24 | import Foreign | 24 | import System.IO.Unsafe (unsafePerformIO) |
25 | 25 | ||
26 | {- | Solution of general polynomial equations, using /gsl_poly_complex_solve/. For example, | 26 | {- | Solution of general polynomial equations, using /gsl_poly_complex_solve/. For example, |
27 | the three solutions of x^3 + 8 = 0 | 27 | the three solutions of x^3 + 8 = 0 |
diff --git a/lib/Numeric/GSL/Root.hs b/lib/Numeric/GSL/Root.hs index ddb090d..784bbd4 100644 --- a/lib/Numeric/GSL/Root.hs +++ b/lib/Numeric/GSL/Root.hs | |||
@@ -51,10 +51,12 @@ module Numeric.GSL.Root ( | |||
51 | 51 | ||
52 | import Data.Packed.Internal | 52 | import Data.Packed.Internal |
53 | import Data.Packed.Matrix | 53 | import Data.Packed.Matrix |
54 | import Foreign | ||
55 | import Foreign.C.Types(CInt) | ||
56 | import Numeric.GSL.Internal | 54 | import Numeric.GSL.Internal |
57 | 55 | ||
56 | import Foreign.Ptr(FunPtr, freeHaskellFunPtr) | ||
57 | import Foreign.C.Types(CInt) | ||
58 | import System.IO.Unsafe(unsafePerformIO) | ||
59 | |||
58 | ------------------------------------------------------------------------- | 60 | ------------------------------------------------------------------------- |
59 | 61 | ||
60 | data RootMethod = Hybrids | 62 | data RootMethod = Hybrids |
diff --git a/lib/Numeric/GSL/Vector.hs b/lib/Numeric/GSL/Vector.hs index 40abfa8..e912953 100644 --- a/lib/Numeric/GSL/Vector.hs +++ b/lib/Numeric/GSL/Vector.hs | |||
@@ -28,8 +28,11 @@ import Data.Packed.Internal.Signatures | |||
28 | import Data.Packed.Internal.Vector | 28 | import Data.Packed.Internal.Vector |
29 | 29 | ||
30 | import Data.Complex | 30 | import Data.Complex |
31 | import Foreign | 31 | import Foreign.Marshal.Alloc(free) |
32 | import Foreign.Marshal.Array(newArray) | ||
33 | import Foreign.Ptr(Ptr) | ||
32 | import Foreign.C.Types(CInt) | 34 | import Foreign.C.Types(CInt) |
35 | import System.IO.Unsafe(unsafePerformIO) | ||
33 | 36 | ||
34 | fromei x = fromIntegral (fromEnum x) :: CInt | 37 | fromei x = fromIntegral (fromEnum x) :: CInt |
35 | 38 | ||