sized-types-0.2.7.20101112: Sized types in Haskell.

Data.Sized.Sparse.Matrix

Description

Sparse Matrix.

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

Maintainer: Andy Gill andygill@ku.edu Stability: unstable Portability: ghc

Synopsis

Documentation

data Matrix ix a Source

Constructors

Matrix a (Map ix a) 

Instances

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

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

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

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

! 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 aSource

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

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

Make a Matrix sparse, with a default zero value.

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

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) aSource

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