diff options
author | Alberto Ruiz <aruiz@um.es> | 2007-11-12 10:01:39 +0000 |
---|---|---|
committer | Alberto Ruiz <aruiz@um.es> | 2007-11-12 10:01:39 +0000 |
commit | c41d21fefa04c66039a0b218daaa53c2577ef838 (patch) | |
tree | 3dd182457a89edbf52688fb43fdc8b2a130829e8 /lib/Numeric/GSL/Minimization.hs | |
parent | 9e6500bf8e925b363e74e01834f81dde0810f808 (diff) |
data structures simplification
Diffstat (limited to 'lib/Numeric/GSL/Minimization.hs')
-rw-r--r-- | lib/Numeric/GSL/Minimization.hs | 8 |
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 | ||
187 | aux_vTov :: (Vector Double -> Vector Double) -> (Int -> Ptr Double -> Ptr Double -> IO()) | 187 | aux_vTov :: (Vector Double -> Vector Double) -> (Int -> Ptr Double -> Ptr Double -> IO()) |
188 | aux_vTov f n p r = g where | 188 | aux_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 | ||
203 | createM r c fun msg ptrs = unsafePerformIO $ do | 203 | createM 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 | ||
208 | createMIO r c fun msg ptrs = do | 208 | createMIO 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 |