From bd1bca66174ec3c0feb38c531cfc611cc0239b21 Mon Sep 17 00:00:00 2001 From: Alberto Ruiz Date: Sun, 21 Jun 2015 13:06:17 +0200 Subject: clean unused --- packages/base/src/Internal/CG.hs | 2 +- packages/base/src/Internal/Convolution.hs | 2 +- packages/base/src/Internal/Devel.hs | 9 ++------- packages/base/src/Internal/Modular.hs | 2 +- packages/base/src/Internal/Vector.hs | 16 +--------------- 5 files changed, 6 insertions(+), 25 deletions(-) (limited to 'packages/base') diff --git a/packages/base/src/Internal/CG.hs b/packages/base/src/Internal/CG.hs index 758d130..8c4afee 100644 --- a/packages/base/src/Internal/CG.hs +++ b/packages/base/src/Internal/CG.hs @@ -7,7 +7,7 @@ module Internal.CG( ) where import Internal.Vector -import Internal.Matrix hiding (mat) +import Internal.Matrix import Internal.Numeric import Internal.Element import Internal.IO diff --git a/packages/base/src/Internal/Convolution.hs b/packages/base/src/Internal/Convolution.hs index 1a70011..384fdf8 100644 --- a/packages/base/src/Internal/Convolution.hs +++ b/packages/base/src/Internal/Convolution.hs @@ -18,7 +18,7 @@ module Internal.Convolution( import qualified Data.Vector.Storable as SV import Internal.Vector -import Internal.Matrix hiding (mat) +import Internal.Matrix import Internal.Numeric import Internal.Element import Internal.Conversion diff --git a/packages/base/src/Internal/Devel.hs b/packages/base/src/Internal/Devel.hs index 4be0afd..710d626 100644 --- a/packages/base/src/Internal/Devel.hs +++ b/packages/base/src/Internal/Devel.hs @@ -17,7 +17,7 @@ import Foreign.C.Types ( CInt ) --import Foreign.Storable.Complex () import Foreign.Ptr(Ptr) import Control.Exception as E ( SomeException, catch ) -import Internal.Vector(Vector,avec,arrvec) +import Internal.Vector(Vector,avec) import Foreign.Storable(Storable) -- | postfix function application (@flip ($)@) @@ -83,8 +83,7 @@ class TransArray c type Elem c apply :: (Trans c b) -> c -> b applyRaw :: (TransRaw c b) -> c -> b - applyArray :: (Ptr CInt -> Ptr (Elem c) -> b) -> c -> b - infixl 1 `apply`, `applyRaw`, `applyArray` + infixl 1 `apply`, `applyRaw` instance Storable t => TransArray (Vector t) where @@ -95,8 +94,4 @@ instance Storable t => TransArray (Vector t) {-# INLINE apply #-} applyRaw = avec {-# INLINE applyRaw #-} - applyArray = arrvec - {-# INLINE applyArray #-} - - diff --git a/packages/base/src/Internal/Modular.hs b/packages/base/src/Internal/Modular.hs index 098817e..37f6e9b 100644 --- a/packages/base/src/Internal/Modular.hs +++ b/packages/base/src/Internal/Modular.hs @@ -27,7 +27,7 @@ module Internal.Modular( ) where import Internal.Vector -import Internal.Matrix hiding (mat,size) +import Internal.Matrix hiding (size) import Internal.Numeric import Internal.Element import Internal.Container diff --git a/packages/base/src/Internal/Vector.hs b/packages/base/src/Internal/Vector.hs index e5ac440..29b6797 100644 --- a/packages/base/src/Internal/Vector.hs +++ b/packages/base/src/Internal/Vector.hs @@ -14,7 +14,7 @@ module Internal.Vector( I,Z,R,C, fi,ti, Vector, fromList, unsafeToForeignPtr, unsafeFromForeignPtr, unsafeWith, - createVector, vec, avec, arrvec, inlinePerformIO, + createVector, avec, inlinePerformIO, toList, dim, (@>), at', (|>), vjoin, subVector, takesV, idxs, buildVector, @@ -67,25 +67,11 @@ dim = Vector.length -- C-Haskell vector adapter --- vec :: Adapt (CInt -> Ptr t -> r) (Vector t) r -vec :: (Storable t) => Vector t -> (((CInt -> Ptr t -> t1) -> t1) -> IO b) -> IO b -vec x f = unsafeWith x $ \p -> do - let v g = do - g (fi $ dim x) p - f v -{-# INLINE vec #-} - {-# INLINE avec #-} avec :: Storable a => (CInt -> Ptr a -> b) -> Vector a -> b avec f v = inlinePerformIO (unsafeWith v (return . f (fromIntegral (Vector.length v)))) infixl 1 `avec` -{-# INLINE arrvec #-} -arrvec :: Storable a => (Ptr CInt -> Ptr a -> b) -> Vector a -> b -arrvec f v = inlinePerformIO (unsafeWith (idxs [1,dim v]) (\p -> unsafeWith v (return . f p))) - - - -- allocates memory for a new vector createVector :: Storable a => Int -> IO (Vector a) createVector n = do -- cgit v1.2.3