Safe Haskell | None |
---|---|
Language | Haskell98 |
Sparse Matrix.
Copyright: (c) 2009 University of Kansas License: BSD3
Maintainer: Andy Gill andygill@ku.edu Stability: unstable Portability: ghc
- data SpMatrix ix a = SpMatrix a (Map ix a)
- fromAssocList :: (Ord i, Eq a) => a -> [(i, a)] -> SpMatrix i a
- toAssocList :: SpMatrix i a -> (a, [(i, a)])
- getElem :: Ord ix => SpMatrix ix a -> ix -> a
- fill :: (Bounded ix, Ix ix) => SpMatrix ix a -> Matrix ix a
- prune :: (Bounded ix, Ix ix, Eq a) => a -> SpMatrix ix a -> SpMatrix ix a
- sparse :: (Bounded ix, Ix ix, Eq a) => a -> Matrix ix a -> SpMatrix ix a
- mm :: (Bounded m, Ix m, Bounded n, Ix n, Bounded m', Ix m', Bounded n', Ix n', n ~ m', Num a, Eq a) => SpMatrix (m, n) a -> SpMatrix (m', n') a -> SpMatrix (m, n') a
- rowSets :: (Bounded a, Ix a, Ord b) => Set (a, b) -> Matrix a (Set b)
- columnSets :: (Bounded b, Ix b, Ord a) => Set (a, b) -> Matrix b (Set a)
- transpose :: (Bounded x, Ix x, Bounded y, Ix y, Eq a) => SpMatrix (x, y) a -> SpMatrix (y, x) a
- zipWith :: (Bounded x, Ix x) => (a -> b -> c) -> SpMatrix x a -> SpMatrix x b -> SpMatrix x c
Documentation
fromAssocList :: (Ord i, Eq a) => a -> [(i, a)] -> SpMatrix i a Source
toAssocList :: SpMatrix i a -> (a, [(i, a)]) Source
sparse :: (Bounded ix, Ix ix, Eq a) => a -> Matrix ix a -> SpMatrix ix a Source
Make a Matrix sparse, with a default zero
value.
mm :: (Bounded m, Ix m, Bounded n, Ix n, Bounded m', Ix m', Bounded n', Ix n', n ~ m', Num a, Eq a) => SpMatrix (m, n) a -> SpMatrix (m', n') a -> SpMatrix (m, n') a Source