Generalize empty matrix function
This commit is contained in:
parent
5bae8c5796
commit
68e812646f
@ -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)
|
Loading…
Reference in New Issue
Block a user