diff options
author | Alberto Ruiz <aruiz@um.es> | 2010-01-18 08:54:22 +0000 |
---|---|---|
committer | Alberto Ruiz <aruiz@um.es> | 2010-01-18 08:54:22 +0000 |
commit | 830164c7c34d874aa66754206be956f85456842f (patch) | |
tree | 8ddc23931a05b5d479187e3c61c2d84711f0be63 /examples/parallel.hs | |
parent | 3fb3a81e63540497a81b717c615f711ce031c76f (diff) |
scalar moved to Linear and equal used for ==
Diffstat (limited to 'examples/parallel.hs')
-rw-r--r-- | examples/parallel.hs | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/examples/parallel.hs b/examples/parallel.hs index efcbe8a..3c83c54 100644 --- a/examples/parallel.hs +++ b/examples/parallel.hs | |||
@@ -12,10 +12,13 @@ inParallel = parMap rwhnf id | |||
12 | parMul p x y = fromBlocks [ inParallel ( map (x <>) ys ) ] | 12 | parMul p x y = fromBlocks [ inParallel ( map (x <>) ys ) ] |
13 | where ys = splitColumns p y | 13 | where ys = splitColumns p y |
14 | 14 | ||
15 | -- x <||> y = fromColumns . inParallel . map (x <>) . toColumns $ y | ||
16 | |||
15 | main = do | 17 | main = do |
16 | n <- (read . head) `fmap` getArgs | 18 | n <- (read . head) `fmap` getArgs |
17 | let m = ident n :: Matrix Double | 19 | let m = ident n :: Matrix Double |
18 | time $ print $ vectorMax $ takeDiag $ m <> m | 20 | time $ print $ vectorMax $ takeDiag $ m <> m |
21 | -- time $ print $ vectorMax $ takeDiag $ m <||> m | ||
19 | time $ print $ vectorMax $ takeDiag $ parMul 2 m m | 22 | time $ print $ vectorMax $ takeDiag $ parMul 2 m m |
20 | time $ print $ vectorMax $ takeDiag $ parMul 4 m m | 23 | time $ print $ vectorMax $ takeDiag $ parMul 4 m m |
21 | time $ print $ vectorMax $ takeDiag $ parMul 8 m m | 24 | time $ print $ vectorMax $ takeDiag $ parMul 8 m m |