summaryrefslogtreecommitdiff
path: root/lib/Numeric/GSL/Minimization.hs
diff options
context:
space:
mode:
authorAlberto Ruiz <aruiz@um.es>2007-11-12 10:01:39 +0000
committerAlberto Ruiz <aruiz@um.es>2007-11-12 10:01:39 +0000
commitc41d21fefa04c66039a0b218daaa53c2577ef838 (patch)
tree3dd182457a89edbf52688fb43fdc8b2a130829e8 /lib/Numeric/GSL/Minimization.hs
parent9e6500bf8e925b363e74e01834f81dde0810f808 (diff)
data structures simplification
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