tatami_mult
Multiply tatami matrices
|
This library contains functions for multiplying a tatami matrix with a vector or matrix. It provides specialized code paths depending on the properties of the tatami::Matrix
- namely, sparsity or row-based iteration. Parallelization is achieved via the usual tatami::parallelize()
function.
Matrix-vector multiplication is pretty straightforward:
If multiple vectors are present, we can handle it in a single pass through our matrix:
With two tatami::Matrix
objects, multiply()
will prefer a single pass through the larger matrix, and will save the product as a column-major array. Both of these behaviors can be modified by changing the settings in Options
.
Check out the reference documentation for more details.
If you're using CMake, you just need to add something like this to your CMakeLists.txt
:
Then you can link to tatami_mult to make the headers available during compilation:
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:
By default, this will use FetchContent
to fetch all external dependencies. If you want to install them manually, use -DTATAMI_MULT_FETCH_EXTERN=OFF
. See extern/CMakeLists.txt
to find compatible versions of each dependency.
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 need to include the transitive dependencies yourself, check out extern/CMakeLists.txt
for a list.