tatami_mtx
Matrix Market to tatami matrices
|
tatami
matrices from Matrix Market files Pretty much as it says on the tin. This provides one-line wrappers around the eminem parser to enable quick creation of tatami matrices from Matrix Market files.
The load_matrix_from_file()
function will create a tatami::Matrix
from a Matrix Market file:
This will return a compressed sparse column matrix for coordinate formats and a column-major dense matrix for array formats. If opt.row = true
, row-based matrices are returned instead.
The template arguments control the interface and storage types - for example, the above call will return a tatami::Matrix<double, int>
interface The storage types are automatically chosen based on the Matrix Market field (for data) and the size of the matrix (for indices, only relevant for sparse outputs). Users can customize these by passing the desired types directly:
Check out the reference documentation for more details.
FetchContent
If you're using CMake, you just need to add something like this to your CMakeLists.txt
:
Then you can link to tatami_mtx to make the headers available during compilation:
find_package()
You can install the library by cloning a suitable version of this repository and running the following commands:
Then you can use find_package()
as usual:
If you're not using CMake, the simple approach is to just copy the files the include/
subdirectory - either directly or with Git submodules - and include their path during compilation with, e.g., GCC's -I
. You'll also need to link to the tatami and eminem libraries (and their dependencies).