tatami
C++ API for different matrix representations
Loading...
Searching...
No Matches
mock_helpers.hpp
Go to the documentation of this file.
1#ifndef TATAMI_ISOMETRIC_BINARY_MOCK_HELPERS_H
2#define TATAMI_ISOMETRIC_BINARY_MOCK_HELPERS_H
3
4#include <vector>
5#include "../../base/SparseRange.hpp"
6
12namespace tatami {
13
23public:
51 template<typename Index_, typename InputValue_, typename OutputValue_>
52 void dense(
53 [[maybe_unused]] bool row,
60 const {
61 // Just filling it with something as a mock.
62 std::fill_n(output_buffer, length, 0);
63 }
64
91 template<typename Index_, typename InputValue_, typename OutputValue_>
92 void dense(
93 [[maybe_unused]] bool row,
95 const std::vector<Index_>& indices,
99 const {
100 std::fill_n(output_buffer, indices.size(), 0);
101 }
102
107 static constexpr bool is_basic = true;
108};
109
123public:
141 template<typename OutputValue_, typename InputValue_, typename Index_>
143 return 0;
144 }
145
150 static constexpr bool is_basic = false;
151
162 bool zero_depends_on_row() const {
163 return false;
164 }
165
177 return false;
178 }
179
187 return false;
188 }
189
197 return false;
198 }
199
228 template<typename Index_, typename InputValue_, typename OutputValue_>
229 void dense(
230 [[maybe_unused]] bool row,
231 [[maybe_unused]] Index_ i,
233 Index_ length,
237 const {
238 // Just filling it with something as a mock.
239 std::fill_n(output_buffer, length, 0);
240 }
241
269 template<typename Index_, typename InputValue_, typename OutputValue_>
270 void dense(
271 [[maybe_unused]] bool row,
272 [[maybe_unused]] Index_ i,
273 const std::vector<Index_>& indices,
277 const {
278 std::fill_n(output_buffer, indices.size(), 0);
279 }
280
329 template<typename Index_, typename InputValue_, typename OutputValue_>
342
346 bool is_sparse() const {
347 return true;
348 }
349};
350
351}
352
353#endif
Advanced mock operation for DelayedBinaryIsometricOperation.
Definition mock_helpers.hpp:122
void dense(bool row, Index_ i, Index_ start, Index_ length, const InputValue_ *left_buffer, const InputValue_ *right_buffer, OutputValue_ *output_buffer) const
Definition mock_helpers.hpp:229
static constexpr bool is_basic
Definition mock_helpers.hpp:150
void dense(bool row, Index_ i, const std::vector< Index_ > &indices, const InputValue_ *left_buffer, const InputValue_ *right_buffer, OutputValue_ *output_buffer) const
Definition mock_helpers.hpp:270
bool non_zero_depends_on_column() const
Definition mock_helpers.hpp:196
OutputValue_ fill(bool row, Index_ i) const
Definition mock_helpers.hpp:142
bool non_zero_depends_on_row() const
Definition mock_helpers.hpp:186
bool zero_depends_on_column() const
Definition mock_helpers.hpp:176
bool is_sparse() const
Definition mock_helpers.hpp:346
Index_ sparse(bool row, Index_ i, const SparseRange< InputValue_, Index_ > &left, const SparseRange< InputValue_, Index_ > &right, OutputValue_ *output_value, Index_ *output_index, bool report_value, bool report_index) const
Definition mock_helpers.hpp:330
bool zero_depends_on_row() const
Definition mock_helpers.hpp:162
Basic mock operation for DelayedBinaryIsometricOperation.
Definition mock_helpers.hpp:22
void dense(bool row, Index_ i, const std::vector< Index_ > &indices, const InputValue_ *left_buffer, const InputValue_ *right_buffer, OutputValue_ *output_buffer) const
Definition mock_helpers.hpp:92
static constexpr bool is_basic
Definition mock_helpers.hpp:107
void dense(bool row, Index_ i, Index_ start, Index_ length, const InputValue_ *left_buffer, const InputValue_ *right_buffer, OutputValue_ *output_buffer) const
Definition mock_helpers.hpp:52
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
A range of a sparse vector.
Definition SparseRange.hpp:32