matrix-market-attoparsec: Parsing and serialization functions for the NIST Matrix Market format

[ bsd2, library, parsers ] [ Propose Tags ] [ Report a vulnerability ]

Parsing and serialization functions for the NIST Matrix Market format.


[Skip to Readme]

Downloads

Note: This package has metadata revisions in the cabal description newer than included in the tarball. To unpack the package including the revisions, use 'cabal get'.

Maintainer's Corner

Package maintainers

For package maintainers and hackage trustees

Candidates

  • No Candidates
Versions [RSS] 0.1.0.0, 0.1.0.1, 0.1.0.2, 0.1.0.3, 0.1.0.4, 0.1.0.5, 0.1.0.6, 0.1.0.7, 0.1.0.8, 0.1.0.9, 0.1.1.0, 0.1.1.1, 0.1.1.2, 0.1.1.3
Change log CHANGELOG.markdown
Dependencies attoparsec (>=0.10), base (>=4.7 && <5), bytestring (>=0.9), exceptions, scientific (>=0.3.3.8) [details]
Tested with ghc ==8.0.1, ghc ==8.6.5
License BSD-2-Clause
Copyright (c) 2017-2020 Marco Zocca
Author Marco Zocca
Maintainer zocca marco gmail
Revised Revision 1 made by ocramz at 2020-01-18T18:27:38Z
Category Parsers
Home page https://github.com/ocramz/matrix-market-attoparsec
Source repo head: git clone https://github.com/ocramz/matrix-market-attoparsec
Uploaded by ocramz at 2020-01-18T18:26:28Z
Distributions LTSHaskell:0.1.1.3, NixOS:0.1.1.3, Stackage:0.1.1.3
Reverse Dependencies 3 direct, 0 indirect [details]
Downloads 7421 total (11 in the last 30 days)
Rating 2.0 (votes: 1) [estimated by Bayesian average]
Your Rating
  • λ
  • λ
  • λ
Status Docs available [build log]
Last success reported on 2020-01-18 [all 1 reports]

Readme for matrix-market-attoparsec-0.1.1.1

[back to package description]

matrix-market-attoparsec

Build Status

Attoparsec parser for the NIST Matrix Market format [0].

The library also contains functions for serializing matrix data to text file.

User guide

The module Data.Matrix.MatrixMarket exports the user interface:

readMatrix :: FilePath -> IO (Matrix S.Scientific)

readArray :: FilePath -> IO (Array S.Scientific)

writeMatrix :: Show a => FilePath -> Matrix a -> IO ()

writeArray :: Show a => FilePath -> Array a -> IO ()  

The first two functions contain the parsing logic, and make use of scientific for parsing numerical data in scientific notation.

Naming convention

We follow the MatrixMarket format definitions, by which a "Matrix" is sparse and stored in coordinate format (row, column, entry), whereas an "Array" is a dense grid of numbers, stored in column-oriented form. Algebraic vectors, such as the right-hand sides of equation systems, are stored as n-by-1 Arrays.

Testing

test/LibSpec.hs contains a simple read/write/read sanity test for the included Matrix Marked data files (fidapm05.mtx and fidapm05_rhs1.mtx):

m0 <- readMatrix fname   -- load original
writeMatrix ftemp m0     -- save as temp
m1 <- readMatrix ftemp   -- load temp
m0 `shouldBe` m1         -- compare temp with original

References

[0] [http://math.nist.gov/MatrixMarket/](http://math.nist.gov/MatrixMarket/)