diff --git a/Matrix.hs b/Matrix.hs index 17440d4..1c4983b 100644 --- a/Matrix.hs +++ b/Matrix.hs @@ -24,6 +24,6 @@ indeces :: Mat a -> Mat Pos indeces (Mat m) = Mat [[(x,y) | y <- [0..length (m !! x)-1]] | x <- [0..length m-1]] --- | Create a matrix of zeros -zeros :: Int -> Int -> Mat Int -zeros x y = Mat (replicate x $ replicate y 0) \ No newline at end of file +-- | Create a constant matrix +constant :: a -> Int -> Int -> Mat a +constant k x y = Mat (replicate x $ replicate y k) \ No newline at end of file