diff options
Diffstat (limited to 'lib/Numeric/LinearAlgebra')
-rw-r--r-- | lib/Numeric/LinearAlgebra/Tests.hs | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/lib/Numeric/LinearAlgebra/Tests.hs b/lib/Numeric/LinearAlgebra/Tests.hs index 3bcfec5..32cd39d 100644 --- a/lib/Numeric/LinearAlgebra/Tests.hs +++ b/lib/Numeric/LinearAlgebra/Tests.hs | |||
@@ -392,6 +392,18 @@ conformTest = utest "conform" ok | |||
392 | 392 | ||
393 | --------------------------------------------------------------------- | 393 | --------------------------------------------------------------------- |
394 | 394 | ||
395 | accumTest = utest "accum" ok | ||
396 | where | ||
397 | x = ident 3 :: Matrix Double | ||
398 | ok = accum x (+) [((1,2),7), ((2,2),3)] | ||
399 | == (3><3) [1,0,0 | ||
400 | ,0,1,7 | ||
401 | ,0,0,4] | ||
402 | && | ||
403 | toList (flatten x) == [1,0,0,0,1,0,0,0,1] | ||
404 | |||
405 | --------------------------------------------------------------------- | ||
406 | |||
395 | -- | All tests must pass with a maximum dimension of about 20 | 407 | -- | All tests must pass with a maximum dimension of about 20 |
396 | -- (some tests may fail with bigger sizes due to precision loss). | 408 | -- (some tests may fail with bigger sizes due to precision loss). |
397 | runTests :: Int -- ^ maximum dimension | 409 | runTests :: Int -- ^ maximum dimension |
@@ -562,6 +574,7 @@ runTests n = do | |||
562 | , findAssocTest | 574 | , findAssocTest |
563 | , condTest | 575 | , condTest |
564 | , conformTest | 576 | , conformTest |
577 | , accumTest | ||
565 | ] | 578 | ] |
566 | return () | 579 | return () |
567 | 580 | ||