summaryrefslogtreecommitdiff
path: root/packages/tests
diff options
context:
space:
mode:
authorAlberto Ruiz <aruiz@um.es>2012-03-13 15:22:30 +0100
committerAlberto Ruiz <aruiz@um.es>2012-03-13 15:22:30 +0100
commitc5fcca336f7d1ad6235d411268d8ff946bbe7f0c (patch)
tree0eb0b76d0e59b75e208d80a68f1641513b00f430 /packages/tests
parent7f12c1f3be9d53cb1290bfdaabf2fed296f47128 (diff)
update ode test and bump versions
Diffstat (limited to 'packages/tests')
-rw-r--r--packages/tests/hmatrix-tests.cabal4
-rw-r--r--packages/tests/src/Numeric/LinearAlgebra/Tests.hs13
2 files changed, 10 insertions, 7 deletions
diff --git a/packages/tests/hmatrix-tests.cabal b/packages/tests/hmatrix-tests.cabal
index d1f449b..ca4c013 100644
--- a/packages/tests/hmatrix-tests.cabal
+++ b/packages/tests/hmatrix-tests.cabal
@@ -1,5 +1,5 @@
1Name: hmatrix-tests 1Name: hmatrix-tests
2Version: 0.1.1 2Version: 0.2
3License: GPL 3License: GPL
4License-file: LICENSE 4License-file: LICENSE
5Author: Alberto Ruiz 5Author: Alberto Ruiz
@@ -21,7 +21,7 @@ extra-source-files: CHANGES
21library 21library
22 22
23 Build-Depends: base >= 4 && < 5, 23 Build-Depends: base >= 4 && < 5,
24 hmatrix >= 0.13, 24 hmatrix >= 0.14,
25 QuickCheck >= 2, HUnit, random 25 QuickCheck >= 2, HUnit, random
26 26
27 hs-source-dirs: src 27 hs-source-dirs: src
diff --git a/packages/tests/src/Numeric/LinearAlgebra/Tests.hs b/packages/tests/src/Numeric/LinearAlgebra/Tests.hs
index 7c41209..fd66767 100644
--- a/packages/tests/src/Numeric/LinearAlgebra/Tests.hs
+++ b/packages/tests/src/Numeric/LinearAlgebra/Tests.hs
@@ -169,11 +169,14 @@ rootFindingTest = TestList [ utest "root Hybrids" (fst sol1 ~~ [1,1])
169 169
170--------------------------------------------------------------------- 170---------------------------------------------------------------------
171 171
172odeTest = utest "ode" (last (toLists sol) ~~ [-1.7588880332411019, 8.364348908711941e-2]) 172odeTest = utest "ode" (last (toLists sol) ~~ newsol)
173 where sol = odeSolveV RK8pd 1E-6 1E-6 0 (l2v $ vanderpol 10) Nothing (fromList [1,0]) ts 173 where
174 ts = linspace 101 (0,100) 174 sol = odeSolveV RK8pd 1E-6 1E-6 0 (l2v $ vanderpol 10) (fromList [1,0]) ts
175 l2v f = \t -> fromList . f t . toList 175 ts = linspace 101 (0,100)
176 vanderpol mu _t [x,y] = [y, -x + mu * y * (1-x^2) ] 176 l2v f = \t -> fromList . f t . toList
177 vanderpol mu _t [x,y] = [y, -x + mu * y * (1-x^2) ]
178 newsol = [-1.758888036617841, 8.364349410519058e-2]
179 -- oldsol = [-1.7588880332411019, 8.364348908711941e-2]
177 180
178--------------------------------------------------------------------- 181---------------------------------------------------------------------
179 182