1#ifndef TATAMI_MULT_SPARSE_MATRIX_SPARSE_ROW_ROW_TO_COLUMN_HPP
2#define TATAMI_MULT_SPARSE_MATRIX_SPARSE_ROW_ROW_TO_COLUMN_HPP
8#include "sanisizer/sanisizer.hpp"
10#include "../utils.hpp"
11#include "../../utils.hpp"
54template<
typename LeftValue_,
typename LeftIndex_,
typename RightValue_,
typename RightIndex_,
typename Output_>
58 Output_*
const output,
61 const auto left_NR = left.
nrow();
62 const auto common_dim = left.
ncol();
63 const auto right_NC = right.
ncol();
68 populate_sparse_buffers(
true, common_dim, right_NC, right, right_vbuffers, right_ibuffers, right_ranges, options.
num_threads);
78 for (LeftIndex_ lr = 0; lr < length; ++lr) {
79 const auto lrange = ext->fetch(vbuffer.data(), ibuffer.data());
81 for (LeftIndex_ x = 0; x < lrange.number; ++x) {
82 const Output_ mult = lrange.value[x];
83 const auto rrange = right_ranges[lrange.index[x]];
84 for (RightIndex_ y = 0; y < rrange.number; ++y) {
85 tmp_row[rrange.index[y]] += mult *
static_cast<Output_
>(rrange.value[y]);
95 for (RightIndex_ rc = 0; rc < right_NC; ++rc) {
96 output[sanisizer::nd_offset<std::size_t>(start + lr, left_NR, rc)] = tmp_row[rc];
98 std::fill(tmp_row.begin(), tmp_row.end(), 0);
virtual Index_ ncol() const=0
virtual Index_ nrow() const=0
Multiplication of tatami matrices.
Definition column_to_column.hpp:19
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
int parallelize(Function_ fun, const Index_ tasks, const int workers)
Container_ create_container_of_Index_size(const Index_ x, Args_ &&... args)
auto consecutive_extractor(const Matrix< Value_, Index_ > &matrix, const bool row, const Index_ iter_start, const Index_ iter_length, Args_ &&... args)
Options for multiply_sparse_row_with_sparse_row_matrix_to_column_output().
Definition row_to_column.hpp:27
int num_threads
Definition row_to_column.hpp:32