53 const RightValue_*
const right,
54 Output_*
const output,
57 const auto NR = left.
nrow();
58 const auto NC = left.
ncol();
60 std::optional<std::vector<std::optional<std::vector<Output_> > > > tmp_results;
63 tmp_results.emplace(sanisizer::cast<I<
decltype(tmp_results->size())> >(options.
num_threads - 1));
65 std::fill_n(output, NR, 0);
67 const auto num_used =
tatami::parallelize([&](
int t, LeftIndex_ start, LeftIndex_ length) ->
void {
72 std::optional<std::vector<Output_> > cur_output;
73 if (!do_parallel || t == 0) {
77 optr = cur_output->data();
80 for (LeftIndex_ c = 0; c < length; ++c) {
81 auto ptr = ext->fetch(buffer.data());
82 const Output_ mult = right[start + c];
83 for (LeftIndex_ r = 0; r < NR; ++r) {
84 optr[r] += mult * ptr[r];
88 if (do_parallel && t > 0) {
89 (*tmp_results)[t - 1] = std::move(cur_output);
94 for (
int u = 1; u < num_used; ++u) {
95 const auto& tmp = *((*tmp_results)[u - 1]);
96 for (LeftIndex_ r = 0; r < NR; ++r) {
void multiply_dense_column_with_single_vector(const tatami::Matrix< LeftValue_, LeftIndex_ > &left, const RightValue_ *const right, Output_ *const output, const MultiplyDenseColumnWithSingleVectorOptions &options)
Definition dense_column.hpp:51
auto consecutive_extractor(const Matrix< Value_, Index_ > &matrix, const bool row, const Index_ iter_start, const Index_ iter_length, Args_ &&... args)