Data.Sized.Sparse.Matrix

Description

Sparse Matrix.

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) Source # Methodsfmap :: (a -> b) -> Matrix ix a -> Matrix ix b #(<\$) :: a -> Matrix ix b -> Matrix ix a # Size i => Applicative (Matrix i) Source # Methodspure :: a -> Matrix i a #(<*>) :: Matrix i (a -> b) -> Matrix i a -> Matrix i b #liftA2 :: (a -> b -> c) -> Matrix i a -> Matrix i b -> Matrix i c #(*>) :: Matrix i a -> Matrix i b -> Matrix i b #(<*) :: Matrix i a -> Matrix i b -> Matrix i a # (Show a, Size ix) => Show (Matrix ix a) Source # MethodsshowsPrec :: Int -> Matrix ix a -> ShowS #show :: Matrix ix a -> String #showList :: [Matrix ix a] -> ShowS #

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 #