Permalink
Browse files

AEq instance for matrices.

  • Loading branch information...
1 parent 8876585 commit d58924b199ddf2d1529b83ac66f50d4aec969eea @bjornbm committed Dec 6, 2014
Showing with 8 additions and 4 deletions.
  1. +7 −3 Numeric/Units/Dimensional/AEq.hs
  2. +1 −1 dimensional-experimental.cabal
View
10 Numeric/Units/Dimensional/AEq.hs
@@ -8,12 +8,16 @@ module Numeric.Units.Dimensional.AEq where
import Numeric.Units.Dimensional (Dimensional (Dimensional), Quantity)
import Numeric.Units.Dimensional.LinearAlgebra.Vector (Vec (ListVec))
+import Numeric.Units.Dimensional.LinearAlgebra.Matrix (Mat (ListMat))
import Data.AEq
deriving instance AEq a => AEq (Quantity d a)
-instance (Floating a, AEq a) => AEq (Vec ds a) -- CPos et al
+instance (Floating a, AEq a) => AEq (Vec ds a)
where
- -- ListVec xs === ListVec ys = and $ zipWith (===) xs ys
- ListVec xs ~== ListVec ys = and $ zipWith (~==) xs ys
+ ListVec xs ~== ListVec ys = xs ~== ys
+
+instance (Floating a, AEq a) => AEq (Mat ds a)
+ where
+ ListMat xs ~== ListMat ys = xs ~== ys
View
2 dimensional-experimental.cabal
@@ -1,5 +1,5 @@
Name: dimensional-experimental
-Version: 0.9.0.2
+Version: 0.10.0.0
License: BSD3
License-File: LICENSE
Copyright: Bjorn Buckwalter 2008-2014

0 comments on commit d58924b

Please sign in to comment.