-- >>> m1 == m3
-- False
--
- (Mat rows1) == (Mat rows2) =
- V.and $ V.zipWith comp rows1 rows2
+ (Mat rows_one) == (Mat rows_two) =
+ V.and $ V.zipWith comp rows_one rows_two
where
-- Compare a row, one column at a time.
comp row1 row2 = V.and (V.zipWith (==) row1 row2)
instance (Ring.C a, Arity m, Arity n) => Additive.C (Mat m n a) where
- (Mat rows1) + (Mat rows2) =
- Mat $ V.zipWith (V.zipWith (+)) rows1 rows2
+ (Mat rows_one) + (Mat rows_two) =
+ Mat $ V.zipWith (V.zipWith (+)) rows_one rows_two
- (Mat rows1) - (Mat rows2) =
- Mat $ V.zipWith (V.zipWith (-)) rows1 rows2
+ (Mat rows_one) - (Mat rows_two) =
+ Mat $ V.zipWith (V.zipWith (-)) rows_one rows_two
zero = Mat (V.replicate $ V.replicate (fromInteger 0))