https://github.com/alugowski/fast_matrix_market
Fast and full-featured Matrix Market I/O library for C++, Python, and R
https://github.com/alugowski/fast_matrix_market
blaze cpp csparse eigen-library eigen3 graphblas matrix-market matrix-market-format parallel parser python r sparse-matrix threaded
Last synced: about 1 month ago
JSON representation
Fast and full-featured Matrix Market I/O library for C++, Python, and R
- Host: GitHub
- URL: https://github.com/alugowski/fast_matrix_market
- Owner: alugowski
- License: bsd-2-clause
- Created: 2023-01-10T06:38:53.000Z (almost 3 years ago)
- Default Branch: main
- Last Pushed: 2024-08-05T11:23:50.000Z (over 1 year ago)
- Last Synced: 2025-09-05T08:54:09.179Z (2 months ago)
- Topics: blaze, cpp, csparse, eigen-library, eigen3, graphblas, matrix-market, matrix-market-format, parallel, parser, python, r, sparse-matrix, threaded
- Language: C++
- Homepage:
- Size: 863 KB
- Stars: 82
- Watchers: 5
- Forks: 9
- Open Issues: 8
-
Metadata Files:
- Readme: README.Armadillo.md
- License: LICENSE.txt
- Citation: CITATION.cff
Awesome Lists containing this project
README
# Armadillo Matrix Market
`fast_matrix_market` provides read/write methods for [Armadillo](https://arma.sourceforge.net/) sparse and dense matrices.
# Usage
```c++
#include
```
```c++
arma::Mat A;
// or
arma::SpMat A;
```
Not restricted to `double` matrices. Any type supported by Armadillo that makes sense in Matrix Market is also supported, such as `int64_t`, `float`, `std::complex`, etc.
### Reading
```c++
std::ifstream f("input.mtx");
fast_matrix_market::read_matrix_market_arma(f, A);
```
**Note:** Armadillo versions older than 10.5 [did not zero-initialize memory](https://arma.sourceforge.net/docs.html#changelog).
On those versions reading any Matrix Market file into a dense `arma::Mat` is not supported.
### Writing
```c++
std::ofstream f("output.mtx", std::ios_base::binary);
fast_matrix_market::write_matrix_market_arma(f, A);
```