diff options
-rw-r--r-- | examples/benchmarks.hs | 17 | ||||
-rw-r--r-- | hmatrix.cabal | 6 |
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 | |||
32 | bench1 = do | 32 | bench1 = 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 | ||
59 | sumVB v = constant 1 (dim v) <.> v | ||
60 | |||
60 | sumVH v = go (d - 1) 0 | 61 | sumVH 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> | |||
7 | Stability: provisional | 7 | Stability: provisional |
8 | Homepage: http://www.hmatrix.googlepages.com | 8 | Homepage: http://www.hmatrix.googlepages.com |
9 | Synopsis: Linear algebra and numerical computations | 9 | Synopsis: Linear algebra and numerical computations |
10 | Description: A purely functional interface to basic linear algebra computations | 10 | Description: 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> | ||
15 | Category: Math | 13 | Category: Math |
16 | tested-with: GHC ==6.10.1 | 14 | tested-with: GHC ==6.10.1 |
17 | 15 | ||