X-Git-Url: http://gitweb.michael.orlitzky.com/?a=blobdiff_plain;f=src%2FLinear%2FMatrix.hs;h=3af2788ee4c0a3796cd781ae717c2553ca676bce;hb=bd9efa560f5ab4624bef2ae61d98730198a53499;hp=8006bdea1c2ee624930aa674e980635246c81d5a;hpb=6892f38cf4dab275a91fbe06bfb8efe229518336;p=numerical-analysis.git diff --git a/src/Linear/Matrix.hs b/src/Linear/Matrix.hs index 8006bde..3af2788 100644 --- a/src/Linear/Matrix.hs +++ b/src/Linear/Matrix.hs @@ -67,6 +67,8 @@ type Mat2 a = Mat N2 N2 a type Mat3 a = Mat N3 N3 a type Mat4 a = Mat N4 N4 a type Mat5 a = Mat N5 N5 a +type Mat6 a = Mat N6 N6 a +type Mat7 a = Mat N7 N7 a -- * Type synonyms for 1-by-n row "vectors". @@ -109,8 +111,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 +559,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))