Safe Haskell | Safe |
---|---|
Language | Haskell2010 |
Synopsis
- type Matrix a = Vector (Vector a)
- pretty :: Show a => String -> Matrix a -> IO ()
- isNull :: Matrix a -> Bool
- size :: Matrix a -> (Int, Int)
- wellFormed :: Matrix a -> Matrix a
- groupEvery :: Int -> [a] -> [[a]]
- matrix :: Int -> Int -> [a] -> Matrix a
- fromMatrix :: Matrix a -> [a]
- fanout :: a -> Matrix a
- indexes :: Matrix (Int, Int)
- farm11 :: (a -> b) -> Matrix a -> Matrix b
- farm21 :: (a -> b -> c) -> Matrix a -> Matrix b -> Matrix c
- farm31 :: (a -> b -> c -> d) -> Matrix a -> Matrix b -> Matrix c -> Matrix d
- reduce :: (a -> a -> a) -> Matrix a -> a
- dotV :: (a -> a -> a) -> (b -> a -> a) -> Matrix b -> Vector a -> Vector a
- dot :: (a -> a -> a) -> (b -> a -> a) -> Matrix b -> Matrix a -> Matrix a
- get :: Int -> Int -> Matrix a -> Maybe a
- take :: Int -> Int -> Matrix a -> Matrix a
- drop :: Int -> Int -> Matrix a -> Matrix a
- crop :: Int -> Int -> Int -> Int -> Matrix a -> Matrix a
- group :: Int -> Int -> Matrix a -> Matrix (Matrix a)
- stencil :: Int -> Int -> Matrix a -> Matrix (Matrix a)
- reverse :: Matrix a -> Matrix a
- transpose :: Matrix a -> Matrix a
- replace :: Int -> Int -> Matrix a -> Matrix a -> Matrix a
Documentation
Prints out to the terminal a matrix in a readable format, where all elements are right-aligned and separated by a custom separator.
>>>
let m = matrix 3 3 [1,2,3,3,100,4,12,32,67]
>>>
pretty "|" m
1| 2| 3 3|100| 4 12| 32|67
wellFormed :: Matrix a -> Matrix a Source #
See wellFormed
.
groupEvery :: Int -> [a] -> [[a]] Source #
:: Int | number of columns (X dimension) |
-> Int | number of rows (Y dimension) |
-> [a] | list of values; length = |
-> Matrix a |
|
See Matrix
.
:: (a -> b -> c) | |
-> Matrix a | size = |
-> Matrix b | size = |
-> Matrix c | size = |
See farm21
.
:: (a -> b -> c -> d) | |
-> Matrix a | size = |
-> Matrix b | size = |
-> Matrix c | size = |
-> Matrix d | size = |
See farm31
.
:: (a -> a -> a) | kernel function for a row/column reduction, e.g. |
-> (b -> a -> a) | binary operation for pair-wise elements, e.g. |
-> Matrix b | size = |
-> Vector a | length = |
-> Vector a | length = |
See fotV
.
:: (a -> a -> a) | kernel function for a row/column reduction, e.g. |
-> (b -> a -> a) | binary operation for pair-wise elements, e.g. |
-> Matrix b | size = |
-> Matrix a | size = |
-> Matrix a | size = |
See dot
.
See get
.
See take
.
See drop
.
:: Int | crop width = |
-> Int | crop height = |
-> Int | X start position = |
-> Int | Y start position = |
-> Matrix a | size = |
-> Matrix a | size = |
See crop
.