51 const RightValue_*
const right,
52 Output_*
const output,
55 const auto NR = left.
nrow();
56 const auto NC = left.
ncol();
59 std::optional<std::vector<std::optional<std::vector<Output_> > > > tmp_results;
61 tmp_results.emplace(sanisizer::cast<I<
decltype(tmp_results->size())> >(options.
num_threads - 1));
63 std::fill_n(output, NR, 0);
65 const auto num_used =
tatami::parallelize([&](
int t, LeftIndex_ start, LeftIndex_ length) ->
void {
71 std::optional<std::vector<Output_> > cur_output;
72 if (!do_parallel || t == 0) {
76 optr = cur_output->data();
79 for (LeftIndex_ c = 0; c < length; ++c) {
80 auto range = ext->fetch(vbuffer.data(), ibuffer.data());
81 const Output_ mult = right[start + c];
82 for (LeftIndex_ r = 0; r < range.number; ++r) {
83 optr[range.index[r]] += mult * range.value[r];
87 if (do_parallel && t > 0) {
88 (*tmp_results)[t - 1] = std::move(cur_output);
93 for (
int u = 1; u < num_used; ++u) {
94 const auto& tmp = *((*tmp_results)[u - 1]);
95 for (LeftIndex_ r = 0; r < NR; ++r) {
void multiply_sparse_column_with_single_vector(const tatami::Matrix< LeftValue_, LeftIndex_ > &left, const RightValue_ *const right, Output_ *const output, const MultiplySparseColumnWithSingleVectorOptions &options)
Definition sparse_column.hpp:49
auto consecutive_extractor(const Matrix< Value_, Index_ > &matrix, const bool row, const Index_ iter_start, const Index_ iter_length, Args_ &&... args)