67 Output_*
const output,
70 const auto left_NR = left.
nrow();
71 const auto common_dim = left.
ncol();
72 const auto right_NC = right.
ncol();
77 populate_sparse_buffers(
false, right_NC, common_dim, right, right_vbuffers, right_ibuffers, right_ranges, options.
num_threads);
80 auto right_non_empty = filter_non_empty_sparse(
82 [&](
const RightIndex_ rc) ->
void {
83 std::fill_n(output + sanisizer::product_unsafe<std::size_t>(left_NR, rc), left_NR, 0);
92 for (LeftIndex_ lr = 0; lr < length; ++lr) {
93 const auto lptr = ext->fetch(dbuffer.data());
95 auto loop_body = [&](RightIndex_ rc) ->
void {
96 const auto rrange = right_ranges[rc];
97 output[sanisizer::nd_offset<std::size_t>(start + lr, left_NR, rc)] = sparse_dot_product<accumulators_>(
102 static_cast<Output_
>(0)
106 if (right_non_empty.has_value()) {
107 for (
const auto rc : *right_non_empty) {
111 for (RightIndex_ rc = 0; rc < right_NC; ++rc) {
123 const LeftIndex_ max_block_rows = sanisizer::min(length, options.
block_size);
124 std::vector<std::vector<LeftValue_> > lbuffers;
125 lbuffers.reserve(max_block_rows);
126 for (LeftIndex_ b = 0; b < max_block_rows; ++b) {
132 while (lr < length) {
133 const LeftIndex_ lr_num = sanisizer::min(options.
block_size, length - lr);
134 for (LeftIndex_ lr_counter = 0; lr_counter < lr_num; ++lr_counter) {
135 lptrs[lr_counter] = ext->fetch(lbuffers[lr_counter].data());
141 auto loop_body = [&](RightIndex_ rc) ->
void {
142 const auto rrange = right_ranges[rc];
143 for (LeftIndex_ lr_counter = 0; lr_counter < lr_num; ++lr_counter) {
144 output[sanisizer::nd_offset<std::size_t>(start + lr + lr_counter, left_NR, rc)] = sparse_dot_product<accumulators_>(
149 static_cast<Output_
>(0)
154 if (right_non_empty.has_value()) {
155 for (
const auto rc : *right_non_empty) {
159 for (RightIndex_ rc = 0; rc < right_NC; ++rc) {
void multiply_dense_row_with_sparse_column_matrix_to_column_output(const tatami::Matrix< LeftValue_, LeftIndex_ > &left, const tatami::Matrix< RightValue_, RightIndex_ > &right, Output_ *const output, const MultiplyDenseRowWithSparseColumnMatrixToColumnOutputOptions &options)
Definition column_to_column.hpp:64
auto consecutive_extractor(const Matrix< Value_, Index_ > &matrix, const bool row, const Index_ iter_start, const Index_ iter_length, Args_ &&... args)