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 e6b26a0..46c1804 100644 --- a/lib/Numeric/LinearAlgebra/Tests.hs +++ b/lib/Numeric/LinearAlgebra/Tests.hs | |||
@@ -135,6 +135,14 @@ rootFindingTest = TestList [ utest "root Hybrids" (fst sol1 ~~ [1,1]) | |||
135 | 135 | ||
136 | --------------------------------------------------------------------- | 136 | --------------------------------------------------------------------- |
137 | 137 | ||
138 | odeTest = utest "ode" (last (toLists sol) ~~ [-1.7588880332411019, 8.364348908711941e-2]) | ||
139 | where sol = odeSolveV RK8pd 1E-6 1E-6 0 (l2v $ vanderpol 10) Nothing (fromList [1,0]) ts | ||
140 | ts = linspace 101 (0,100) | ||
141 | l2v f = \t -> fromList . f t . toList | ||
142 | vanderpol mu _t [x,y] = [y, -x + mu * y * (1-x^2) ] | ||
143 | |||
144 | --------------------------------------------------------------------- | ||
145 | |||
138 | randomTestGaussian = c :~1~: snd (meanCov dat) where | 146 | randomTestGaussian = c :~1~: snd (meanCov dat) where |
139 | a = (3><3) [1,2,3, | 147 | a = (3><3) [1,2,3, |
140 | 2,4,0, | 148 | 2,4,0, |
@@ -280,6 +288,7 @@ runTests n = do | |||
280 | , utest "rank" $ rank ((2><3)[1,0,0,1,6*eps,0]) == 1 | 288 | , utest "rank" $ rank ((2><3)[1,0,0,1,6*eps,0]) == 1 |
281 | && rank ((2><3)[1,0,0,1,7*eps,0]) == 2 | 289 | && rank ((2><3)[1,0,0,1,7*eps,0]) == 2 |
282 | , utest "block" $ fromBlocks [[ident 3,0],[0,ident 4]] == (ident 7 :: CM) | 290 | , utest "block" $ fromBlocks [[ident 3,0],[0,ident 4]] == (ident 7 :: CM) |
291 | , odeTest | ||
283 | ] | 292 | ] |
284 | return () | 293 | return () |
285 | 294 | ||