summaryrefslogtreecommitdiff
path: root/packages/base/src
diff options
context:
space:
mode:
authorHuw Campbell <huw.campbell@ambiata.com>2017-03-17 14:23:59 +1100
committerHuw Campbell <huw.campbell@ambiata.com>2017-03-17 14:37:36 +1100
commit494b910a084f4daed21055aedf315f2c12074617 (patch)
treeb0d89ed2ef042720aff5c7ad5b5a8ba8bd7bebc8 /packages/base/src
parentd2d0066d2ff3d8e66ce902ee1b9d1317f1710a2c (diff)
Fix bug in equal
Diffstat (limited to 'packages/base/src')
-rw-r--r--packages/base/src/Internal/Numeric.hs25
1 files changed, 13 insertions, 12 deletions
diff --git a/packages/base/src/Internal/Numeric.hs b/packages/base/src/Internal/Numeric.hs
index dd74165..c9ef0c5 100644
--- a/packages/base/src/Internal/Numeric.hs
+++ b/packages/base/src/Internal/Numeric.hs
@@ -25,6 +25,7 @@ import Internal.Conversion
25import Internal.Vectorized 25import Internal.Vectorized
26import Internal.LAPACK(multiplyR,multiplyC,multiplyF,multiplyQ,multiplyI,multiplyL) 26import Internal.LAPACK(multiplyR,multiplyC,multiplyF,multiplyQ,multiplyI,multiplyL)
27import Data.List.Split(chunksOf) 27import Data.List.Split(chunksOf)
28import qualified Data.Vector.Storable as V
28 29
29-------------------------------------------------------------------------------- 30--------------------------------------------------------------------------------
30 31
@@ -102,8 +103,8 @@ instance Container Vector I
102 add' = vectorZipI Add 103 add' = vectorZipI Add
103 sub = vectorZipI Sub 104 sub = vectorZipI Sub
104 mul = vectorZipI Mul 105 mul = vectorZipI Mul
105 equal u v = dim u == dim v && maxElement' (vectorMapI Abs (sub u v)) == 0 106 equal = (==)
106 scalar' x = fromList [x] 107 scalar' = V.singleton
107 konst' = constantD 108 konst' = constantD
108 build' = buildV 109 build' = buildV
109 cmap' = mapVector 110 cmap' = mapVector
@@ -141,8 +142,8 @@ instance Container Vector Z
141 add' = vectorZipL Add 142 add' = vectorZipL Add
142 sub = vectorZipL Sub 143 sub = vectorZipL Sub
143 mul = vectorZipL Mul 144 mul = vectorZipL Mul
144 equal u v = dim u == dim v && maxElement' (vectorMapL Abs (sub u v)) == 0 145 equal = (==)
145 scalar' x = fromList [x] 146 scalar' = V.singleton
146 konst' = constantD 147 konst' = constantD
147 build' = buildV 148 build' = buildV
148 cmap' = mapVector 149 cmap' = mapVector
@@ -181,8 +182,8 @@ instance Container Vector Float
181 add' = vectorZipF Add 182 add' = vectorZipF Add
182 sub = vectorZipF Sub 183 sub = vectorZipF Sub
183 mul = vectorZipF Mul 184 mul = vectorZipF Mul
184 equal u v = dim u == dim v && maxElement (vectorMapF Abs (sub u v)) == 0.0 185 equal = (==)
185 scalar' x = fromList [x] 186 scalar' = V.singleton
186 konst' = constantD 187 konst' = constantD
187 build' = buildV 188 build' = buildV
188 cmap' = mapVector 189 cmap' = mapVector
@@ -218,8 +219,8 @@ instance Container Vector Double
218 add' = vectorZipR Add 219 add' = vectorZipR Add
219 sub = vectorZipR Sub 220 sub = vectorZipR Sub
220 mul = vectorZipR Mul 221 mul = vectorZipR Mul
221 equal u v = dim u == dim v && maxElement (vectorMapR Abs (sub u v)) == 0.0 222 equal = (==)
222 scalar' x = fromList [x] 223 scalar' = V.singleton
223 konst' = constantD 224 konst' = constantD
224 build' = buildV 225 build' = buildV
225 cmap' = mapVector 226 cmap' = mapVector
@@ -255,8 +256,8 @@ instance Container Vector (Complex Double)
255 add' = vectorZipC Add 256 add' = vectorZipC Add
256 sub = vectorZipC Sub 257 sub = vectorZipC Sub
257 mul = vectorZipC Mul 258 mul = vectorZipC Mul
258 equal u v = dim u == dim v && maxElement (mapVector magnitude (sub u v)) == 0.0 259 equal = (==)
259 scalar' x = fromList [x] 260 scalar' = V.singleton
260 konst' = constantD 261 konst' = constantD
261 build' = buildV 262 build' = buildV
262 cmap' = mapVector 263 cmap' = mapVector
@@ -291,8 +292,8 @@ instance Container Vector (Complex Float)
291 add' = vectorZipQ Add 292 add' = vectorZipQ Add
292 sub = vectorZipQ Sub 293 sub = vectorZipQ Sub
293 mul = vectorZipQ Mul 294 mul = vectorZipQ Mul
294 equal u v = dim u == dim v && maxElement (mapVector magnitude (sub u v)) == 0.0 295 equal = (==)
295 scalar' x = fromList [x] 296 scalar' = V.singleton
296 konst' = constantD 297 konst' = constantD
297 build' = buildV 298 build' = buildV
298 cmap' = mapVector 299 cmap' = mapVector