6#include "dense_row.hpp"
7#include "sparse_row.hpp"
8#include "dense_column.hpp"
9#include "sparse_column.hpp"
63template<
typename Value_,
typename Index_,
typename Right_,
typename Output_>
67 internal::sparse_row_vector(left, right, output, opt.
num_threads);
69 internal::sparse_column_vector(left, right, output, opt.
num_threads);
73 internal::dense_row_vector(left, right, output, opt.
num_threads);
75 internal::dense_column_vector(left, right, output, opt.
num_threads);
95template<
typename Left_,
typename Value_,
typename Index_,
typename Output_>
98 if (tright->sparse()) {
99 if (tright->prefer_rows()) {
100 internal::sparse_row_vector(*tright, left, output, opt.
num_threads);
102 internal::sparse_column_vector(*tright, left, output, opt.
num_threads);
105 if (tright->prefer_rows()) {
106 internal::dense_row_vector(*tright, left, output, opt.
num_threads);
108 internal::dense_column_vector(*tright, left, output, opt.
num_threads);
128template<
typename Value_,
typename Index_,
typename Right_,
typename Output_>
132 internal::sparse_row_vectors(left, right, output, opt.
num_threads);
134 internal::sparse_column_vectors(left, right, output, opt.
num_threads);
138 internal::dense_row_vectors(left, right, output, opt.
num_threads);
140 internal::dense_column_vectors(left, right, output, opt.
num_threads);
160template<
typename Left_,
typename Value_,
typename Index_,
typename Output_>
163 if (tright->sparse()) {
164 if (tright->prefer_rows()) {
165 internal::sparse_row_vectors(*tright, left, output, opt.
num_threads);
167 internal::sparse_column_vectors(*tright, left, output, opt.
num_threads);
170 if (tright->prefer_rows()) {
171 internal::dense_row_vectors(*tright, left, output, opt.
num_threads);
173 internal::dense_column_vectors(*tright, left, output, opt.
num_threads);
183template<
typename LeftValue_,
typename LeftIndex_,
typename RightValue_,
typename RightIndex_,
typename Output_>
185 size_t row_shift, col_shift;
186 if (column_major_out) {
188 col_shift = left.
nrow();
190 row_shift = right.
ncol();
197 internal::sparse_row_tatami_sparse(left, right, output, row_shift, col_shift, num_threads);
199 internal::sparse_row_tatami_dense(left, right, output, row_shift, col_shift, num_threads);
203 internal::sparse_column_tatami_sparse(left, right, output, row_shift, col_shift, num_threads);
205 internal::sparse_column_tatami_dense(left, right, output, row_shift, col_shift, num_threads);
211 internal::dense_row_tatami_sparse(left, right, output, row_shift, col_shift, num_threads);
213 internal::dense_row_tatami_dense(left, right, output, row_shift, col_shift, num_threads);
217 internal::dense_column_tatami_sparse(left, right, output, row_shift, col_shift, num_threads);
219 internal::dense_column_tatami_dense(left, right, output, row_shift, col_shift, num_threads);
246template<
typename LeftValue_,
typename LeftIndex_,
typename RightValue_,
typename RightIndex_,
typename Output_>
virtual Index_ ncol() const=0
virtual Index_ nrow() const=0
virtual bool prefer_rows() const=0
virtual std::unique_ptr< MyopicSparseExtractor< Value_, Index_ > > sparse(bool row, const Options &opt) const=0
Multiplication of tatami matrices.
void multiply(const tatami::Matrix< Value_, Index_ > &left, const Right_ *right, Output_ *output, const Options &opt)
Definition tatami_mult.hpp:64
std::shared_ptr< const Matrix< Value_, Index_ > > wrap_shared_ptr(const Matrix< Value_, Index_ > *ptr)
std::shared_ptr< Matrix< Value_, Index_ > > make_DelayedTranspose(std::shared_ptr< const Matrix< Value_, Index_ > > matrix)
Options for multiply().
Definition tatami_mult.hpp:25
bool prefer_larger
Definition tatami_mult.hpp:38
int num_threads
Definition tatami_mult.hpp:29
bool column_major_output
Definition tatami_mult.hpp:45