diff options
author | Alberto Ruiz <aruiz@um.es> | 2010-05-12 06:15:35 +0000 |
---|---|---|
committer | Alberto Ruiz <aruiz@um.es> | 2010-05-12 06:15:35 +0000 |
commit | ff8ba85a52acdd1e30f45ba73ae0c40986c8a9d4 (patch) | |
tree | 1c4ac1d9256a687817633fea426261d6a18ecc31 /lib/Numeric/LinearAlgebra/Tests.hs | |
parent | aa8debb5ab389de7bc5b47c5ae5f038349b6efc1 (diff) |
more simplification
Diffstat (limited to 'lib/Numeric/LinearAlgebra/Tests.hs')
-rw-r--r-- | lib/Numeric/LinearAlgebra/Tests.hs | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/lib/Numeric/LinearAlgebra/Tests.hs b/lib/Numeric/LinearAlgebra/Tests.hs index ac26466..65b0e4c 100644 --- a/lib/Numeric/LinearAlgebra/Tests.hs +++ b/lib/Numeric/LinearAlgebra/Tests.hs | |||
@@ -78,6 +78,11 @@ volSphere r = 8 * quad2 (\x y -> sqrt (r*r-x*x-y*y)) | |||
78 | 78 | ||
79 | --------------------------------------------------------------------- | 79 | --------------------------------------------------------------------- |
80 | 80 | ||
81 | derivTest = abs (d (\x-> x * d (\y-> x+y) 1) 1 - 1) < 1E-10 | ||
82 | where d f x = fst $ derivCentral 0.01 f x | ||
83 | |||
84 | --------------------------------------------------------------------- | ||
85 | |||
81 | -- besselTest = utest "bessel_J0_e" ( abs (r-expected) < e ) | 86 | -- besselTest = utest "bessel_J0_e" ( abs (r-expected) < e ) |
82 | -- where (r,e) = bessel_J0_e 5.0 | 87 | -- where (r,e) = bessel_J0_e 5.0 |
83 | -- expected = -0.17759677131433830434739701 | 88 | -- expected = -0.17759677131433830434739701 |
@@ -319,6 +324,7 @@ runTests n = do | |||
319 | -- , utest "gamma" (gamma 5 == 24.0) | 324 | -- , utest "gamma" (gamma 5 == 24.0) |
320 | -- , besselTest | 325 | -- , besselTest |
321 | -- , exponentialTest | 326 | -- , exponentialTest |
327 | , utest "deriv" derivTest | ||
322 | , utest "integrate" (abs (volSphere 2.5 - 4/3*pi*2.5^3) < 1E-8) | 328 | , utest "integrate" (abs (volSphere 2.5 - 4/3*pi*2.5^3) < 1E-8) |
323 | , utest "polySolve" (polySolveProp [1,2,3,4]) | 329 | , utest "polySolve" (polySolveProp [1,2,3,4]) |
324 | , minimizationTest | 330 | , minimizationTest |