Generalize empty matrix function

This commit is contained in:
Rnhmjoj 2014-12-19 20:28:32 +01:00
parent 5bae8c5796
commit 68e812646f

View File

@ -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)
-- | Create a constant matrix
constant :: a -> Int -> Int -> Mat a
constant k x y = Mat (replicate x $ replicate y k)