diff options
author | Alberto Ruiz <aruiz@um.es> | 2007-11-07 16:52:00 +0000 |
---|---|---|
committer | Alberto Ruiz <aruiz@um.es> | 2007-11-07 16:52:00 +0000 |
commit | 9e6500bf8e925b363e74e01834f81dde0810f808 (patch) | |
tree | a720c1e446944f649b2f21d619bf35b34411a072 /examples/parallel.hs | |
parent | 894344f9ef93a0ff5e2fb12f085b5c706b7aa9d9 (diff) |
removed -O for 6.8.1
Diffstat (limited to 'examples/parallel.hs')
-rw-r--r-- | examples/parallel.hs | 28 |
1 files changed, 0 insertions, 28 deletions
diff --git a/examples/parallel.hs b/examples/parallel.hs deleted file mode 100644 index 7256fb6..0000000 --- a/examples/parallel.hs +++ /dev/null | |||
@@ -1,28 +0,0 @@ | |||
1 | import System(getArgs) | ||
2 | import Numeric.LinearAlgebra | ||
3 | import Control.Parallel.Strategies | ||
4 | import System.Time | ||
5 | |||
6 | inParallel = parMap rwhnf id | ||
7 | |||
8 | parMul x y = fromBlocks [inParallel[x <> y1, x <> y2]] | ||
9 | where p = cols y `div` 2 | ||
10 | (y1,y2) = splitColumnsAt p y | ||
11 | |||
12 | main = do | ||
13 | n <- (read . head) `fmap` getArgs | ||
14 | let m = ident n :: Matrix Double | ||
15 | time $ print $ vectorMax $ takeDiag $ parMul m m | ||
16 | time $ print $ vectorMax $ takeDiag $ m <> m | ||
17 | |||
18 | a = (2><3) [1..6::Double] | ||
19 | b = (3><4) [1..12::Double] | ||
20 | |||
21 | splitRowsAt p m = (takeRows p m, dropRows p m) | ||
22 | splitColumnsAt p m = (takeColumns p m, dropColumns p m) | ||
23 | |||
24 | time act = do | ||
25 | t0 <- getClockTime | ||
26 | act | ||
27 | t1 <- getClockTime | ||
28 | print $ tdSec $ normalizeTimeDiff $ diffClockTimes t1 t0 | ||