summaryrefslogtreecommitdiff
path: root/lib/Numeric/GSL/Minimization.hs
diff options
context:
space:
mode:
Diffstat (limited to 'lib/Numeric/GSL/Minimization.hs')
-rw-r--r--lib/Numeric/GSL/Minimization.hs8
1 files changed, 4 insertions, 4 deletions
diff --git a/lib/Numeric/GSL/Minimization.hs b/lib/Numeric/GSL/Minimization.hs
index e93f8cb..f523849 100644
--- a/lib/Numeric/GSL/Minimization.hs
+++ b/lib/Numeric/GSL/Minimization.hs
@@ -186,12 +186,12 @@ foreign import ccall "wrapper"
186 186
187aux_vTov :: (Vector Double -> Vector Double) -> (Int -> Ptr Double -> Ptr Double -> IO()) 187aux_vTov :: (Vector Double -> Vector Double) -> (Int -> Ptr Double -> Ptr Double -> IO())
188aux_vTov f n p r = g where 188aux_vTov f n p r = g where
189 V {fptr = pr, ptr = t} = f x 189 v@V {fptr = pr} = f x
190 x = createV n copy "aux_vTov" [] 190 x = createV n copy "aux_vTov" []
191 copy n q = do 191 copy n q = do
192 copyArray q p n 192 copyArray q p n
193 return 0 193 return 0
194 g = withForeignPtr pr $ \_ -> copyArray r t n 194 g = withForeignPtr pr $ \_ -> copyArray r (ptr v) n
195 195
196-------------------------------------------------------------------- 196--------------------------------------------------------------------
197 197
@@ -202,10 +202,10 @@ createV n fun msg ptrs = unsafePerformIO $ do
202 202
203createM r c fun msg ptrs = unsafePerformIO $ do 203createM r c fun msg ptrs = unsafePerformIO $ do
204 r <- createMatrix RowMajor r c 204 r <- createMatrix RowMajor r c
205 fun // mat cdat r // check msg ptrs 205 fun // matc r // check msg ptrs
206 return r 206 return r
207 207
208createMIO r c fun msg ptrs = do 208createMIO r c fun msg ptrs = do
209 r <- createMatrix RowMajor r c 209 r <- createMatrix RowMajor r c
210 fun // mat cdat r // check msg ptrs 210 fun // matc r // check msg ptrs
211 return r 211 return r