diff options
Diffstat (limited to 'lib/Numeric/LinearAlgebra/Tests.hs')
-rw-r--r-- | lib/Numeric/LinearAlgebra/Tests.hs | 9 |
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 | |||
166 | mbCholTest = 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 | ||
166 | randomTestGaussian = c :~1~: snd (meanCov dat) where | 174 | randomTestGaussian = 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 | ||