tatami_mult
Multiply tatami matrices
Loading...
Searching...
No Matches
dispatch.hpp
Go to the documentation of this file.
1#ifndef TATAMI_MULT_SPARSE_MATRIX_SPARSE_ROW_DISPATCH_HPP
2#define TATAMI_MULT_SPARSE_MATRIX_SPARSE_ROW_DISPATCH_HPP
3
4#include "row_to_row.hpp"
5#include "row_to_column.hpp"
6#include "column_to_row.hpp"
8
9#include "../../utils.hpp"
10
16namespace tatami_mult {
17
46
54inline void set_num_threads(MultiplySparseRowWithSparseMatrixOptions& options, int num_threads) {
55 options.column_to_column.num_threads = num_threads;
56 options.column_to_row.num_threads = num_threads;
57 options.row_to_column.num_threads = num_threads;
58 options.row_to_row.num_threads = num_threads;
59}
60
69 options.column_to_column.block_size = block_size;
70 options.column_to_row.block_size = block_size;
71}
72
101template<std::size_t accumulators_ = 4, typename LeftValue_, typename LeftIndex_, typename RightValue_, typename RightIndex_, typename Output_>
105 Output_* const output,
106 const bool output_row_major,
108) {
109 if (right.prefer_rows()) {
110 if (output_row_major) {
112 } else {
114 }
115
116 } else {
117 if (output_row_major) {
119 } else {
121 }
122 }
123}
124
125}
126
127#endif
virtual bool prefer_rows() const=0
Multiplication of tatami matrices.
Definition column_to_column.hpp:19
void multiply_sparse_row_with_sparse_column_matrix_to_column_output(const tatami::Matrix< LeftValue_, LeftIndex_ > &left, const tatami::Matrix< RightValue_, RightIndex_ > &right, Output_ *const output, const MultiplySparseRowWithSparseColumnMatrixToColumnOutputOptions &options)
Definition column_to_column.hpp:64
void multiply_sparse_row_with_sparse_row_matrix_to_column_output(const tatami::Matrix< LeftValue_, LeftIndex_ > &left, const tatami::Matrix< RightValue_, RightIndex_ > &right, Output_ *const output, const MultiplySparseRowWithSparseRowMatrixToColumnOutputOptions &options)
Definition row_to_column.hpp:55
void multiply_sparse_row_with_sparse_column_matrix_to_row_output(const tatami::Matrix< LeftValue_, LeftIndex_ > &left, const tatami::Matrix< RightValue_, RightIndex_ > &right, Output_ *const output, const MultiplySparseRowWithSparseColumnMatrixToRowOutputOptions &options)
Definition column_to_row.hpp:66
void multiply_sparse_row_with_sparse_matrix(const tatami::Matrix< LeftValue_, LeftIndex_ > &left, const tatami::Matrix< RightValue_, RightIndex_ > &right, Output_ *const output, const bool output_row_major, const MultiplySparseRowWithSparseMatrixOptions &options)
Definition dispatch.hpp:102
void set_sparse_block_size(MultiplyWithDenseMatrixOptions &options, int block_size)
Definition dispatch.hpp:87
void multiply_sparse_row_with_sparse_row_matrix_to_row_output(const tatami::Matrix< LeftValue_, LeftIndex_ > &left, const tatami::Matrix< RightValue_, RightIndex_ > &right, Output_ *const output, const MultiplySparseRowWithSparseRowMatrixToRowOutputOptions &options)
Definition row_to_row.hpp:55
void set_num_threads(MultiplyDenseColumnWithDenseMatrixOptions &options, int num_threads)
Definition dispatch.hpp:54
Sparse row-major LHS, sparse column-major RHS, column-major output.
Sparse row-major LHS, sparse column-major RHS, row-major output.
Sparse row-major LHS, sparse row-major RHS, column-major output.
Sparse row-major LHS, sparse row-major RHS, row-major output.
Options for multiply_sparse_row_with_sparse_column_matrix_to_column_output().
Definition column_to_column.hpp:28
Options for multiply_sparse_row_with_sparse_column_matrix_to_row_output().
Definition column_to_row.hpp:28
Options for multiply_sparse_row_with_sparse_matrix().
Definition dispatch.hpp:21
MultiplySparseRowWithSparseRowMatrixToColumnOutputOptions row_to_column
Definition dispatch.hpp:38
MultiplySparseRowWithSparseColumnMatrixToColumnOutputOptions column_to_column
Definition dispatch.hpp:26
MultiplySparseRowWithSparseRowMatrixToRowOutputOptions row_to_row
Definition dispatch.hpp:44
MultiplySparseRowWithSparseColumnMatrixToRowOutputOptions column_to_row
Definition dispatch.hpp:32
Options for multiply_sparse_row_with_sparse_row_matrix_to_column_output().
Definition row_to_column.hpp:27
Options for multiply_sparse_row_with_sparse_row_matrix_to_row_output().
Definition row_to_row.hpp:27