sized-types-0.3.5.1: Sized types in Haskell.

Safe HaskellSafe-Inferred
LanguageHaskell98

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