summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
Diffstat (limited to 'lib')
-rw-r--r--lib/Data/Packed/Internal/Vector.hs18
-rw-r--r--lib/Numeric/ContainerBoot.hs20
-rw-r--r--lib/Numeric/GSL/Polynomials.hs2
3 files changed, 21 insertions, 19 deletions
diff --git a/lib/Data/Packed/Internal/Vector.hs b/lib/Data/Packed/Internal/Vector.hs
index f48c4b2..e85ba6e 100644
--- a/lib/Data/Packed/Internal/Vector.hs
+++ b/lib/Data/Packed/Internal/Vector.hs
@@ -23,6 +23,7 @@ module Data.Packed.Internal.Vector (
23 createVector, vec, 23 createVector, vec,
24 asComplex, asReal, float2DoubleV, double2FloatV, 24 asComplex, asReal, float2DoubleV, double2FloatV,
25 stepF, stepD, condF, condD, 25 stepF, stepD, condF, condD,
26 conjugateQ, conjugateC,
26 fwriteVector, freadVector, fprintfVector, fscanfVector, 27 fwriteVector, freadVector, fprintfVector, fscanfVector,
27 cloneVector, 28 cloneVector,
28 unsafeToForeignPtr, 29 unsafeToForeignPtr,
@@ -344,7 +345,22 @@ condD x y l e g = unsafePerformIO $ do
344foreign import ccall "condF" c_condF :: CInt -> PF -> CInt -> PF -> CInt -> PF -> TFFF 345foreign import ccall "condF" c_condF :: CInt -> PF -> CInt -> PF -> CInt -> PF -> TFFF
345foreign import ccall "condD" c_condD :: CInt -> PD -> CInt -> PD -> CInt -> PD -> TVVV 346foreign import ccall "condD" c_condD :: CInt -> PD -> CInt -> PD -> CInt -> PD -> TVVV
346 347
347---------------------------------------------------------------- 348--------------------------------------------------------------------------------
349
350conjugateAux fun x = unsafePerformIO $ do
351 v <- createVector (dim x)
352 app2 fun vec x vec v "conjugateAux"
353 return v
354
355conjugateQ :: Vector (Complex Float) -> Vector (Complex Float)
356conjugateQ = conjugateAux c_conjugateQ
357foreign import ccall "conjugateQ" c_conjugateQ :: TQVQV
358
359conjugateC :: Vector (Complex Double) -> Vector (Complex Double)
360conjugateC = conjugateAux c_conjugateC
361foreign import ccall "conjugateC" c_conjugateC :: TCVCV
362
363--------------------------------------------------------------------------------
348 364
349cloneVector :: Storable t => Vector t -> IO (Vector t) 365cloneVector :: Storable t => Vector t -> IO (Vector t)
350cloneVector v = do 366cloneVector v = do
diff --git a/lib/Numeric/ContainerBoot.hs b/lib/Numeric/ContainerBoot.hs
index d913435..6ce4760 100644
--- a/lib/Numeric/ContainerBoot.hs
+++ b/lib/Numeric/ContainerBoot.hs
@@ -3,7 +3,9 @@
3{-# LANGUAGE FlexibleInstances #-} 3{-# LANGUAGE FlexibleInstances #-}
4{-# LANGUAGE MultiParamTypeClasses #-} 4{-# LANGUAGE MultiParamTypeClasses #-}
5{-# LANGUAGE UndecidableInstances #-} 5{-# LANGUAGE UndecidableInstances #-}
6#ifndef NOPOLYKINDS
6{-# LANGUAGE PolyKinds #-} 7{-# LANGUAGE PolyKinds #-}
8#endif
7 9
8----------------------------------------------------------------------------- 10-----------------------------------------------------------------------------
9-- | 11-- |
@@ -46,14 +48,11 @@ import Data.Packed.ST as ST
46import Numeric.Conversion 48import Numeric.Conversion
47import Data.Packed.Internal 49import Data.Packed.Internal
48import Numeric.GSL.Vector 50import Numeric.GSL.Vector
49import Foreign.C.Types(CInt(..))
50import Data.Complex 51import Data.Complex
51import Control.Monad(ap) 52import Control.Monad(ap)
52 53
53import Numeric.LinearAlgebra.LAPACK(multiplyR,multiplyC,multiplyF,multiplyQ) 54import Numeric.LinearAlgebra.LAPACK(multiplyR,multiplyC,multiplyF,multiplyQ)
54 55
55import System.IO.Unsafe
56
57------------------------------------------------------------------- 56-------------------------------------------------------------------
58 57
59type family IndexOf c 58type family IndexOf c
@@ -510,21 +509,6 @@ type instance ElementOf (Matrix a) = a
510 509
511------------------------------------------------------------ 510------------------------------------------------------------
512 511
513conjugateAux fun x = unsafePerformIO $ do
514 v <- createVector (dim x)
515 app2 fun vec x vec v "conjugateAux"
516 return v
517
518conjugateQ :: Vector (Complex Float) -> Vector (Complex Float)
519conjugateQ = conjugateAux c_conjugateQ
520foreign import ccall "conjugateQ" c_conjugateQ :: TQVQV
521
522conjugateC :: Vector (Complex Double) -> Vector (Complex Double)
523conjugateC = conjugateAux c_conjugateC
524foreign import ccall "conjugateC" c_conjugateC :: TCVCV
525
526-----------------------------------------------------
527
528class Build f where 512class Build f where
529 build' :: BoundsOf f -> f -> ContainerOf f 513 build' :: BoundsOf f -> f -> ContainerOf f
530 514
diff --git a/lib/Numeric/GSL/Polynomials.hs b/lib/Numeric/GSL/Polynomials.hs
index 9d1cf8c..c0318d7 100644
--- a/lib/Numeric/GSL/Polynomials.hs
+++ b/lib/Numeric/GSL/Polynomials.hs
@@ -19,7 +19,9 @@ module Numeric.GSL.Polynomials (
19 polySolve 19 polySolve
20) where 20) where
21 21
22#ifndef ABSTRACTCINT
22import Foreign.C.Types(CInt(..)) 23import Foreign.C.Types(CInt(..))
24#endif
23import Data.Packed.Internal 25import Data.Packed.Internal
24import Data.Complex 26import Data.Complex
25import System.IO.Unsafe (unsafePerformIO) 27import System.IO.Unsafe (unsafePerformIO)