summaryrefslogtreecommitdiff
path: root/examples
diff options
context:
space:
mode:
authorAlberto Ruiz <aruiz@um.es>2010-01-18 08:54:22 +0000
committerAlberto Ruiz <aruiz@um.es>2010-01-18 08:54:22 +0000
commit830164c7c34d874aa66754206be956f85456842f (patch)
tree8ddc23931a05b5d479187e3c61c2d84711f0be63 /examples
parent3fb3a81e63540497a81b717c615f711ce031c76f (diff)
scalar moved to Linear and equal used for ==
Diffstat (limited to 'examples')
-rw-r--r--examples/parallel.hs3
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
12parMul p x y = fromBlocks [ inParallel ( map (x <>) ys ) ] 12parMul 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
15main = do 17main = 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