tatami
C++ API for different matrix representations
Loading...
Searching...
No Matches
mock_helpers.hpp
Go to the documentation of this file.
1#ifndef TATAMI_DELAYED_UNARY_ISOMETRIC_OP_HELPER_INTERFACE_H
2#define TATAMI_DELAYED_UNARY_ISOMETRIC_OP_HELPER_INTERFACE_H
3
4#include <vector>
5#include "../../base/SparseRange.hpp"
6
12namespace tatami {
13
23public:
47 template<typename Index_, typename InputValue_, typename OutputValue_>
48 void dense(
49 [[maybe_unused]] bool row,
55 const {
56 std::fill_n(output, length, 0);
57 }
58
81 template<typename Index_, typename InputValue_, typename OutputValue_>
82 void dense(
83 [[maybe_unused]] bool row,
85 const std::vector<Index_>& indices,
88 const {
89 std::fill_n(output, indices.size(), 0);
90 }
91
96 static constexpr bool is_basic = true;
97};
98
112public:
137 template<typename Index_, typename InputValue_, typename OutputValue_>
138 void dense(
139 [[maybe_unused]] bool row,
140 [[maybe_unused]] Index_ i,
142 Index_ length,
143 [[maybe_unused]] const InputValue_* input,
145 const {
146 std::fill_n(output, length, 0);
147 }
148
172 template<typename Index_, typename InputValue_, typename OutputValue_>
173 void dense(
174 [[maybe_unused]] bool row,
175 [[maybe_unused]] Index_ i,
176 const std::vector<Index_>& indices,
177 [[maybe_unused]] const InputValue_* input,
179 const {
180 std::fill_n(output, indices.size(), 0);
181 }
182
214 template<typename Index_, typename InputValue_, typename OutputValue_>
215 void sparse(
216 [[maybe_unused]] bool row,
217 [[maybe_unused]] Index_ i,
218 Index_ num,
220 [[maybe_unused]] const Index_* index,
222 const {
223 std::fill_n(output_value, num, 0);
224 }
225
241 template<typename OutputValue_, typename InputValue_, typename Index_>
243 return 0;
244 }
245
250 static constexpr bool is_basic = false;
251
262 bool zero_depends_on_row() const {
263 return false;
264 }
265
277 return false;
278 }
279
286 return false;
287 }
288
295 return false;
296 }
297
302 bool is_sparse() const {
303 return true;
304 }
305};
306
307}
308
309#endif
Advanced mock operation for DelayedUnaryIsometricOperation.
Definition mock_helpers.hpp:111
bool non_zero_depends_on_row() const
Definition mock_helpers.hpp:285
void dense(bool row, Index_ i, Index_ start, Index_ length, const InputValue_ *input, OutputValue_ *output) const
Definition mock_helpers.hpp:138
static constexpr bool is_basic
Definition mock_helpers.hpp:250
OutputValue_ fill(bool row, Index_ i) const
Definition mock_helpers.hpp:242
bool zero_depends_on_column() const
Definition mock_helpers.hpp:276
bool is_sparse() const
Definition mock_helpers.hpp:302
bool non_zero_depends_on_column() const
Definition mock_helpers.hpp:294
void dense(bool row, Index_ i, const std::vector< Index_ > &indices, const InputValue_ *input, OutputValue_ *output) const
Definition mock_helpers.hpp:173
void sparse(bool row, Index_ i, Index_ num, const InputValue_ *input_value, const Index_ *index, OutputValue_ *output_value) const
Definition mock_helpers.hpp:215
bool zero_depends_on_row() const
Definition mock_helpers.hpp:262
Basic mock operation for a DelayedUnaryIsometricOperation.
Definition mock_helpers.hpp:22
void dense(bool row, Index_ i, const std::vector< Index_ > &indices, const InputValue_ *input, OutputValue_ *output) const
Definition mock_helpers.hpp:82
void dense(bool row, Index_ i, Index_ start, Index_ length, const InputValue_ *input, OutputValue_ *output) const
Definition mock_helpers.hpp:48
static constexpr bool is_basic
Definition mock_helpers.hpp:96
Flexible representations for matrix data.
Definition Extractor.hpp:15
auto consecutive_extractor(const Matrix< Value_, Index_ > *mat, bool row, Index_ iter_start, Index_ iter_length, Args_ &&... args)
Definition consecutive_extractor.hpp:35