X-Git-Url: http://gitweb.michael.orlitzky.com/?p=numerical-analysis.git;a=blobdiff_plain;f=src%2FLinear%2FMatrix.hs;h=f6dbec07d316b7209e5e24450647fab27719358f;hp=8006bdea1c2ee624930aa674e980635246c81d5a;hb=9b639d75334420747ce83376910af90368940640;hpb=25706b7e253af82d8ca9128eb23772c47ee6c0c3 diff --git a/src/Linear/Matrix.hs b/src/Linear/Matrix.hs index 8006bde..f6dbec0 100644 --- a/src/Linear/Matrix.hs +++ b/src/Linear/Matrix.hs @@ -109,8 +109,8 @@ instance (Eq a) => Eq (Mat m n a) where -- >>> 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) @@ -557,11 +557,11 @@ infixl 7 * 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))