summaryrefslogtreecommitdiff
path: root/packages/gsl/src
diff options
context:
space:
mode:
Diffstat (limited to 'packages/gsl/src')
-rw-r--r--packages/gsl/src/Numeric/GSL/Interpolation.hs12
1 files changed, 12 insertions, 0 deletions
diff --git a/packages/gsl/src/Numeric/GSL/Interpolation.hs b/packages/gsl/src/Numeric/GSL/Interpolation.hs
index d060468..6f02405 100644
--- a/packages/gsl/src/Numeric/GSL/Interpolation.hs
+++ b/packages/gsl/src/Numeric/GSL/Interpolation.hs
@@ -1,3 +1,5 @@
1{-# LANGUAGE MagicHash, UnboxedTuples #-}
2
1{- | 3{- |
2Module : Numeric.GSL.Interpolation 4Module : Numeric.GSL.Interpolation
3Copyright : (c) Matthew Peddie 2015 5Copyright : (c) Matthew Peddie 2015
@@ -40,6 +42,10 @@ import Foreign.Storable(peek)
40import Numeric.GSL.Internal 42import Numeric.GSL.Internal
41import System.IO.Unsafe(unsafePerformIO) 43import System.IO.Unsafe(unsafePerformIO)
42 44
45-- FIXME
46import qualified Data.Vector.Storable as S
47import GHC.Base (IO(..), realWorld#)
48
43data InterpolationMethod = Linear 49data InterpolationMethod = Linear
44 | Polynomial 50 | Polynomial
45 | CSpline 51 | CSpline
@@ -59,6 +65,12 @@ methodToInt AkimaPeriodic = 5
59dim :: Numeric t => Vector t -> Int 65dim :: Numeric t => Vector t -> Int
60dim = size 66dim = size
61 67
68-- FIXME
69appVector f x = unsafeInlinePerformIO (S.unsafeWith x (return . f))
70
71unsafeInlinePerformIO (IO f) = case f realWorld# of
72 (# _, x #) -> x
73
62applyCFun hsname cname fun mth xs ys x 74applyCFun hsname cname fun mth xs ys x
63 | dim xs /= dim ys = error $ 75 | dim xs /= dim ys = error $
64 "Error: Vectors of unequal sizes " ++ 76 "Error: Vectors of unequal sizes " ++