diff options
Diffstat (limited to 'packages/tests/src/Numeric/LinearAlgebra/Tests/Properties.hs')
-rw-r--r-- | packages/tests/src/Numeric/LinearAlgebra/Tests/Properties.hs | 12 |
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 | |||
54 | trivial :: Testable a => Bool -> a -> Property | 54 | trivial :: Testable a => Bool -> a -> Property |
55 | trivial = (`classify` "trivial") | 55 | trivial = (`classify` "trivial") |
56 | 56 | ||
57 | |||
58 | -- relative error | 57 | -- relative error |
59 | dist :: (Normed c t, Num (c t)) => c t -> c t -> Double | 58 | dist :: (Normed c t, Num (c t)) => c t -> c t -> Double |
60 | dist a b = realToFrac r | 59 | dist = 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 | ||
71 | infixl 4 |~| | 61 | infixl 4 |~| |
72 | a |~| b = a :~10~: b | 62 | a |~| b = a :~10~: b |