diff options
author | Alberto Ruiz <aruiz@um.es> | 2009-10-15 10:13:24 +0000 |
---|---|---|
committer | Alberto Ruiz <aruiz@um.es> | 2009-10-15 10:13:24 +0000 |
commit | 4863cdb1a7495547f05e068f3f8228dae4e57f1f (patch) | |
tree | 6ceefcebc1916250909a49931bfb22705bc7fbcb /lib/Numeric/LinearAlgebra | |
parent | 026f20453ff3c8981ef6cab2d5d865837977b78d (diff) |
NFData instances
Diffstat (limited to 'lib/Numeric/LinearAlgebra')
-rw-r--r-- | lib/Numeric/LinearAlgebra/Instances.hs | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/lib/Numeric/LinearAlgebra/Instances.hs b/lib/Numeric/LinearAlgebra/Instances.hs index 79a8990..3122a3d 100644 --- a/lib/Numeric/LinearAlgebra/Instances.hs +++ b/lib/Numeric/LinearAlgebra/Instances.hs | |||
@@ -27,6 +27,7 @@ import Data.List(transpose,intersperse) | |||
27 | import Foreign(Storable) | 27 | import Foreign(Storable) |
28 | import Data.Monoid | 28 | import Data.Monoid |
29 | import Data.Packed.Internal.Vector | 29 | import Data.Packed.Internal.Vector |
30 | import Control.Parallel.Strategies | ||
30 | 31 | ||
31 | ------------------------------------------------------------------ | 32 | ------------------------------------------------------------------ |
32 | 33 | ||
@@ -196,3 +197,10 @@ instance (Storable a) => Monoid (Vector a) where | |||
196 | where j [] = mempty | 197 | where j [] = mempty |
197 | j l = join l | 198 | j l = join l |
198 | 199 | ||
200 | --------------------------------------------------------------- | ||
201 | |||
202 | instance (NFData a, Storable a) => NFData (Vector a) where | ||
203 | rnf = rnf . (@>0) | ||
204 | |||
205 | instance (NFData a, Element a) => NFData (Matrix a) where | ||
206 | rnf = rnf . flatten | ||