sized-types- Sized types in Haskell.

Safe HaskellSafe-Inferred



Sparse Matrix.

Copyright: (c) 2009 University of Kansas License: BSD3

Maintainer: Andy Gill Stability: unstable Portability: ghc



data Matrix ix a Source


Matrix a (Map ix a) 


Functor (Matrix ix) 
Size i => Applicative (Matrix i) 
(Show a, Size ix) => Show (Matrix ix a) 

fromAssocList :: (Ord i, Eq a) => a -> [(i, a)] -> Matrix i a Source

toAssocList :: Matrix i a -> (a, [(i, a)]) Source

(!) :: Ord ix => Matrix ix a -> ix -> a Source

! looks up an element in the sparse matrix. If the element is not found in the sparse matrix, ! returns the default value.

fill :: Size ix => Matrix ix a -> Matrix ix a Source

prune :: (Size ix, Eq a) => a -> Matrix ix a -> Matrix ix a Source

sparse :: (Size ix, Eq a) => a -> Matrix ix a -> Matrix ix a Source

Make a Matrix sparse, with a default zero value.

mm :: (Size m, Size n, Size m', Size n', n ~ m', Eq a, Num a) => Matrix (m, n) a -> Matrix (m', n') a -> Matrix (m, n') a Source

rowSets :: (Size a, Ord b) => Set (a, b) -> Matrix a (Set b) Source

columnSets :: (Size b, Ord a) => Set (a, b) -> Matrix b (Set a) Source

transpose :: (Size x, Size y, Eq a) => Matrix (x, y) a -> Matrix (y, x) a Source

zipWith :: Size x => (a -> b -> c) -> Matrix x a -> Matrix x b -> Matrix x c Source