Operations on matrices (doubly-nested parallel vectors). All operations in this module assume rectangular matrices.
- type Matrix a = Vector (Vector (Data a))
- freezeMatrix :: Storable a => Matrix a -> Data [[a]]
- unfreezeMatrix :: Storable a => Data Length -> Data Length -> Data [[a]] -> Matrix a
- matrix :: Storable a => [[a]] -> Matrix a
- transpose :: Matrix a -> Matrix a
- mul :: Numeric a => Matrix a -> Matrix a -> Matrix a
- flatten :: Matrix a -> Vector (Data a)
- diagonal :: Matrix a -> Vector (Data a)
Documentation
freezeMatrix :: Storable a => Matrix a -> Data [[a]]Source
Converts a matrix to a core array.
unfreezeMatrix :: Storable a => Data Length -> Data Length -> Data [[a]] -> Matrix aSource
Converts a core array to a matrix. The first length argument is the number of rows (outer vector), and the second argument is the number of columns (inner argument).