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]] |
|
indeces (Mat m) = Mat [[(x,y) | y <- [0..length (m !! x)-1]] |
|
||||||
x <- [0..length m-1]]
|
x <- [0..length m-1]]
|
||||||
|
|
||||||
-- | Create a matrix of zeros
|
-- | Create a constant matrix
|
||||||
zeros :: Int -> Int -> Mat Int
|
constant :: a -> Int -> Int -> Mat a
|
||||||
zeros x y = Mat (replicate x $ replicate y 0)
|
constant k x y = Mat (replicate x $ replicate y k)
|
Loading…
Reference in New Issue
Block a user