summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--examples/benchmarks.hs17
-rw-r--r--hmatrix.cabal6
2 files changed, 11 insertions, 12 deletions
diff --git a/examples/benchmarks.hs b/examples/benchmarks.hs
index f5ca550..e210280 100644
--- a/examples/benchmarks.hs
+++ b/examples/benchmarks.hs
@@ -32,12 +32,11 @@ v = flatten $ ident 500 :: Vector Double
32bench1 = do 32bench1 = do
33 time $ print$ vectorMax (w+w2) -- evaluate it 33 time $ print$ vectorMax (w+w2) -- evaluate it
34 putStrLn "Sum of a vector with 5M doubles:" 34 putStrLn "Sum of a vector with 5M doubles:"
35 print $ vectorMax v -- evaluate it 35 print$ vectorMax (w+w2) -- evaluate it
36-- time $ printf " BLAS: %.2f: " $ sumVB w 36 time $ printf " BLAS: %.2f: " $ sumVB w
37 time $ printf " Haskell: %.2f: " $ sumVH w 37 time $ printf "BLAS only dot: %.2f: " $ w <.> w2
38 time $ printf " BLAS: %.2f: " $ w <.> w2 38 time $ printf " Haskell: %.2f: " $ sumVH w
39 time $ printf " Haskell: %.2f: " $ sumVH w 39 time $ printf " innerH: %.2f: " $ innerH w w2
40 time $ printf " innerH: %.2f: " $ innerH w w2
41 time $ printf "foldVector: %.2f: " $ sumVector w 40 time $ printf "foldVector: %.2f: " $ sumVector w
42 let getPos k s = if k `mod` 500 < 200 && w@>k > 0 then k:s else s 41 let getPos k s = if k `mod` 500 < 200 && w@>k > 0 then k:s else s
43 putStrLn "foldLoop for element selection:" 42 putStrLn "foldLoop for element selection:"
@@ -46,10 +45,10 @@ bench1 = do
46 time $ print $ constant (1::Double) 5000001 @> 7 45 time $ print $ constant (1::Double) 5000001 @> 7
47 time $ print $ constant i 5000001 @> 7 46 time $ print $ constant i 5000001 @> 7
48 time $ print $ conj (constant i 5000001) @> 7 47 time $ print $ conj (constant i 5000001) @> 7
49 putStrLn "some zips:" 48 putStrLn "zips C vs H:"
50 time $ print $ (w / w2) @> 7 49 time $ print $ (w / w2) @> 7
51 time $ print $ (zipVector (/) w w2) @> 7 50 time $ print $ (zipVector (/) w w2) @> 7
52 putStrLn "some folds:" 51 putStrLn "folds C/BLAS vs H:"
53 let t = constant (1::Double) 5000002 52 let t = constant (1::Double) 5000002
54 print $ t @> 7 53 print $ t @> 7
55 time $ print $ foldVector max (t@>0) t 54 time $ print $ foldVector max (t@>0) t
@@ -57,6 +56,8 @@ bench1 = do
57 time $ print $ sqrt $ foldVector (\v s -> v*v+s) 0 t 56 time $ print $ sqrt $ foldVector (\v s -> v*v+s) 0 t
58 time $ print $ pnorm PNorm2 t 57 time $ print $ pnorm PNorm2 t
59 58
59sumVB v = constant 1 (dim v) <.> v
60
60sumVH v = go (d - 1) 0 61sumVH v = go (d - 1) 0
61 where 62 where
62 d = dim v 63 d = dim v
diff --git a/hmatrix.cabal b/hmatrix.cabal
index 8644019..b91790a 100644
--- a/hmatrix.cabal
+++ b/hmatrix.cabal
@@ -7,11 +7,9 @@ Maintainer: Alberto Ruiz <aruiz@um.es>
7Stability: provisional 7Stability: provisional
8Homepage: http://www.hmatrix.googlepages.com 8Homepage: http://www.hmatrix.googlepages.com
9Synopsis: Linear algebra and numerical computations 9Synopsis: Linear algebra and numerical computations
10Description: A purely functional interface to basic linear algebra computations 10Description: This library provides a purely functional interface to basic linear algebra
11 and other numerical routines, internally implemented using 11 and other numerical computations, internally implemented using
12 GSL, BLAS and LAPACK. 12 GSL, BLAS and LAPACK.
13 .
14 More information: <http://www.hmatrix.googlepages.com>
15Category: Math 13Category: Math
16tested-with: GHC ==6.10.1 14tested-with: GHC ==6.10.1
17 15