Matrix Market files are crucial to much of the data-science ecosystem. The
fastMatMR package focuses on high-performance read and write operations for Matrix Market files, serving as a key tool for data extraction in computational and data science pipelines.
The target audience and scientific applications primarily include data scientists or researchers developing numerical methods who may wish to either test standard NIST (National Institute of Standards and Technology) which include:
comparative studies of algorithms for numerical linear algebra, featuring nearly 500 sparse matrices from a variety of applications, as well as matrix generation tools and services.
Additionally, being able to use the matrix market file format, means it is easier to interface
R analysis with those in
SciPy uses the same underlying
C++ library). These files can also be used with the Tensor Algebra Compiler (TACO).
fastMatMRsupports standard R vectors, matrices, as well as
Performance: The package is a thin wrapper around one of the fastest C++ libraries for reading and writing
Matrix, roundtripping with
NaNvalues works by coercing to
NaNinstead of to arbitrarily high numbers.
Matrixpackage allows reading and writing sparse matrices in the
.mtx(matrix market) format.
- However, for
.mtxfiles, it can only handles sparse matrices for writing and reading.
- Round-tripping (writing and subsequently reading) data with
NaNvalues produces arbitrarily high numbers instead of preserving
- However, for
For the latest
For the latest development version of
install.packages("fastMatMR", repos = "https://ropensci.r-universe.dev")
.mtx file is language agnostic, and can even be read back in
python as an example:
pip install fast_matrix_market python -c 'import fast_matrix_market as fmm; print(fmm.read_array_or_coo("sparse.mtx"))' ((array([1., 3., 2.]), (array([0, 0, 1], dtype=int32), array([0, 1, 1], dtype=int32))), (2, 2)) python -c 'import fast_matrix_market as fmm; print(fmm.read_array("sparse.mtx"))' array([[1., 3.], [0., 2.]])
fastMatMR supports writing and reading from other
R objects (e.g. standard R vectors and matrices), as seen in the getting started vignette.
This project is licensed under the MIT License.