Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

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: 5 days ago
JSON representation

Fast and full-featured Matrix Market I/O library for C++, Python, and R

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);
```