summaryrefslogtreecommitdiff
path: root/examples
diff options
context:
space:
mode:
authorAlberto Ruiz <aruiz@um.es>2011-12-14 13:08:43 +0100
committerAlberto Ruiz <aruiz@um.es>2011-12-14 13:08:43 +0100
commit77552d080e88fc70312f55fd3303fac3464ab46e (patch)
tree1dc87dd22ce0da0f1807765568fbc04285bf3621 /examples
parentc3bda2d38c432fb53ce456cba295b097fd4d6ad1 (diff)
new package hmatrix-tests
Diffstat (limited to 'examples')
-rw-r--r--examples/parallel.hs5
-rw-r--r--examples/tests.hs3
2 files changed, 3 insertions, 5 deletions
diff --git a/examples/parallel.hs b/examples/parallel.hs
index 566b729..e875407 100644
--- a/examples/parallel.hs
+++ b/examples/parallel.hs
@@ -1,4 +1,5 @@
1-- $ runhaskell parallel.hs 2000 1-- $ ghc --make -O -rtsopts -threaded parallel.hs
2-- $ ./parallel 3000 +RTS -N4 -s -A200M
2 3
3import System.Environment(getArgs) 4import System.Environment(getArgs)
4import Numeric.LinearAlgebra 5import Numeric.LinearAlgebra
@@ -7,7 +8,6 @@ import System.Time
7 8
8inParallel = parMap rwhnf id 9inParallel = parMap rwhnf id
9 10
10
11-- matrix product decomposed into p parallel subtasks 11-- matrix product decomposed into p parallel subtasks
12parMul p x y = fromBlocks [ inParallel ( map (x <>) ys ) ] 12parMul p x y = fromBlocks [ inParallel ( map (x <>) ys ) ]
13 where [ys] = toBlocksEvery (rows y) (cols y `div` p) y 13 where [ys] = toBlocksEvery (rows y) (cols y `div` p) y
@@ -25,3 +25,4 @@ time act = do
25 act 25 act
26 t1 <- getClockTime 26 t1 <- getClockTime
27 print $ tdSec $ normalizeTimeDiff $ diffClockTimes t1 t0 27 print $ tdSec $ normalizeTimeDiff $ diffClockTimes t1 t0
28
diff --git a/examples/tests.hs b/examples/tests.hs
deleted file mode 100644
index 23fd675..0000000
--- a/examples/tests.hs
+++ /dev/null
@@ -1,3 +0,0 @@
1import Numeric.LinearAlgebra.Tests
2
3main = runTests 20