summaryrefslogtreecommitdiff
path: root/lib/Numeric/LinearAlgebra/Tests.hs
diff options
context:
space:
mode:
authorAlberto Ruiz <aruiz@um.es>2010-02-07 09:29:50 +0000
committerAlberto Ruiz <aruiz@um.es>2010-02-07 09:29:50 +0000
commitaef0333b5180ea79e539bd53194f1dfed20b7db5 (patch)
tree6ece2434ecacab194331120bd47d09ab04ae0f4f /lib/Numeric/LinearAlgebra/Tests.hs
parent634683fcfab73a0bd830fef03fb9f4603ba837b6 (diff)
added odeSolve
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 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
138odeTest = 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
138randomTestGaussian = c :~1~: snd (meanCov dat) where 146randomTestGaussian = 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