summaryrefslogtreecommitdiff
path: root/packages/tests
diff options
context:
space:
mode:
authorAlberto Ruiz <aruiz@um.es>2014-05-23 10:51:16 +0200
committerAlberto Ruiz <aruiz@um.es>2014-05-23 10:51:16 +0200
commit0a9ef8f5b0088c1ac25175bffca4ed95d9e109a5 (patch)
tree7bd461ebbf140804e470ae03bb3a2e29bdd935e2 /packages/tests
parent109fa7d25779e331356bbe310755c10eddfeb235 (diff)
relativeError, cgSolve'
Diffstat (limited to 'packages/tests')
-rw-r--r--packages/tests/src/Numeric/LinearAlgebra/Tests/Properties.hs12
1 files changed, 1 insertions, 11 deletions
diff --git a/packages/tests/src/Numeric/LinearAlgebra/Tests/Properties.hs b/packages/tests/src/Numeric/LinearAlgebra/Tests/Properties.hs
index 657689a..423edaa 100644
--- a/packages/tests/src/Numeric/LinearAlgebra/Tests/Properties.hs
+++ b/packages/tests/src/Numeric/LinearAlgebra/Tests/Properties.hs
@@ -54,19 +54,9 @@ import Test.QuickCheck(Arbitrary,arbitrary,coarbitrary,choose,vector
54trivial :: Testable a => Bool -> a -> Property 54trivial :: Testable a => Bool -> a -> Property
55trivial = (`classify` "trivial") 55trivial = (`classify` "trivial")
56 56
57
58-- relative error 57-- relative error
59dist :: (Normed c t, Num (c t)) => c t -> c t -> Double 58dist :: (Normed c t, Num (c t)) => c t -> c t -> Double
60dist a b = realToFrac r 59dist = relativeError Infinity
61 where norm = pnorm Infinity
62 na = norm a
63 nb = norm b
64 nab = norm (a-b)
65 mx = max na nb
66 mn = min na nb
67 r = if mn < peps
68 then mx
69 else nab/mx
70 60
71infixl 4 |~| 61infixl 4 |~|
72a |~| b = a :~10~: b 62a |~| b = a :~10~: b