Hello Don,
Thursday, November 8, 2007, 10:53:28 PM, you wrote:
>> a <- newArray (0,n-1) 1.0 :: IO (IOUArray Int Double)
>> forM_ [0..n-2] $ \i -> do { x <- readArray a i; y <- readArray a
>> (i+1); writeArray a (i+1) (x+y) }
oh, i was stupid. obviously, first thing you need to do is to use
unsafeRead/unsafeWrite operations. i'm wonder how this code is only
20x slower than C version, may be you need to use gcc -O3 -funroll-loops
and gcc3 (because gcc4 becomes slower)
--
Best regards,
Bulat mailto:[EMAIL PROTECTED]
_______________________________________________
Haskell-Cafe mailing list
[email protected]
http://www.haskell.org/mailman/listinfo/haskell-cafe