diff options
author | Alberto Ruiz <aruiz@um.es> | 2010-03-01 11:15:22 +0000 |
---|---|---|
committer | Alberto Ruiz <aruiz@um.es> | 2010-03-01 11:15:22 +0000 |
commit | 283f3033f86fabde2290bb28a59e7d87fd0754f5 (patch) | |
tree | ac9000c976a805636b557b916af9e139922df70c /lib/Numeric/LinearAlgebra/Tests.hs | |
parent | 54bcc1fc1e0f9676cb10f627f412eeeea34b5d2c (diff) |
compatible with vector
Diffstat (limited to 'lib/Numeric/LinearAlgebra/Tests.hs')
-rw-r--r-- | lib/Numeric/LinearAlgebra/Tests.hs | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/lib/Numeric/LinearAlgebra/Tests.hs b/lib/Numeric/LinearAlgebra/Tests.hs index 016b9a1..3f7c847 100644 --- a/lib/Numeric/LinearAlgebra/Tests.hs +++ b/lib/Numeric/LinearAlgebra/Tests.hs | |||
@@ -180,6 +180,9 @@ runTests n = do | |||
180 | test (multProp1 . cConsist) | 180 | test (multProp1 . cConsist) |
181 | test (multProp2 . rConsist) | 181 | test (multProp2 . rConsist) |
182 | test (multProp2 . cConsist) | 182 | test (multProp2 . cConsist) |
183 | putStrLn "------ sub-trans" | ||
184 | test (subProp . rM) | ||
185 | test (subProp . cM) | ||
183 | putStrLn "------ lu" | 186 | putStrLn "------ lu" |
184 | test (luProp . rM) | 187 | test (luProp . rM) |
185 | test (luProp . cM) | 188 | test (luProp . cM) |
@@ -305,6 +308,7 @@ makeUnitary v | realPart n > 1 = v / scalar n | |||
305 | -- | Performance measurements. | 308 | -- | Performance measurements. |
306 | runBenchmarks :: IO () | 309 | runBenchmarks :: IO () |
307 | runBenchmarks = do | 310 | runBenchmarks = do |
311 | subBench | ||
308 | multBench | 312 | multBench |
309 | svdBench | 313 | svdBench |
310 | eigBench | 314 | eigBench |
@@ -335,6 +339,16 @@ multb n = foldl1' (<>) (replicate (10^6) (ident n :: Matrix Double)) | |||
335 | 339 | ||
336 | -------------------------------- | 340 | -------------------------------- |
337 | 341 | ||
342 | subBench = do | ||
343 | putStrLn "" | ||
344 | let g = foldl1' (.) (replicate (10^5) (\v -> subVector 1 (dim v -1) v)) | ||
345 | time "0.1M subVector " (g (constant 1 (1+10^5) :: Vector Double) @> 0) | ||
346 | let f = foldl1' (.) (replicate (10^5) (fromRows.toRows)) | ||
347 | time "subVector-join 3" (f (ident 3 :: Matrix Double) @@>(0,0)) | ||
348 | time "subVector-join 10" (f (ident 10 :: Matrix Double) @@>(0,0)) | ||
349 | |||
350 | -------------------------------- | ||
351 | |||
338 | multBench = do | 352 | multBench = do |
339 | let a = ident 1000 :: Matrix Double | 353 | let a = ident 1000 :: Matrix Double |
340 | let b = ident 2000 :: Matrix Double | 354 | let b = ident 2000 :: Matrix Double |