diff options
author | Alberto Ruiz <aruiz@um.es> | 2010-01-14 13:17:44 +0000 |
---|---|---|
committer | Alberto Ruiz <aruiz@um.es> | 2010-01-14 13:17:44 +0000 |
commit | b8b9e8a91b51e6689a071dbc05f3da857c762e0d (patch) | |
tree | 0db5532668c77a7934dd181195aeb84c9f22ddc2 /lib/Numeric/LinearAlgebra/Tests.hs | |
parent | dfd2cb93e1f6c9fe42ddfd6775ecd1ab7c980ccf (diff) |
dispf, disps
Diffstat (limited to 'lib/Numeric/LinearAlgebra/Tests.hs')
-rw-r--r-- | lib/Numeric/LinearAlgebra/Tests.hs | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/lib/Numeric/LinearAlgebra/Tests.hs b/lib/Numeric/LinearAlgebra/Tests.hs index 9557ac3..063ae86 100644 --- a/lib/Numeric/LinearAlgebra/Tests.hs +++ b/lib/Numeric/LinearAlgebra/Tests.hs | |||
@@ -321,6 +321,8 @@ manymult n = foldl1' (<>) (map rot2 angles) where | |||
321 | where c = cos a | 321 | where c = cos a |
322 | s = sin a | 322 | s = sin a |
323 | 323 | ||
324 | multb n = foldl1' (<>) (replicate (10^6) (ident n :: Matrix Double)) | ||
325 | |||
324 | -------------------------------- | 326 | -------------------------------- |
325 | 327 | ||
326 | multBench = do | 328 | multBench = do |
@@ -328,6 +330,15 @@ multBench = do | |||
328 | let b = ident 2000 :: Matrix Double | 330 | let b = ident 2000 :: Matrix Double |
329 | a `seq` b `seq` putStrLn "" | 331 | a `seq` b `seq` putStrLn "" |
330 | time "product of 1M different 3x3 matrices" (manymult (10^6)) | 332 | time "product of 1M different 3x3 matrices" (manymult (10^6)) |
333 | putStrLn "" | ||
334 | time "product of 1M constant 1x1 matrices" (multb 1) | ||
335 | time "product of 1M constant 3x3 matrices" (multb 3) | ||
336 | --time "product of 1M constant 5x5 matrices" (multb 5) | ||
337 | time "product of 1M const. 10x10 matrices" (multb 10) | ||
338 | --time "product of 1M const. 15x15 matrices" (multb 15) | ||
339 | time "product of 1M const. 20x20 matrices" (multb 20) | ||
340 | --time "product of 1M const. 25x25 matrices" (multb 25) | ||
341 | putStrLn "" | ||
331 | time "product (1000 x 1000)<>(1000 x 1000)" (a<>a) | 342 | time "product (1000 x 1000)<>(1000 x 1000)" (a<>a) |
332 | time "product (2000 x 2000)<>(2000 x 2000)" (b<>b) | 343 | time "product (2000 x 2000)<>(2000 x 2000)" (b<>b) |
333 | 344 | ||