Skip to content

Commit a37a329

Browse files
committed
Clarify types in README
1 parent c325509 commit a37a329

File tree

5 files changed

+13
-6
lines changed

5 files changed

+13
-6
lines changed

README.Armadillo.md

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# Armadillo (blaze-lib) Matrix Market
1+
# Armadillo Matrix Market
22

33
`fast_matrix_market` provides read/write methods for [Armadillo](https://arma.sourceforge.net/) sparse and dense matrices.
44

@@ -14,6 +14,8 @@ arma::Mat<double> A;
1414
arma::SpMat<double> A;
1515
```
1616

17+
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<double>`, etc.
18+
1719
### Reading
1820
```c++
1921
std::ifstream f("input.mtx");
@@ -22,7 +24,7 @@ fast_matrix_market::read_matrix_market_arma(f, A);
2224
```
2325
2426
**Note:** Armadillo versions older than 10.5 [did not zero-initialize memory](https://arma.sourceforge.net/docs.html#changelog).
25-
On those versions loading a sparse Matrix Market file into a dense `Mat` is not supported.
27+
On those versions reading any Matrix Market file into a dense `arma::Mat` is not supported.
2628
2729
2830
### Writing

README.Blaze.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,9 @@ blaze::CompressedVector<double> A;
1717
// or
1818
blaze::DynamicVector<double> A;
1919
```
20+
21+
Not restricted to `double` matrices. Any type supported by Blaze that makes sense in Matrix Market is also supported, such as `int64_t`, `float`, `std::complex<double>`, etc.
22+
2023
### Reading
2124
```c++
2225
std::ifstream f("input.mtx");

README.CXSparse.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,9 @@ cs_dl *A;
1515
std::ifstream f("input.mtx");
1616
fast_matrix_market::read_matrix_market_cxsparse(f, &A, cs_dl_spalloc);
1717
```
18-
Note the last argument. It is the `cs_spalloc` routine that matches the type
18+
Note the last argument. It is the `cs_*_spalloc` routine that matches the type
1919
of `A`. It must be specified explicitly because it is impractical to autodetect due to the way CXSparse
20-
implements multiple index and value types.
20+
implements multiple index and value types. All CXSparse types are supported, such as `cs_dl`, `cs_ci`, `cs_cl`, etc.
2121
2222
`read_matrix_market_cxsparse` creates a triplet version of the matrix structure. For CSC, follow up with
2323
CXSparse's `cs_compress()`:

README.Eigen.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,4 +36,6 @@ fast_matrix_market::write_matrix_market_eigen(f, mat);
3636
3737
Again, for dense matrices/vectors use `write_matrix_market_eigen_dense`.
3838
39+
Not restricted to `double` matrices. Any type supported by Eigen that makes sense in Matrix Market is also supported, such as `int64_t`, `float`, `std::complex<double>`, etc.
40+
3941
Note that Vectors are written with object type = `matrix` for compatibility reasons. Eigen's `saveMarketVector()` does the same. As of writing Eigen's loader crashes on `vector` files.

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@ Matrix composed of row and column index vectors and a value vector. Any vector c
8888
struct triplet_matrix {
8989
int64_t nrows = 0, ncols = 0;
9090
std::vector<int64_t> rows, cols;
91-
std::vector<double> vals;
91+
std::vector<double> vals; // or int64_t, float, std::complex<double>, etc.
9292
} mat;
9393

9494
fast_matrix_market::read_matrix_market_triplet(
@@ -108,7 +108,7 @@ Be mindful of whether your code expects row or column major ordering.
108108
```c++
109109
struct array_matrix {
110110
int64_t nrows = 0, ncols = 0;
111-
std::vector<double> vals;
111+
std::vector<double> vals; // or int64_t, float, std::complex<double>, etc.
112112
} mat;
113113
114114
fast_matrix_market::read_matrix_market_array(

0 commit comments

Comments
 (0)