summaryrefslogtreecommitdiff
path: root/lib/Data/Packed/Internal/Matrix.hs
diff options
context:
space:
mode:
authorAlberto Ruiz <aruiz@um.es>2013-05-21 14:02:17 +0200
committerAlberto Ruiz <aruiz@um.es>2013-05-21 14:02:17 +0200
commit8c890d59088015865a4e8c6b0ebec13e58d8b295 (patch)
treedb2c0855b3ed0e65987c074e4a0e84c56adcb3ad /lib/Data/Packed/Internal/Matrix.hs
parent7f4bd8eb407a61032677e3f8055703519226084f (diff)
NFData (Matrix t)
Diffstat (limited to 'lib/Data/Packed/Internal/Matrix.hs')
-rw-r--r--lib/Data/Packed/Internal/Matrix.hs11
1 files changed, 11 insertions, 0 deletions
diff --git a/lib/Data/Packed/Internal/Matrix.hs b/lib/Data/Packed/Internal/Matrix.hs
index b8ed18d..367c189 100644
--- a/lib/Data/Packed/Internal/Matrix.hs
+++ b/lib/Data/Packed/Internal/Matrix.hs
@@ -47,6 +47,7 @@ import Data.Complex(Complex)
47import Foreign.C.Types 47import Foreign.C.Types
48import Foreign.C.String(newCString) 48import Foreign.C.String(newCString)
49import System.IO.Unsafe(unsafePerformIO) 49import System.IO.Unsafe(unsafePerformIO)
50import Control.DeepSeq
50 51
51----------------------------------------------------------------- 52-----------------------------------------------------------------
52 53
@@ -459,3 +460,13 @@ size m = (rows m, cols m)
459 460
460shSize m = "(" ++ show (rows m) ++"><"++ show (cols m)++")" 461shSize m = "(" ++ show (rows m) ++"><"++ show (cols m)++")"
461 462
463----------------------------------------------------------------------
464
465instance (Storable t, NFData t) => NFData (Matrix t)
466 where
467 rnf m | d > 0 = rnf (v @> 0)
468 | otherwise = ()
469 where
470 d = dim v
471 v = xdat m
472