Pure and composable Matrix Market reader and writer.
Usage example:
rm <-readMM
`liftM` readFile "my-real-matrix.mtx" :: IO (ReadMatrix
Double) case rm of Right m -> -- Do something with the matrix m Left err -> -- Report error
- data MValue a => Matrix a = MM {
- mm'data :: MatrixData a
- mm'field :: MField
- mm'symmetry :: Symmetry
- mm'comments :: [String]
- data MValue a => MatrixData a
- class (Num a, Show a) => MValue a where
- data MField
- data Symmetry
- = General
- | Symmetric
- | SkewSymmetric
- | Hermitian
- data MValue a => CM a = CM {}
- data MValue a => AM a = AM {}
- data ReadError
- type ReadMatrix a = Either ReadError (Matrix a)
- readMM :: MValue a => String -> ReadMatrix a
- dumpMM :: MValue a => Matrix a -> String
- mm'rows :: MValue a => Matrix a -> Int
- mm'cols :: MValue a => Matrix a -> Int
- mm'shape :: MValue a => Matrix a -> (Int, Int)
- toList :: MValue a => Matrix a -> [((Int, Int), a)]
Data types
data MValue a => Matrix a Source
Matrix Market format representation.
MM | |
|
data MValue a => MatrixData a Source
Matrix' data block.
MValue a => Eq (MatrixData a) | |
MValue a => Show (MatrixData a) |
Symmetry class of the matrix.
Coordinate format (sparse matrix).
Array format (dense matrix).
Parsing errors.
type ReadMatrix a = Either ReadError (Matrix a)Source
Use this type synonym to specify the type of readMM
when calling.
Read and write Matrix Market
readMM :: MValue a => String -> ReadMatrix aSource
Parse Matrix Market format.