summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlberto Ruiz <aruiz@um.es>2016-11-02 18:55:43 +0100
committerAlberto Ruiz <aruiz@um.es>2016-11-02 18:55:43 +0100
commita326060dd1cf43bd3050126a9801d97a1d2da7e6 (patch)
tree5f9854bc8567b8dbd98e36a5883dd22251e58d3b
parentfc88b36a3067269aa0cd74d5aa56b46edb7bd129 (diff)
provisional fix for interpolation
-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 " ++