summaryrefslogtreecommitdiff
path: root/lib/Numeric
diff options
context:
space:
mode:
authorBas van Dijk <v.dijk.bas@gmail.com>2011-09-01 14:25:37 +0000
committerBas van Dijk <v.dijk.bas@gmail.com>2011-09-01 14:25:37 +0000
commit4e6c686dd496e9b7bdd209da3e8fbd3ac47de65a (patch)
treee54a0d2639624bd5f40ea25e6539699b68e59261 /lib/Numeric
parentc236a193ed710a29b6940b87bcbe05cb8f4a086a (diff)
Get rid of some deprecation warnings & Use more explicit imports
Diffstat (limited to 'lib/Numeric')
-rw-r--r--lib/Numeric/GSL/Differentiation.hs5
-rw-r--r--lib/Numeric/GSL/Fitting.hs6
-rw-r--r--lib/Numeric/GSL/Fourier.hs2
-rw-r--r--lib/Numeric/GSL/Integration.hs6
-rw-r--r--lib/Numeric/GSL/Internal.hs5
-rw-r--r--lib/Numeric/GSL/Minimization.hs6
-rw-r--r--lib/Numeric/GSL/ODE.hs6
-rw-r--r--lib/Numeric/GSL/Polynomials.hs2
-rw-r--r--lib/Numeric/GSL/Root.hs6
-rw-r--r--lib/Numeric/GSL/Vector.hs5
-rw-r--r--lib/Numeric/LinearAlgebra/LAPACK.hs7
11 files changed, 38 insertions, 18 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
25import Foreign
26import Foreign.C.Types(CInt) 25import Foreign.C.Types(CInt)
26import Foreign.Marshal.Alloc(malloc, free)
27import Foreign.Ptr(Ptr, FunPtr, freeHaskellFunPtr)
28import Foreign.Storable(peek)
27import Data.Packed.Internal(check,(//)) 29import Data.Packed.Internal(check,(//))
30import System.IO.Unsafe(unsafePerformIO)
28 31
29derivGen :: 32derivGen ::
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
52import Data.Packed.Internal 52import Data.Packed.Internal
53import Numeric.LinearAlgebra 53import Numeric.LinearAlgebra
54import Foreign
55import Foreign.C.Types(CInt)
56import Numeric.GSL.Internal 54import Numeric.GSL.Internal
57 55
56import Foreign.Ptr(FunPtr, freeHaskellFunPtr)
57import Foreign.C.Types(CInt)
58import System.IO.Unsafe(unsafePerformIO)
59
58------------------------------------------------------------------------- 60-------------------------------------------------------------------------
59 61
60data 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. 62data 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
23import Data.Packed.Internal 23import Data.Packed.Internal
24import Data.Complex 24import Data.Complex
25import Foreign
26import Foreign.C.Types(CInt) 25import Foreign.C.Types(CInt)
26import System.IO.Unsafe (unsafePerformIO)
27 27
28genfft code v = unsafePerformIO $ do 28genfft 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
23import Foreign
24import Foreign.C.Types(CInt) 23import Foreign.C.Types(CInt)
24import Foreign.Marshal.Alloc(malloc, free)
25import Foreign.Ptr(Ptr, FunPtr, freeHaskellFunPtr)
26import Foreign.Storable(peek)
25import Data.Packed.Internal(check,(//)) 27import Data.Packed.Internal(check,(//))
26 28import 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 @@
13module Numeric.GSL.Internal where 13module Numeric.GSL.Internal where
14 14
15import Data.Packed.Internal 15import Data.Packed.Internal
16import Foreign 16
17import Foreign.Marshal.Array(copyArray)
18import Foreign.Ptr(Ptr, FunPtr)
17import Foreign.C.Types(CInt) 19import Foreign.C.Types(CInt)
20import System.IO.Unsafe(unsafePerformIO)
18 21
19iv :: (Vector Double -> Double) -> (CInt -> Ptr Double -> Double) 22iv :: (Vector Double -> Double) -> (CInt -> Ptr Double -> Double)
20iv f n p = f (createV (fromIntegral n) copy "iv") where 23iv 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
63import Data.Packed.Internal 63import Data.Packed.Internal
64import Data.Packed.Matrix 64import Data.Packed.Matrix
65import Foreign
66import Foreign.C.Types(CInt)
67import Numeric.GSL.Internal 65import Numeric.GSL.Internal
68 66
67import Foreign.Ptr(Ptr, FunPtr, freeHaskellFunPtr)
68import Foreign.C.Types(CInt)
69import 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
35import Data.Packed.Internal 35import Data.Packed.Internal
36import Foreign
37import Foreign.C.Types(CInt)
38import Numeric.GSL.Internal 36import Numeric.GSL.Internal
39 37
38import Foreign.Ptr(FunPtr, nullFunPtr, freeHaskellFunPtr)
39import Foreign.C.Types(CInt)
40import 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
22import Data.Packed.Internal 22import Data.Packed.Internal
23import Data.Complex 23import Data.Complex
24import Foreign 24import 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
52import Data.Packed.Internal 52import Data.Packed.Internal
53import Data.Packed.Matrix 53import Data.Packed.Matrix
54import Foreign
55import Foreign.C.Types(CInt)
56import Numeric.GSL.Internal 54import Numeric.GSL.Internal
57 55
56import Foreign.Ptr(FunPtr, freeHaskellFunPtr)
57import Foreign.C.Types(CInt)
58import System.IO.Unsafe(unsafePerformIO)
59
58------------------------------------------------------------------------- 60-------------------------------------------------------------------------
59 61
60data RootMethod = Hybrids 62data 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
28import Data.Packed.Internal.Vector 28import Data.Packed.Internal.Vector
29 29
30import Data.Complex 30import Data.Complex
31import Foreign 31import Foreign.Marshal.Alloc(free)
32import Foreign.Marshal.Array(newArray)
33import Foreign.Ptr(Ptr)
32import Foreign.C.Types(CInt) 34import Foreign.C.Types(CInt)
35import System.IO.Unsafe(unsafePerformIO)
33 36
34fromei x = fromIntegral (fromEnum x) :: CInt 37fromei x = fromIntegral (fromEnum x) :: CInt
35 38
diff --git a/lib/Numeric/LinearAlgebra/LAPACK.hs b/lib/Numeric/LinearAlgebra/LAPACK.hs
index fbc5460..2fac1ee 100644
--- a/lib/Numeric/LinearAlgebra/LAPACK.hs
+++ b/lib/Numeric/LinearAlgebra/LAPACK.hs
@@ -43,12 +43,13 @@ module Numeric.LinearAlgebra.LAPACK (
43 43
44import Data.Packed.Internal 44import Data.Packed.Internal
45import Data.Packed.Matrix 45import Data.Packed.Matrix
46--import Data.Complex
47import Numeric.Conversion 46import Numeric.Conversion
48import Numeric.GSL.Vector(vectorMapValR, FunCodeSV(Scale)) 47import Numeric.GSL.Vector(vectorMapValR, FunCodeSV(Scale))
49import Foreign 48
50import Foreign.C.Types (CInt) 49import Foreign.Ptr(nullPtr)
50import Foreign.C.Types(CInt)
51import Control.Monad(when) 51import Control.Monad(when)
52import System.IO.Unsafe(unsafePerformIO)
52 53
53----------------------------------------------------------------------------------- 54-----------------------------------------------------------------------------------
54 55