tatami
C++ API for different matrix representations
All Classes Namespaces Files Functions Variables Typedefs Enumerations Friends Pages
substitute_helpers.hpp
Go to the documentation of this file.
1#ifndef TATAMI_ISOMETRIC_UNARY_SUBSTITUTE_HELPERS_H
2#define TATAMI_ISOMETRIC_UNARY_SUBSTITUTE_HELPERS_H
3
6#include <vector>
7#include <limits>
8
15namespace tatami {
16
20template<CompareOperation op_, typename InputValue_, typename Scalar_, typename OutputValue_>
21bool delayed_substitute_is_sparse(Scalar_ compared, OutputValue_ substitute) {
22 return !delayed_compare<op_, InputValue_>(0, compared) || substitute == 0;
23}
24
25template<CompareOperation op_, typename InputValue_, typename Scalar_, typename OutputValue_>
26OutputValue_ delayed_substitute_run(InputValue_ val, Scalar_ compared, OutputValue_ substitute) {
27 if (delayed_compare<op_>(val, compared)) {
28 return substitute;
29 } else {
30 return val;
31 }
32}
33
34template<CompareOperation op_, typename InputValue_, typename Index_, typename Scalar_, typename OutputValue_>
35void delayed_substitute_run_simple(const InputValue_* input, Index_ length, Scalar_ compared, OutputValue_* output, OutputValue_ substitute) {
36 if constexpr(std::is_same<InputValue_, OutputValue_>::value) {
37 input = output; // basically an assertion to the compiler to skip aliasing protection.
38 }
39 for (Index_ i = 0; i < length; ++i) {
40 output[i] = delayed_substitute_run<op_>(input[i], compared, substitute);
41 }
42}
59template<CompareOperation op_, typename OutputValue_, typename InputValue_, typename Index_, typename Scalar_>
60class DelayedUnaryIsometricSubstituteScalarHelper final : public DelayedUnaryIsometricOperationHelper<OutputValue_, InputValue_, Index_> {
61public:
67 DelayedUnaryIsometricSubstituteScalarHelper(Scalar_ compared, OutputValue_ substitute) : my_compared(compared), my_substitute(substitute) {
68 my_sparse = delayed_substitute_is_sparse<op_, InputValue_>(my_compared, my_substitute);
69 }
70
71private:
72 Scalar_ my_compared;
73 OutputValue_ my_substitute;
74 bool my_sparse;
75
76public:
77 std::optional<Index_> nrow() const {
78 return std::nullopt;
79 }
80
81 std::optional<Index_> ncol() const {
82 return std::nullopt;
83 }
84
85public:
86 bool zero_depends_on_row() const {
87 return false;
88 }
89
91 return false;
92 }
93
95 return false;
96 }
97
99 return false;
100 }
101
102public:
103 void dense(bool, Index_, Index_, Index_ length, const InputValue_* input, OutputValue_* output) const {
104 delayed_substitute_run_simple<op_>(input, length, my_compared, output, my_substitute);
105 }
106
107 void dense(bool, Index_, const std::vector<Index_>& indices, const InputValue_* input, OutputValue_* output) const {
108 delayed_substitute_run_simple<op_>(input, static_cast<Index_>(indices.size()), my_compared, output, my_substitute);
109 }
110
111public:
112 bool is_sparse() const {
113 return my_sparse;
114 }
115
116 void sparse(bool, Index_, Index_ number, const InputValue_* input_value, const Index_*, OutputValue_* output_value) const {
117 delayed_substitute_run_simple<op_>(input_value, number, my_compared, output_value, my_substitute);
118 }
119
120 OutputValue_ fill(bool, Index_) const {
121 if (my_sparse) {
122 return 0;
123 } else {
124 return my_substitute;
125 }
126 }
127};
128
137template<typename OutputValue_, typename InputValue_, typename Index_, typename Scalar_>
139
148template<typename OutputValue_, typename InputValue_, typename Index_, typename Scalar_>
150
159template<typename OutputValue_, typename InputValue_, typename Index_, typename Scalar_>
161
170template<typename OutputValue_, typename InputValue_, typename Index_, typename Scalar_>
172
181template<typename OutputValue_, typename InputValue_, typename Index_, typename Scalar_>
183
192template<typename OutputValue_, typename InputValue_, typename Index_, typename Scalar_>
194
203template<typename OutputValue_, typename InputValue_, typename Index_, typename Scalar_>
205
209// Back-compatibility only.
210template<typename OutputValue_ = double, typename InputValue_ = double, typename Index_ = int, typename Scalar_>
211std::shared_ptr<DelayedUnaryIsometricOperationHelper<OutputValue_, InputValue_, Index_> > make_DelayedUnaryIsometricSubstituteEqualScalar(Scalar_ compared, OutputValue_ substitute) {
212 return std::make_shared<DelayedUnaryIsometricSubstituteEqualScalarHelper<OutputValue_, InputValue_, Index_, Scalar_> >(compared, substitute);
213}
214
215template<typename OutputValue_ = double, typename InputValue_ = double, typename Index_ = int, typename Scalar_>
216std::shared_ptr<DelayedUnaryIsometricOperationHelper<OutputValue_, InputValue_, Index_> > make_DelayedUnaryIsometricSubstituteGreaterThanScalar(Scalar_ compared, OutputValue_ substitute) {
217 return std::make_shared<DelayedUnaryIsometricSubstituteGreaterThanScalarHelper<OutputValue_, InputValue_, Index_, Scalar_> >(compared, substitute);
218}
219
220template<typename OutputValue_ = double, typename InputValue_ = double, typename Index_ = int, typename Scalar_>
221std::shared_ptr<DelayedUnaryIsometricOperationHelper<OutputValue_, InputValue_, Index_> > make_DelayedUnaryIsometricSubstituteLessThanScalar(Scalar_ compared, OutputValue_ substitute) {
222 return std::make_shared<DelayedUnaryIsometricSubstituteLessThanScalarHelper<OutputValue_, InputValue_, Index_, Scalar_> >(compared, substitute);
223}
224
225template<typename OutputValue_ = double, typename InputValue_ = double, typename Index_ = int, typename Scalar_>
226std::shared_ptr<DelayedUnaryIsometricOperationHelper<OutputValue_, InputValue_, Index_> > make_DelayedUnaryIsometricSubstituteGreaterThanOrEqualScalar(Scalar_ compared, OutputValue_ substitute) {
227 return std::make_shared<DelayedUnaryIsometricSubstituteGreaterThanOrEqualScalarHelper<OutputValue_, InputValue_, Index_, Scalar_> >(compared, substitute);
228}
229
230template<typename OutputValue_ = double, typename InputValue_ = double, typename Index_ = int, typename Scalar_>
231std::shared_ptr<DelayedUnaryIsometricOperationHelper<OutputValue_, InputValue_, Index_> > make_DelayedUnaryIsometricSubstituteLessThanOrEqualScalar(Scalar_ compared, OutputValue_ substitute) {
232 return std::make_shared<DelayedUnaryIsometricSubstituteLessThanOrEqualScalarHelper<OutputValue_, InputValue_, Index_, Scalar_> >(compared, substitute);
233}
234
235template<typename OutputValue_ = double, typename InputValue_ = double, typename Index_ = int, typename Scalar_>
236std::shared_ptr<DelayedUnaryIsometricOperationHelper<OutputValue_, InputValue_, Index_> > make_DelayedUnaryIsometricSubstituteNotEqualScalar(Scalar_ compared, OutputValue_ substitute) {
237 return std::make_shared<DelayedUnaryIsometricSubstituteNotEqualScalarHelper<OutputValue_, InputValue_, Index_, Scalar_> >(compared, substitute);
238}
259template<CompareOperation op_, typename OutputValue_, typename InputValue_, typename Index_, typename ComparedVector_, typename SubstituteVector_>
260class DelayedUnaryIsometricSubstituteVectorHelper final : public DelayedUnaryIsometricOperationHelper<OutputValue_, InputValue_, Index_> {
261public:
272 DelayedUnaryIsometricSubstituteVectorHelper(ComparedVector_ compared, SubstituteVector_ substitute, bool by_row) :
273 my_compared(std::move(compared)),
274 my_substitute(std::move(substitute)),
275 my_by_row(by_row)
276 {
277 if (static_cast<size_t>(my_compared.size()) != static_cast<size_t>(my_substitute.size())) {
278 throw std::runtime_error("'compared' and 'substitute' should have the same length");
279 }
280 for (size_t i = 0, end = my_compared.size(); i < end; ++i) {
281 if (!delayed_substitute_is_sparse<op_, InputValue_>(my_compared[i], my_substitute[i])) {
282 my_sparse = false;
283 break;
284 }
285 }
286 }
287
288private:
289 ComparedVector_ my_compared;
290 SubstituteVector_ my_substitute;
291 bool my_by_row;
292 bool my_sparse = true;
293
294public:
295 std::optional<Index_> nrow() const {
296 if (my_by_row) {
297 return my_compared.size();
298 } else {
299 return std::nullopt;
300 }
301 }
302
303 std::optional<Index_> ncol() const {
304 if (my_by_row) {
305 return std::nullopt;
306 } else {
307 return my_compared.size();
308 }
309 }
310
311public:
312 bool zero_depends_on_row() const {
313 return my_by_row;
314 }
315
317 return !my_by_row;
318 }
319
321 return my_by_row;
322 }
323
325 return !my_by_row;
326 }
327
328public:
329 void dense(bool row, Index_ idx, Index_ start, Index_ length, const InputValue_* input, OutputValue_* output) const {
330 if (row == my_by_row) {
331 delayed_substitute_run_simple<op_>(input, length, my_compared[idx], output, my_substitute[idx]);
332 } else {
333 if constexpr(std::is_same<InputValue_, OutputValue_>::value) {
334 input = output; // basically an assertion to the compiler to skip aliasing protection.
335 }
336 for (Index_ i = 0; i < length; ++i) {
337 Index_ is = i + start;
338 output[i] = delayed_substitute_run<op_>(input[i], my_compared[is], my_substitute[is]);
339 }
340 }
341 }
342
343 void dense(bool row, Index_ idx, const std::vector<Index_>& indices, const InputValue_* input, OutputValue_* output) const {
344 if (row == my_by_row) {
345 delayed_substitute_run_simple<op_>(input, static_cast<Index_>(indices.size()), my_compared[idx], output, my_substitute[idx]);
346 } else {
347 if constexpr(std::is_same<InputValue_, OutputValue_>::value) {
348 input = output; // basically an assertion to the compiler to skip aliasing protection.
349 }
350 Index_ length = indices.size();
351 for (Index_ i = 0; i < length; ++i) {
352 auto ii = indices[i];
353 output[i] = delayed_substitute_run<op_>(input[i], my_compared[ii], my_substitute[ii]);
354 }
355 }
356 }
357
358public:
359 bool is_sparse() const {
360 return my_sparse;
361 }
362
363 void sparse(bool row, Index_ idx, Index_ number, const InputValue_* input_value, const Index_* indices, OutputValue_* output_value) const {
364 if (row == my_by_row) {
365 delayed_substitute_run_simple<op_>(input_value, number, my_compared[idx], output_value, my_substitute[idx]);
366 } else {
367 if constexpr(std::is_same<InputValue_, OutputValue_>::value) {
368 input_value = output_value; // basically an assertion to the compiler to skip aliasing protection.
369 }
370 for (Index_ i = 0; i < number; ++i) {
371 auto ii = indices[i];
372 output_value[i] = delayed_substitute_run<op_>(input_value[i], my_compared[ii], my_substitute[ii]);
373 }
374 }
375 }
376
377 OutputValue_ fill(bool row, Index_ idx) const {
378 if (row == my_by_row) {
379 auto sub = my_substitute[idx];
380 if (!delayed_compare<op_, InputValue_>(0, my_compared[idx])) {
381 return 0;
382 } else {
383 return sub;
384 }
385 } else {
386 // We should only get to this point if it's sparse, otherwise no
387 // single fill value would work across the length of my_compared.
388 return 0;
389 }
390 }
391};
392
402template<typename OutputValue_, typename InputValue_, typename Index_, typename ComparedVector_, typename SubstituteVector_>
404
414template<typename OutputValue_, typename InputValue_, typename Index_, typename ComparedVector_, typename SubstituteVector_>
416
426template<typename OutputValue_, typename InputValue_, typename Index_, typename ComparedVector_, typename SubstituteVector_>
428
438template<typename OutputValue_, typename InputValue_, typename Index_, typename ComparedVector_, typename SubstituteVector_>
440
450template<typename OutputValue_, typename InputValue_, typename Index_, typename ComparedVector_, typename SubstituteVector_>
452
462template<typename OutputValue_, typename InputValue_, typename Index_, typename ComparedVector_, typename SubstituteVector_>
464
474template<typename OutputValue_, typename InputValue_, typename Index_, typename ComparedVector_, typename SubstituteVector_>
476
480// Back-compatibility only.
481template<typename OutputValue_ = double, typename InputValue_ = double, typename Index_ = int, typename ComparedVector_, typename SubstituteVector_>
482std::shared_ptr<DelayedUnaryIsometricOperationHelper<OutputValue_, InputValue_, Index_> > make_DelayedUnaryIsometricSubstituteEqualVector(ComparedVector_ compared, SubstituteVector_ substitute, bool by_row) {
483 return std::make_shared<DelayedUnaryIsometricSubstituteEqualVectorHelper<OutputValue_, InputValue_, Index_, ComparedVector_, SubstituteVector_> >(std::move(compared), std::move(substitute), by_row);
484}
485
486template<typename OutputValue_ = double, typename InputValue_ = double, typename Index_ = int, typename ComparedVector_, typename SubstituteVector_>
487std::shared_ptr<DelayedUnaryIsometricOperationHelper<OutputValue_, InputValue_, Index_> > make_DelayedUnaryIsometricSubstituteGreaterThanVector(ComparedVector_ compared, SubstituteVector_ substitute, bool by_row) {
488 return std::make_shared<DelayedUnaryIsometricSubstituteGreaterThanVectorHelper<OutputValue_, InputValue_, Index_, ComparedVector_, SubstituteVector_> >(std::move(compared), std::move(substitute), by_row);
489}
490
491template<typename OutputValue_ = double, typename InputValue_ = double, typename Index_ = int, typename ComparedVector_, typename SubstituteVector_>
492std::shared_ptr<DelayedUnaryIsometricOperationHelper<OutputValue_, InputValue_, Index_> > make_DelayedUnaryIsometricSubstituteLessThanVector(ComparedVector_ compared, SubstituteVector_ substitute, bool by_row) {
493 return std::make_shared<DelayedUnaryIsometricSubstituteLessThanVectorHelper<OutputValue_, InputValue_, Index_, ComparedVector_, SubstituteVector_> >(std::move(compared), std::move(substitute), by_row);
494}
495
496template<typename OutputValue_ = double, typename InputValue_ = double, typename Index_ = int, typename ComparedVector_, typename SubstituteVector_>
497std::shared_ptr<DelayedUnaryIsometricOperationHelper<OutputValue_, InputValue_, Index_> > make_DelayedUnaryIsometricSubstituteGreaterThanOrEqualVector(ComparedVector_ compared, SubstituteVector_ substitute, bool by_row) {
498 return std::make_shared<DelayedUnaryIsometricSubstituteGreaterThanOrEqualVectorHelper<OutputValue_, InputValue_, Index_, ComparedVector_, SubstituteVector_> >(std::move(compared), std::move(substitute), by_row);
499}
500
501template<typename OutputValue_ = double, typename InputValue_ = double, typename Index_ = int, typename ComparedVector_, typename SubstituteVector_>
502std::shared_ptr<DelayedUnaryIsometricOperationHelper<OutputValue_, InputValue_, Index_> > make_DelayedUnaryIsometricLessSubstituteThanOrEqualVector(ComparedVector_ compared, SubstituteVector_ substitute, bool by_row) {
503 return std::make_shared<DelayedUnaryIsometricSubstituteLessThanOrEqualVectorHelper<OutputValue_, InputValue_, Index_, ComparedVector_, SubstituteVector_> >(std::move(compared), std::move(substitute), by_row);
504}
505
506template<typename OutputValue_ = double, typename InputValue_ = double, typename Index_ = int, typename ComparedVector_, typename SubstituteVector_>
507std::shared_ptr<DelayedUnaryIsometricOperationHelper<OutputValue_, InputValue_, Index_> > make_DelayedUnaryIsometricSubstituteNotEqualVector(ComparedVector_ compared, SubstituteVector_ substitute, bool by_row) {
508 return std::make_shared<DelayedUnaryIsometricSubstituteNotEqualVectorHelper<OutputValue_, InputValue_, Index_, ComparedVector_, SubstituteVector_> >(std::move(compared), std::move(substitute), by_row);
509}
517template<SpecialCompareOperation op_, bool pass_, typename InputValue_, typename OutputValue_>
518bool delayed_special_substitute_is_sparse(OutputValue_ substitute) {
519 return !delayed_special_compare<op_, pass_, InputValue_>(0) || substitute == 0;
520}
521
522template<SpecialCompareOperation op_, bool pass_, typename InputValue_, typename OutputValue_>
523OutputValue_ delayed_special_substitute_run(InputValue_ val, OutputValue_ substitute) {
524 if (delayed_special_compare<op_, pass_>(val)) {
525 return substitute;
526 } else {
527 return val;
528 }
529}
530
531template<SpecialCompareOperation op_, bool pass_, typename InputValue_, typename Index_, typename OutputValue_>
532void delayed_special_substitute_run_simple(const InputValue_* input, Index_ length, OutputValue_ substitute, OutputValue_* output) {
533 if constexpr(std::is_same<InputValue_, OutputValue_>::value) {
534 input = output; // basically an assertion to the compiler to skip aliasing protection.
535 }
536 for (Index_ i = 0; i < length; ++i) {
537 output[i] = delayed_special_substitute_run<op_, pass_>(input[i], substitute);
538 }
539}
557template<SpecialCompareOperation op_, bool pass_, typename OutputValue_, typename InputValue_, typename Index_>
558class DelayedUnaryIsometricSpecialSubstituteHelper final : public DelayedUnaryIsometricOperationHelper<OutputValue_, InputValue_, Index_> {
559public:
563 DelayedUnaryIsometricSpecialSubstituteHelper(OutputValue_ substitute) : my_substitute(substitute) {
564 my_sparse = delayed_special_substitute_is_sparse<op_, pass_, InputValue_>(my_substitute);
565 }
566
567private:
568 OutputValue_ my_substitute;
569 bool my_sparse;
570
571public:
572 std::optional<Index_> nrow() const {
573 return std::nullopt;
574 }
575
576 std::optional<Index_> ncol() const {
577 return std::nullopt;
578 }
579
580public:
581 bool zero_depends_on_row() const {
582 return false;
583 }
584
586 return false;
587 }
588
590 return false;
591 }
592
594 return false;
595 }
596
597public:
598 void dense(bool, Index_, Index_, Index_ length, const InputValue_* input, OutputValue_* output) const {
599 delayed_special_substitute_run_simple<op_, pass_>(input, length, my_substitute, output);
600 }
601
602 void dense(bool, Index_, const std::vector<Index_>& indices, const InputValue_* input, OutputValue_* output) const {
603 delayed_special_substitute_run_simple<op_, pass_>(input, static_cast<Index_>(indices.size()), my_substitute, output);
604 }
605
606public:
607 bool is_sparse() const {
608 return my_sparse;
609 }
610
611 void sparse(bool, Index_, Index_ number, const InputValue_* input_value, const Index_*, OutputValue_* output_value) const {
612 delayed_special_substitute_run_simple<op_, pass_>(input_value, number, my_substitute, output_value);
613 }
614
615 OutputValue_ fill(bool, Index_) const {
616 if (my_sparse) {
617 return 0;
618 } else {
619 return my_substitute;
620 }
621 }
622};
623
632template<bool pass_, typename OutputValue_, typename InputValue_, typename Index_>
634
643template<bool pass_, typename OutputValue_, typename InputValue_, typename Index_>
645
654template<bool pass_, typename OutputValue_, typename InputValue_, typename Index_>
656
660// Back-compatibility only.
661template<bool pass_ = true, typename OutputValue_ = double, typename InputValue_ = double, typename Index_ = int>
662std::shared_ptr<DelayedUnaryIsometricOperationHelper<OutputValue_, InputValue_, Index_> > make_DelayedUnaryIsometricSubstituteIsnan(OutputValue_ substitute) {
663 return std::make_shared<DelayedUnaryIsometricSubstituteIsnanHelper<pass_, OutputValue_, InputValue_, Index_> >(substitute);
664}
665
666template<bool pass_ = true, typename OutputValue_ = double, typename InputValue_ = double, typename Index_ = int>
667std::shared_ptr<DelayedUnaryIsometricOperationHelper<OutputValue_, InputValue_, Index_> > make_DelayedUnaryIsometricSubstituteIsinf(OutputValue_ substitute) {
668 return std::make_shared<DelayedUnaryIsometricSubstituteIsinfHelper<pass_, OutputValue_, InputValue_, Index_> >(substitute);
669}
670
671template<bool pass_ = true, typename OutputValue_ = double, typename InputValue_ = double, typename Index_ = int>
672std::shared_ptr<DelayedUnaryIsometricOperationHelper<OutputValue_, InputValue_, Index_> > make_DelayedUnaryIsometricSubstituteIsfinite(OutputValue_ substitute) {
673 return std::make_shared<DelayedUnaryIsometricSubstituteIsfiniteHelper<pass_, OutputValue_, InputValue_, Index_> >(substitute);
674}
679}
680
681#endif
Helper operation interface for DelayedUnaryIsometricOperation.
Definition helper_interface.hpp:27
Delayed special value substitution.
Definition substitute_helpers.hpp:558
std::optional< Index_ > ncol() const
Definition substitute_helpers.hpp:576
void dense(bool, Index_, Index_, Index_ length, const InputValue_ *input, OutputValue_ *output) const
Definition substitute_helpers.hpp:598
bool zero_depends_on_column() const
Definition substitute_helpers.hpp:585
bool zero_depends_on_row() const
Definition substitute_helpers.hpp:581
DelayedUnaryIsometricSpecialSubstituteHelper(OutputValue_ substitute)
Definition substitute_helpers.hpp:563
bool non_zero_depends_on_column() const
Definition substitute_helpers.hpp:593
std::optional< Index_ > nrow() const
Definition substitute_helpers.hpp:572
void sparse(bool, Index_, Index_ number, const InputValue_ *input_value, const Index_ *, OutputValue_ *output_value) const
Definition substitute_helpers.hpp:611
bool is_sparse() const
Definition substitute_helpers.hpp:607
void dense(bool, Index_, const std::vector< Index_ > &indices, const InputValue_ *input, OutputValue_ *output) const
Definition substitute_helpers.hpp:602
bool non_zero_depends_on_row() const
Definition substitute_helpers.hpp:589
OutputValue_ fill(bool, Index_) const
Definition substitute_helpers.hpp:615
Helper for delayed scalar substitution.
Definition substitute_helpers.hpp:60
bool non_zero_depends_on_column() const
Definition substitute_helpers.hpp:98
bool is_sparse() const
Definition substitute_helpers.hpp:112
DelayedUnaryIsometricSubstituteScalarHelper(Scalar_ compared, OutputValue_ substitute)
Definition substitute_helpers.hpp:67
std::optional< Index_ > nrow() const
Definition substitute_helpers.hpp:77
void sparse(bool, Index_, Index_ number, const InputValue_ *input_value, const Index_ *, OutputValue_ *output_value) const
Definition substitute_helpers.hpp:116
void dense(bool, Index_, const std::vector< Index_ > &indices, const InputValue_ *input, OutputValue_ *output) const
Definition substitute_helpers.hpp:107
OutputValue_ fill(bool, Index_) const
Definition substitute_helpers.hpp:120
bool non_zero_depends_on_row() const
Definition substitute_helpers.hpp:94
bool zero_depends_on_column() const
Definition substitute_helpers.hpp:90
void dense(bool, Index_, Index_, Index_ length, const InputValue_ *input, OutputValue_ *output) const
Definition substitute_helpers.hpp:103
std::optional< Index_ > ncol() const
Definition substitute_helpers.hpp:81
bool zero_depends_on_row() const
Definition substitute_helpers.hpp:86
Delayed vector comparisons.
Definition substitute_helpers.hpp:260
std::optional< Index_ > nrow() const
Definition substitute_helpers.hpp:295
bool is_sparse() const
Definition substitute_helpers.hpp:359
bool zero_depends_on_row() const
Definition substitute_helpers.hpp:312
DelayedUnaryIsometricSubstituteVectorHelper(ComparedVector_ compared, SubstituteVector_ substitute, bool by_row)
Definition substitute_helpers.hpp:272
void dense(bool row, Index_ idx, const std::vector< Index_ > &indices, const InputValue_ *input, OutputValue_ *output) const
Definition substitute_helpers.hpp:343
std::optional< Index_ > ncol() const
Definition substitute_helpers.hpp:303
void dense(bool row, Index_ idx, Index_ start, Index_ length, const InputValue_ *input, OutputValue_ *output) const
Definition substitute_helpers.hpp:329
OutputValue_ fill(bool row, Index_ idx) const
Definition substitute_helpers.hpp:377
void sparse(bool row, Index_ idx, Index_ number, const InputValue_ *input_value, const Index_ *indices, OutputValue_ *output_value) const
Definition substitute_helpers.hpp:363
bool non_zero_depends_on_row() const
Definition substitute_helpers.hpp:320
bool zero_depends_on_column() const
Definition substitute_helpers.hpp:316
bool non_zero_depends_on_column() const
Definition substitute_helpers.hpp:324
Utilities for delayed comparison operations.
Flexible representations for matrix data.
Definition Extractor.hpp:15
Interface for tatami::DelayedUnaryIsometricOperation helpers.