summaryrefslogtreecommitdiff
path: root/lib/Numeric/LinearAlgebra/Tests.hs
diff options
context:
space:
mode:
authorAlberto Ruiz <aruiz@um.es>2010-04-07 07:18:41 +0000
committerAlberto Ruiz <aruiz@um.es>2010-04-07 07:18:41 +0000
commitbc854c679c77cbdc97ee2e24383322550109118d (patch)
tree903f8cce6d3dfbca8a7f6ca80fbe3b080102c046 /lib/Numeric/LinearAlgebra/Tests.hs
parent2e48ffd1a395817288b8271299eebd0e483407af (diff)
mbCholSH
Diffstat (limited to 'lib/Numeric/LinearAlgebra/Tests.hs')
-rw-r--r--lib/Numeric/LinearAlgebra/Tests.hs9
1 files changed, 9 insertions, 0 deletions
diff --git a/lib/Numeric/LinearAlgebra/Tests.hs b/lib/Numeric/LinearAlgebra/Tests.hs
index 60c60e6..ac26466 100644
--- a/lib/Numeric/LinearAlgebra/Tests.hs
+++ b/lib/Numeric/LinearAlgebra/Tests.hs
@@ -161,6 +161,14 @@ fittingTest = utest "levmar" (ok1 && ok2)
161 ok1 = and (zipWith f sols [5,0.1,1]) where f (x,d) r = abs (x-r)<2*d 161 ok1 = and (zipWith f sols [5,0.1,1]) where f (x,d) r = abs (x-r)<2*d
162 ok2 = pnorm PNorm2 (fromList (map fst sols) - fromList sol) < 1E-5 162 ok2 = pnorm PNorm2 (fromList (map fst sols) - fromList sol) < 1E-5
163 163
164-----------------------------------------------------
165
166mbCholTest = utest "mbCholTest" (ok1 && ok2) where
167 m1 = (2><2) [2,5,5,8 :: Double]
168 m2 = (2><2) [3,5,5,9 :: Complex Double]
169 ok1 = mbCholSH m1 == Nothing
170 ok2 = mbCholSH m2 == Just (chol m2)
171
164--------------------------------------------------------------------- 172---------------------------------------------------------------------
165 173
166randomTestGaussian = c :~1~: snd (meanCov dat) where 174randomTestGaussian = c :~1~: snd (meanCov dat) where
@@ -325,6 +333,7 @@ runTests n = do
325 , utest "block" $ fromBlocks [[ident 3,0],[0,ident 4]] == (ident 7 :: CM) 333 , utest "block" $ fromBlocks [[ident 3,0],[0,ident 4]] == (ident 7 :: CM)
326 , odeTest 334 , odeTest
327 , fittingTest 335 , fittingTest
336 , mbCholTest
328 ] 337 ]
329 return () 338 return ()
330 339