summaryrefslogtreecommitdiff
path: root/lib/Numeric/LinearAlgebra/Tests.hs
diff options
context:
space:
mode:
authorAlberto Ruiz <aruiz@um.es>2011-01-01 20:59:47 +0000
committerAlberto Ruiz <aruiz@um.es>2011-01-01 20:59:47 +0000
commit9fc924dc107cd619c60a421d288dafb92f417b8c (patch)
treea18d7d69434415eb28caddaf4fba238f74b04360 /lib/Numeric/LinearAlgebra/Tests.hs
parent2b5ea5fdbf68b8c125a9a256aa15a6de849cdbca (diff)
accum
Diffstat (limited to 'lib/Numeric/LinearAlgebra/Tests.hs')
-rw-r--r--lib/Numeric/LinearAlgebra/Tests.hs13
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
395accumTest = 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).
397runTests :: Int -- ^ maximum dimension 409runTests :: 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