diff options
Diffstat (limited to 'lib/Numeric/LinearAlgebra/Tests/Properties.hs')
-rw-r--r-- | lib/Numeric/LinearAlgebra/Tests/Properties.hs | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/lib/Numeric/LinearAlgebra/Tests/Properties.hs b/lib/Numeric/LinearAlgebra/Tests/Properties.hs index 9891d8a..d6bb338 100644 --- a/lib/Numeric/LinearAlgebra/Tests/Properties.hs +++ b/lib/Numeric/LinearAlgebra/Tests/Properties.hs | |||
@@ -54,15 +54,15 @@ complex x = complex'' x | |||
54 | debug x = trace (show x) x | 54 | debug x = trace (show x) x |
55 | 55 | ||
56 | -- relative error | 56 | -- relative error |
57 | dist :: (Normed t, Num t) => t -> t -> Double | 57 | --dist :: (Normed t, Num t) => t -> t -> Double |
58 | dist a b = r | 58 | dist a b = r |
59 | where norm = pnorm Infinity | 59 | where norm = normInf |
60 | na = norm a | 60 | na = norm a |
61 | nb = norm b | 61 | nb = norm b |
62 | nab = norm (a-b) | 62 | nab = norm (a-b) |
63 | mx = max na nb | 63 | mx = max na nb |
64 | mn = min na nb | 64 | mn = min na nb |
65 | r = if mn < eps | 65 | r = if mn < peps |
66 | then mx | 66 | then mx |
67 | else nab/mx | 67 | else nab/mx |
68 | 68 | ||
@@ -71,7 +71,7 @@ a |~| b = a :~10~: b | |||
71 | --a |~| b = dist a b < 10^^(-10) | 71 | --a |~| b = dist a b < 10^^(-10) |
72 | 72 | ||
73 | data Aprox a = (:~) a Int | 73 | data Aprox a = (:~) a Int |
74 | (~:) :: (Normed a, Num a) => Aprox a -> a -> Bool | 74 | -- (~:) :: (Normed a, Num a) => Aprox a -> a -> Bool |
75 | a :~n~: b = dist a b < 10^^(-n) | 75 | a :~n~: b = dist a b < 10^^(-n) |
76 | 76 | ||
77 | ------------------------------------------------------ | 77 | ------------------------------------------------------ |