summaryrefslogtreecommitdiff
path: root/lib
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
parentc236a193ed710a29b6940b87bcbe05cb8f4a086a (diff)
Get rid of some deprecation warnings & Use more explicit imports
Diffstat (limited to 'lib')
-rw-r--r--lib/Data/Packed/Internal/Matrix.hs12
-rw-r--r--lib/Data/Packed/Internal/Vector.hs7
-rw-r--r--lib/Data/Packed/Matrix.hs5
-rw-r--r--lib/Data/Packed/ST.hs12
-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
15 files changed, 65 insertions, 27 deletions
diff --git a/lib/Data/Packed/Internal/Matrix.hs b/lib/Data/Packed/Internal/Matrix.hs
index 57142b7..d5fa5a0 100644
--- a/lib/Data/Packed/Internal/Matrix.hs
+++ b/lib/Data/Packed/Internal/Matrix.hs
@@ -39,10 +39,14 @@ import Data.Packed.Internal.Common
39import Data.Packed.Internal.Signatures 39import Data.Packed.Internal.Signatures
40import Data.Packed.Internal.Vector 40import Data.Packed.Internal.Vector
41 41
42import Foreign hiding (xor) 42import Foreign.Marshal.Alloc(alloca, free)
43import Data.Complex 43import Foreign.Marshal.Array(newArray)
44import Foreign.C.Types 44import Foreign.Ptr(Ptr, castPtr)
45import Foreign.C.String 45import Foreign.Storable(Storable, peekElemOff, pokeElemOff, poke, sizeOf)
46import Data.Complex(Complex)
47import Foreign.C.Types(CInt, CChar)
48import Foreign.C.String(newCString)
49import System.IO.Unsafe(unsafePerformIO)
46 50
47----------------------------------------------------------------- 51-----------------------------------------------------------------
48 52
diff --git a/lib/Data/Packed/Internal/Vector.hs b/lib/Data/Packed/Internal/Vector.hs
index 8f403f4..e5a7782 100644
--- a/lib/Data/Packed/Internal/Vector.hs
+++ b/lib/Data/Packed/Internal/Vector.hs
@@ -32,11 +32,16 @@ module Data.Packed.Internal.Vector (
32 32
33import Data.Packed.Internal.Common 33import Data.Packed.Internal.Common
34import Data.Packed.Internal.Signatures 34import Data.Packed.Internal.Signatures
35import Foreign 35import Foreign.Marshal.Alloc(free)
36import Foreign.Marshal.Array(peekArray, pokeArray, copyArray, advancePtr)
37import Foreign.ForeignPtr(ForeignPtr, castForeignPtr)
38import Foreign.Ptr(Ptr)
39import Foreign.Storable(Storable, peekElemOff, pokeElemOff, sizeOf)
36import Foreign.C.String 40import Foreign.C.String
37import Foreign.C.Types(CInt,CChar) 41import Foreign.C.Types(CInt,CChar)
38import Data.Complex 42import Data.Complex
39import Control.Monad(when) 43import Control.Monad(when)
44import System.IO.Unsafe(unsafePerformIO)
40 45
41#if __GLASGOW_HASKELL__ >= 605 46#if __GLASGOW_HASKELL__ >= 605
42import GHC.ForeignPtr (mallocPlainForeignPtrBytes) 47import GHC.ForeignPtr (mallocPlainForeignPtrBytes)
diff --git a/lib/Data/Packed/Matrix.hs b/lib/Data/Packed/Matrix.hs
index 0b23b2f..27fa36c 100644
--- a/lib/Data/Packed/Matrix.hs
+++ b/lib/Data/Packed/Matrix.hs
@@ -42,9 +42,10 @@ module Data.Packed.Matrix (
42 42
43import Data.Packed.Internal 43import Data.Packed.Internal
44import qualified Data.Packed.ST as ST 44import qualified Data.Packed.ST as ST
45import Data.List(transpose,intersperse)
46import Data.Array 45import Data.Array
47import Foreign.Storable 46
47import Data.List(transpose,intersperse)
48import Foreign.Storable(Storable)
48import Control.Arrow((***)) 49import Control.Arrow((***))
49 50
50------------------------------------------------------------------- 51-------------------------------------------------------------------
diff --git a/lib/Data/Packed/ST.hs b/lib/Data/Packed/ST.hs
index 2fad6ae..22aff07 100644
--- a/lib/Data/Packed/ST.hs
+++ b/lib/Data/Packed/ST.hs
@@ -1,3 +1,4 @@
1{-# LANGUAGE CPP #-}
1{-# LANGUAGE TypeOperators #-} 2{-# LANGUAGE TypeOperators #-}
2{-# LANGUAGE Rank2Types #-} 3{-# LANGUAGE Rank2Types #-}
3{-# LANGUAGE BangPatterns #-} 4{-# LANGUAGE BangPatterns #-}
@@ -33,8 +34,15 @@ module Data.Packed.ST (
33) where 34) where
34 35
35import Data.Packed.Internal 36import Data.Packed.Internal
36import Control.Monad.ST 37
37import Foreign 38import Control.Monad.ST(ST, runST)
39import Foreign.Storable(Storable, peekElemOff, pokeElemOff)
40
41#if MIN_VERSION_base(4,4,0)
42import Control.Monad.ST.Unsafe(unsafeIOToST)
43#else
44import Control.Monad.ST(unsafeIOToST)
45#endif
38 46
39{-# INLINE ioReadV #-} 47{-# INLINE ioReadV #-}
40ioReadV :: Storable t => Vector t -> Int -> IO t 48ioReadV :: Storable t => Vector t -> Int -> IO t
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