diff options
author | Alberto Ruiz <aruiz@um.es> | 2008-06-19 17:25:58 +0000 |
---|---|---|
committer | Alberto Ruiz <aruiz@um.es> | 2008-06-19 17:25:58 +0000 |
commit | fe795ee9b1e71666d408879ce30fe6d4ca80830e (patch) | |
tree | 81e691ee455832823bebad6febde9fdf216b0b86 /lib/Data/Packed/ST.hs | |
parent | 8dce18602825da9914832114283748244fa9b859 (diff) |
ST bug fixed with NOINLINE newVector/Matrix
Diffstat (limited to 'lib/Data/Packed/ST.hs')
-rw-r--r-- | lib/Data/Packed/ST.hs | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/lib/Data/Packed/ST.hs b/lib/Data/Packed/ST.hs index 1311ff9..ed0a05e 100644 --- a/lib/Data/Packed/ST.hs +++ b/lib/Data/Packed/ST.hs | |||
@@ -89,6 +89,7 @@ readVector = safeIndexV unsafeReadVector | |||
89 | writeVector :: Storable t => STVector s t -> Int -> t -> ST s () | 89 | writeVector :: Storable t => STVector s t -> Int -> t -> ST s () |
90 | writeVector = safeIndexV unsafeWriteVector | 90 | writeVector = safeIndexV unsafeWriteVector |
91 | 91 | ||
92 | {-# NOINLINE newVector #-} | ||
92 | newVector :: Element t => t -> Int -> ST s (STVector s t) | 93 | newVector :: Element t => t -> Int -> ST s (STVector s t) |
93 | newVector v = unsafeThawVector . constant v | 94 | newVector v = unsafeThawVector . constant v |
94 | 95 | ||
@@ -154,5 +155,6 @@ readMatrix = safeIndexM unsafeReadMatrix | |||
154 | writeMatrix :: Storable t => STMatrix s t -> Int -> Int -> t -> ST s () | 155 | writeMatrix :: Storable t => STMatrix s t -> Int -> Int -> t -> ST s () |
155 | writeMatrix = safeIndexM unsafeWriteMatrix | 156 | writeMatrix = safeIndexM unsafeWriteMatrix |
156 | 157 | ||
158 | {-# NOINLINE newMatrix #-} | ||
157 | newMatrix :: Element t => t -> Int -> Int -> ST s (STMatrix s t) | 159 | newMatrix :: Element t => t -> Int -> Int -> ST s (STMatrix s t) |
158 | newMatrix v r c = unsafeThawMatrix . reshape c . constant v $ r*c | 160 | newMatrix v r c = unsafeThawMatrix . reshape c . constant v $ r*c |