tatami_mult
Multiply tatami matrices
Loading...
Searching...
No Matches
dispatch.hpp
Go to the documentation of this file.
1#ifndef TATAMI_MULT_DENSE_MATRIX_SPARSE_COLUMN_DISPATCH_HPP
2#define TATAMI_MULT_DENSE_MATRIX_SPARSE_COLUMN_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(MultiplySparseColumnWithDenseMatrixOptions& 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.row_to_column.block_size = block_size;
71}
72
100template<typename LeftValue_, typename LeftIndex_, typename RightValue_, typename RightIndex_, typename Output_>
104 Output_* const output,
105 const bool output_row_major,
107) {
108 if (right.prefer_rows()) {
109 if (output_row_major) {
111 } else {
113 }
114
115 } else {
116 if (output_row_major) {
118 } else {
120 }
121 }
122}
123
124}
125
126#endif
virtual bool prefer_rows() const=0
Sparse column-major LHS, dense column-major matrix RHS, column-major output.
Sparse column-major LHS, dense column-major matrix RHS, row-major output.
Sparse column-major LHS, dense column-major matrix RHS, column-major output.
Sparse column-major LHS, dense row-major matrix RHS, row-major output.
Multiplication of tatami matrices.
Definition column_to_column.hpp:19
void multiply_sparse_column_with_dense_row_matrix_to_row_output(const tatami::Matrix< LeftValue_, LeftIndex_ > &left, const RightColumns_ right_columns, GetRightRow_ get_right_row, Output_ *const output, const MultiplySparseColumnWithDenseRowMatrixToRowOutputOptions &options)
Definition row_to_row.hpp:52
void multiply_sparse_column_with_dense_row_matrix_to_column_output(const tatami::Matrix< LeftValue_, LeftIndex_ > &left, const RightColumns_ right_columns, GetRightRow_ get_right_row, Output_ *const output, const MultiplySparseColumnWithDenseRowMatrixToColumnOutputOptions &options)
Definition row_to_column.hpp:59
void multiply_sparse_column_with_dense_column_matrix_to_row_output(const tatami::Matrix< LeftValue_, LeftIndex_ > &left, const RightColumns_ right_columns, GetRightColumn_ get_right_column, Output_ *const output, const MultiplySparseColumnWithDenseColumnMatrixToRowOutputOptions &options)
Definition column_to_row.hpp:54
void multiply_sparse_column_with_dense_column_matrix_to_column_output(const tatami::Matrix< LeftValue_, LeftIndex_ > &left, const RightColumns_ right_columns, GetRightColumn_ get_right_column, Output_ *const output, const MultiplySparseColumnWithDenseColumnMatrixToColumnOutputOptions &options)
Definition column_to_column.hpp:63
void multiply_sparse_column_with_dense_matrix(const tatami::Matrix< LeftValue_, LeftIndex_ > &left, const tatami::Matrix< RightValue_, RightIndex_ > &right, Output_ *const output, const bool output_row_major, const MultiplySparseColumnWithDenseMatrixOptions &options)
Definition dispatch.hpp:101
void set_sparse_block_size(MultiplyWithDenseMatrixOptions &options, int block_size)
Definition dispatch.hpp:87
void set_num_threads(MultiplyDenseColumnWithDenseMatrixOptions &options, int num_threads)
Definition dispatch.hpp:54
Options for multiply_sparse_column_with_dense_column_matrix_to_column_output().
Definition column_to_column.hpp:28
Options for multiply_sparse_column_with_dense_column_matrix_to_row_output().
Definition column_to_row.hpp:28
Options for multiply_sparse_column_with_dense_matrix().
Definition dispatch.hpp:21
MultiplySparseColumnWithDenseRowMatrixToColumnOutputOptions row_to_column
Definition dispatch.hpp:38
MultiplySparseColumnWithDenseRowMatrixToRowOutputOptions row_to_row
Definition dispatch.hpp:44
MultiplySparseColumnWithDenseColumnMatrixToRowOutputOptions column_to_row
Definition dispatch.hpp:32
MultiplySparseColumnWithDenseColumnMatrixToColumnOutputOptions column_to_column
Definition dispatch.hpp:26
Options for multiply_sparse_column_with_dense_row_matrix_to_column_output().
Definition row_to_column.hpp:27
Options for multiply_sparse_column_with_dense_row_matrix_to_row_output().
Definition row_to_row.hpp:27