From a37a329522a35ca17e2f1643ee1fa1a262d02a5b Mon Sep 17 00:00:00 2001 From: Adam Lugowski Date: Fri, 7 Apr 2023 15:09:08 -0700 Subject: [PATCH] Clarify types in README --- README.Armadillo.md | 6 ++++-- README.Blaze.md | 3 +++ README.CXSparse.md | 4 ++-- README.Eigen.md | 2 ++ README.md | 4 ++-- 5 files changed, 13 insertions(+), 6 deletions(-) diff --git a/README.Armadillo.md b/README.Armadillo.md index 190db9f..e66188d 100644 --- a/README.Armadillo.md +++ b/README.Armadillo.md @@ -1,4 +1,4 @@ -# Armadillo (blaze-lib) Matrix Market +# Armadillo Matrix Market `fast_matrix_market` provides read/write methods for [Armadillo](https://arma.sourceforge.net/) sparse and dense matrices. @@ -14,6 +14,8 @@ arma::Mat A; 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"); @@ -22,7 +24,7 @@ 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 loading a sparse Matrix Market file into a dense `Mat` is not supported. +On those versions reading any Matrix Market file into a dense `arma::Mat` is not supported. ### Writing diff --git a/README.Blaze.md b/README.Blaze.md index 3242380..c0aed35 100644 --- a/README.Blaze.md +++ b/README.Blaze.md @@ -17,6 +17,9 @@ blaze::CompressedVector A; // or blaze::DynamicVector A; ``` + +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`, etc. + ### Reading ```c++ std::ifstream f("input.mtx"); diff --git a/README.CXSparse.md b/README.CXSparse.md index 4242e3f..7ded496 100644 --- a/README.CXSparse.md +++ b/README.CXSparse.md @@ -15,9 +15,9 @@ cs_dl *A; std::ifstream f("input.mtx"); fast_matrix_market::read_matrix_market_cxsparse(f, &A, cs_dl_spalloc); ``` -Note the last argument. It is the `cs_spalloc` routine that matches the type +Note the last argument. It is the `cs_*_spalloc` routine that matches the type of `A`. It must be specified explicitly because it is impractical to autodetect due to the way CXSparse -implements multiple index and value types. +implements multiple index and value types. All CXSparse types are supported, such as `cs_dl`, `cs_ci`, `cs_cl`, etc. `read_matrix_market_cxsparse` creates a triplet version of the matrix structure. For CSC, follow up with CXSparse's `cs_compress()`: diff --git a/README.Eigen.md b/README.Eigen.md index 0ffa6ab..c9433ad 100644 --- a/README.Eigen.md +++ b/README.Eigen.md @@ -36,4 +36,6 @@ fast_matrix_market::write_matrix_market_eigen(f, mat); Again, for dense matrices/vectors use `write_matrix_market_eigen_dense`. +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`, etc. + 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. \ No newline at end of file diff --git a/README.md b/README.md index bf5036c..77d1ab5 100644 --- a/README.md +++ b/README.md @@ -88,7 +88,7 @@ Matrix composed of row and column index vectors and a value vector. Any vector c struct triplet_matrix { int64_t nrows = 0, ncols = 0; std::vector rows, cols; - std::vector vals; + std::vector vals; // or int64_t, float, std::complex, etc. } mat; fast_matrix_market::read_matrix_market_triplet( @@ -108,7 +108,7 @@ Be mindful of whether your code expects row or column major ordering. ```c++ struct array_matrix { int64_t nrows = 0, ncols = 0; - std::vector vals; + std::vector vals; // or int64_t, float, std::complex, etc. } mat; fast_matrix_market::read_matrix_market_array(