From c5fcca336f7d1ad6235d411268d8ff946bbe7f0c Mon Sep 17 00:00:00 2001 From: Alberto Ruiz Date: Tue, 13 Mar 2012 15:22:30 +0100 Subject: update ode test and bump versions --- packages/tests/hmatrix-tests.cabal | 4 ++-- packages/tests/src/Numeric/LinearAlgebra/Tests.hs | 13 ++++++++----- 2 files changed, 10 insertions(+), 7 deletions(-) (limited to 'packages/tests') 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 @@ Name: hmatrix-tests -Version: 0.1.1 +Version: 0.2 License: GPL License-file: LICENSE Author: Alberto Ruiz @@ -21,7 +21,7 @@ extra-source-files: CHANGES library Build-Depends: base >= 4 && < 5, - hmatrix >= 0.13, + hmatrix >= 0.14, QuickCheck >= 2, HUnit, random 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]) --------------------------------------------------------------------- -odeTest = utest "ode" (last (toLists sol) ~~ [-1.7588880332411019, 8.364348908711941e-2]) - where sol = odeSolveV RK8pd 1E-6 1E-6 0 (l2v $ vanderpol 10) Nothing (fromList [1,0]) ts - ts = linspace 101 (0,100) - l2v f = \t -> fromList . f t . toList - vanderpol mu _t [x,y] = [y, -x + mu * y * (1-x^2) ] +odeTest = utest "ode" (last (toLists sol) ~~ newsol) + where + sol = odeSolveV RK8pd 1E-6 1E-6 0 (l2v $ vanderpol 10) (fromList [1,0]) ts + ts = linspace 101 (0,100) + l2v f = \t -> fromList . f t . toList + vanderpol mu _t [x,y] = [y, -x + mu * y * (1-x^2) ] + newsol = [-1.758888036617841, 8.364349410519058e-2] + -- oldsol = [-1.7588880332411019, 8.364348908711941e-2] --------------------------------------------------------------------- -- cgit v1.2.3