tatami
C++ API for different matrix representations
Loading...
Searching...
No Matches
math_helpers.hpp
Go to the documentation of this file.
1#ifndef TATAMI_MATH_HELPERS_H
2#define TATAMI_MATH_HELPERS_H
3
10#include "helper_interface.hpp"
11#include <cmath>
12
13namespace tatami {
14
25template<typename OutputValue_, typename InputValue_, typename Index_>
26class DelayedUnaryIsometricAbsHelper final : public DelayedUnaryIsometricOperationHelper<OutputValue_, InputValue_, Index_> {
27public:
28 std::optional<Index_> nrow() const {
29 return std::nullopt;
30 }
31
32 std::optional<Index_> ncol() const {
33 return std::nullopt;
34 }
35
36public:
37 bool zero_depends_on_row() const {
38 return false;
39 }
40
42 return false;
43 }
44
46 return false;
47 }
48
50 return false;
51 }
52
53private:
54 void core(const InputValue_* input, const Index_ length, OutputValue_* const output) const {
55 if constexpr(std::is_same<InputValue_, OutputValue_>::value) {
56 input = output; // basically an assertion to the compiler to allow it to skip aliasing protection.
57 }
58 for (Index_ i = 0; i < length; ++i) {
59 output[i] = std::abs(input[i]);
60 }
61 }
62
63public:
64 void dense(const bool, const Index_, const Index_, const Index_ length, const InputValue_* const input, OutputValue_* const output) const {
65 core(input, length, output);
66 }
67
68 void dense(const bool, const Index_, const std::vector<Index_>& indices, const InputValue_* const input, OutputValue_* const output) const {
69 core(input, indices.size(), output);
70 }
71
72public:
73 bool is_sparse() const {
74 return true;
75 }
76
77 void sparse(const bool, const Index_, const Index_ number, const InputValue_* const input, const Index_* const, OutputValue_* const output) const {
78 core(input, number, output);
79 }
80
81 OutputValue_ fill(const bool, const Index_) const {
82 return 0;
83 }
84};
85
98template<typename OutputValue_, typename InputValue_, typename Index_>
99class DelayedUnaryIsometricSignHelper final : public DelayedUnaryIsometricOperationHelper<OutputValue_, InputValue_, Index_> {
100public:
101 std::optional<Index_> nrow() const {
102 return std::nullopt;
103 }
104
105 std::optional<Index_> ncol() const {
106 return std::nullopt;
107 }
108
109public:
110 bool zero_depends_on_row() const {
111 return false;
112 }
113
115 return false;
116 }
117
119 return false;
120 }
121
123 return false;
124 }
125
126private:
127 void core(const InputValue_* input, const Index_ length, OutputValue_* const output) const {
128 if constexpr(std::is_same<InputValue_, OutputValue_>::value) {
129 input = output; // basically an assertion to the compiler to allow it to skip aliasing protection.
130 }
131 for (Index_ i = 0; i < length; ++i) {
132 auto val = input[i];
133 if ([&]{
134 if constexpr(std::numeric_limits<InputValue_>::has_quiet_NaN) {
135 return !std::isnan(val);
136 } else {
137 return true;
138 }
139 }()) {
140 output[i] = (static_cast<InputValue_>(0) < val) - (val < static_cast<InputValue_>(0));
141 } else if constexpr(std::numeric_limits<OutputValue_>::has_quiet_NaN) {
142 output[i] = std::numeric_limits<OutputValue_>::quiet_NaN();
143 } else {
144 output[i] = 0;
145 }
146 }
147 }
148
149public:
150 void dense(const bool, const Index_, const Index_, const Index_ length, const InputValue_* const input, OutputValue_* const output) const {
151 core(input, length, output);
152 }
153
154 void dense(const bool, const Index_, const std::vector<Index_>& indices, const InputValue_* const input, OutputValue_* const output) const {
155 core(input, indices.size(), output);
156 }
157
158public:
159 bool is_sparse() const {
160 return true;
161 }
162
163 void sparse(const bool, const Index_, const Index_ number, const InputValue_* const input, const Index_* const, OutputValue_* const output) const {
164 core(input, number, output);
165 }
166
167 OutputValue_ fill(const bool, const Index_) const {
168 return 0;
169 }
170};
171
184template<int base_, typename OutputValue_, typename InputValue_, typename Index_>
185class DelayedUnaryIsometricFixedLogHelper final : public DelayedUnaryIsometricOperationHelper<OutputValue_, InputValue_, Index_> {
186public:
187 std::optional<Index_> nrow() const {
188 return std::nullopt;
189 }
190
191 std::optional<Index_> ncol() const {
192 return std::nullopt;
193 }
194
195public:
196 bool zero_depends_on_row() const {
197 return false;
198 }
199
201 return false;
202 }
203
205 return false;
206 }
207
209 return false;
210 }
211
212private:
213 static auto logify(InputValue_ x) {
214 if constexpr(base_ == 2) {
215 return std::log2(x);
216 } else if constexpr(base_ == 10) {
217 return std::log10(x);
218 } else {
219 return std::log(x);
220 }
221 }
222
223 void core(const InputValue_* input, const Index_ length, OutputValue_* const output) const {
224 if constexpr(std::is_same<InputValue_, OutputValue_>::value) {
225 input = output; // basically an assertion to the compiler to allow it to skip aliasing protection.
226 }
227 for (Index_ i = 0; i < length; ++i) {
228 output[i] = logify(input[i]);
229 }
230 }
231
232public:
233 void dense(const bool, const Index_, const Index_, const Index_ length, const InputValue_* const input, OutputValue_* const output) const {
234 core(input, length, output);
235 }
236
237 void dense(const bool, const Index_, const std::vector<Index_>& indices, const InputValue_* const input, OutputValue_* const output) const {
238 core(input, indices.size(), output);
239 }
240
241public:
242 bool is_sparse() const {
243 return false;
244 }
245
246 void sparse(const bool, const Index_, const Index_ number, const InputValue_* const input, const Index_* const, OutputValue_* const output) const {
247 core(input, number, output);
248 }
249
250 OutputValue_ fill(const bool, const Index_) const {
251 // Use the implementation-defined value.
252 return logify(0);
253 }
254};
266template<typename OutputValue_, typename InputValue_, typename Index_>
267using DelayedUnaryIsometricLogHelper = DelayedUnaryIsometricFixedLogHelper<-1, OutputValue_, InputValue_, Index_>;
268
276template<typename OutputValue_, typename InputValue_, typename Index_>
278
286template<typename OutputValue_, typename InputValue_, typename Index_>
288
300template<typename OutputValue_, typename InputValue_, typename Index_, typename Base_>
301class DelayedUnaryIsometricCustomLogHelper final : public DelayedUnaryIsometricOperationHelper<OutputValue_, InputValue_, Index_> {
302public:
306 DelayedUnaryIsometricCustomLogHelper(Base_ base) : my_base(std::log(base)) {}
307
308public:
309 std::optional<Index_> nrow() const {
310 return std::nullopt;
311 }
312
313 std::optional<Index_> ncol() const {
314 return std::nullopt;
315 }
316
317public:
318 bool zero_depends_on_row() const {
319 return false;
320 }
321
323 return false;
324 }
325
327 return false;
328 }
329
331 return false;
332 }
333
334private:
335 Base_ my_base;
336
337 void core(const InputValue_* input, const Index_ length, OutputValue_* const output) const {
338 if constexpr(std::is_same<InputValue_, OutputValue_>::value) {
339 input = output; // basically an assertion to the compiler to allow it to skip aliasing protection.
340 }
341 for (Index_ i = 0; i < length; ++i) {
342 output[i] = std::log(input[i]) / my_base;
343 }
344 }
345
346public:
347 void dense(const bool, const Index_, const Index_, const Index_ length, const InputValue_* const input, OutputValue_* const output) const {
348 core(input, length, output);
349 }
350
351 void dense(const bool, const Index_, const std::vector<Index_>& indices, const InputValue_* const input, OutputValue_* const output) const {
352 core(input, indices.size(), output);
353 }
354
355public:
356 bool is_sparse() const {
357 return false;
358 }
359
360 void sparse(const bool, const Index_, const Index_ number, const InputValue_* const input, const Index_* const, OutputValue_* const output) const {
361 core(input, number, output);
362 }
363
364 OutputValue_ fill(const bool, const Index_) const {
365 // Use the implementation-defined value.
366 return std::log(static_cast<InputValue_>(0)) / my_base;
367 }
368};
369
380template<typename OutputValue_, typename InputValue_, typename Index_>
381class DelayedUnaryIsometricSqrtHelper final : public DelayedUnaryIsometricOperationHelper<OutputValue_, InputValue_, Index_> {
382public:
383 std::optional<Index_> nrow() const {
384 return std::nullopt;
385 }
386
387 std::optional<Index_> ncol() const {
388 return std::nullopt;
389 }
390
391public:
392 bool zero_depends_on_row() const {
393 return false;
394 }
395
397 return false;
398 }
399
401 return false;
402 }
403
405 return false;
406 }
407
408private:
409 void core(const InputValue_* input, const Index_ length, OutputValue_* const output) const {
410 if constexpr(std::is_same<InputValue_, OutputValue_>::value) {
411 input = output; // basically an assertion to the compiler to allow it to skip aliasing protection.
412 }
413 for (Index_ i = 0; i < length; ++i) {
414 output[i] = std::sqrt(input[i]);
415 }
416 }
417
418public:
419 void dense(const bool, const Index_, const Index_, const Index_ length, const InputValue_* const input, OutputValue_* const output) const {
420 core(input, length, output);
421 }
422
423 void dense(const bool, const Index_, const std::vector<Index_>& indices, const InputValue_* const input, OutputValue_* const output) const {
424 core(input, indices.size(), output);
425 }
426
427public:
428 bool is_sparse() const {
429 return true;
430 }
431
432 void sparse(const bool, const Index_, const Index_ number, const InputValue_* const input, const Index_* const, OutputValue_* const output) const {
433 core(input, number, output);
434 }
435
436 OutputValue_ fill(const bool, const Index_) const {
437 return 0;
438 }
439};
440
451template<typename OutputValue_, typename InputValue_, typename Index_>
452class DelayedUnaryIsometricCeilingHelper final : public DelayedUnaryIsometricOperationHelper<OutputValue_, InputValue_, Index_> {
453public:
454 std::optional<Index_> nrow() const {
455 return std::nullopt;
456 }
457
458 std::optional<Index_> ncol() const {
459 return std::nullopt;
460 }
461
462public:
463 bool zero_depends_on_row() const {
464 return false;
465 }
466
468 return false;
469 }
470
472 return false;
473 }
474
476 return false;
477 }
478
479private:
480 void core(const InputValue_* input, const Index_ length, OutputValue_* const output) const {
481 if constexpr(std::is_same<InputValue_, OutputValue_>::value) {
482 input = output; // basically an assertion to the compiler to allow it to skip aliasing protection.
483 }
484 for (Index_ i = 0; i < length; ++i) {
485 output[i] = std::ceil(input[i]);
486 }
487 }
488
489public:
490 void dense(const bool, const Index_, const Index_, const Index_ length, const InputValue_* const input, OutputValue_* const output) const {
491 core(input, length, output);
492 }
493
494 void dense(const bool, const Index_, const std::vector<Index_>& indices, const InputValue_* const input, OutputValue_* const output) const {
495 core(input, indices.size(), output);
496 }
497
498public:
499 bool is_sparse() const {
500 return true;
501 }
502
503 void sparse(const bool, const Index_, const Index_ number, const InputValue_* const input, const Index_* const, OutputValue_* const output) const {
504 core(input, number, output);
505 }
506
507 OutputValue_ fill(const bool, const Index_) const {
508 return 0;
509 }
510};
511
522template<typename OutputValue_, typename InputValue_, typename Index_>
523class DelayedUnaryIsometricFloorHelper final : public DelayedUnaryIsometricOperationHelper<OutputValue_, InputValue_, Index_> {
524public:
525 std::optional<Index_> nrow() const {
526 return std::nullopt;
527 }
528
529 std::optional<Index_> ncol() const {
530 return std::nullopt;
531 }
532
533public:
534 bool zero_depends_on_row() const {
535 return false;
536 }
537
539 return false;
540 }
541
543 return false;
544 }
545
547 return false;
548 }
549
550private:
551 void core(const InputValue_* input, const Index_ length, OutputValue_* const output) const {
552 if constexpr(std::is_same<InputValue_, OutputValue_>::value) {
553 input = output; // basically an assertion to the compiler to allow it to skip aliasing protection.
554 }
555 for (Index_ i = 0; i < length; ++i) {
556 output[i] = std::floor(input[i]);
557 }
558 }
559
560public:
561 void dense(const bool, const Index_, const Index_, const Index_ length, const InputValue_* const input, OutputValue_* const output) const {
562 core(input, length, output);
563 }
564
565 void dense(const bool, const Index_, const std::vector<Index_>& indices, const InputValue_* const input, OutputValue_* const output) const {
566 core(input, indices.size(), output);
567 }
568
569public:
570 bool is_sparse() const {
571 return true;
572 }
573
574 void sparse(const bool, const Index_, const Index_ number, const InputValue_* const input, const Index_* const, OutputValue_* const output) const {
575 core(input, number, output);
576 }
577
578 OutputValue_ fill(const bool, const Index_) const {
579 return 0;
580 }
581};
582
593template<typename OutputValue_, typename InputValue_, typename Index_>
594class DelayedUnaryIsometricTruncHelper final : public DelayedUnaryIsometricOperationHelper<OutputValue_, InputValue_, Index_> {
595public:
596 std::optional<Index_> nrow() const {
597 return std::nullopt;
598 }
599
600 std::optional<Index_> ncol() const {
601 return std::nullopt;
602 }
603
604public:
605 bool zero_depends_on_row() const {
606 return false;
607 }
608
610 return false;
611 }
612
614 return false;
615 }
616
618 return false;
619 }
620
621private:
622 void core(const InputValue_* input, const Index_ length, OutputValue_* const output) const {
623 if constexpr(std::is_same<InputValue_, OutputValue_>::value) {
624 input = output; // basically an assertion to the compiler to allow it to skip aliasing protection.
625 }
626 for (Index_ i = 0; i < length; ++i) {
627 output[i] = std::trunc(input[i]);
628 }
629 }
630
631public:
632 void dense(const bool, const Index_, const Index_, const Index_ length, const InputValue_* const input, OutputValue_* const output) const {
633 core(input, length, output);
634 }
635
636 void dense(const bool, const Index_, const std::vector<Index_>& indices, const InputValue_* const input, OutputValue_* const output) const {
637 core(input, indices.size(), output);
638 }
639
640public:
641 bool is_sparse() const {
642 return true;
643 }
644
645 void sparse(const bool, const Index_, const Index_ number, const InputValue_* const input, const Index_* const, OutputValue_* const output) const {
646 core(input, number, output);
647 }
648
649 OutputValue_ fill(const bool, const Index_) const {
650 return 0;
651 }
652};
653
664template<typename OutputValue_, typename InputValue_, typename Index_>
665class DelayedUnaryIsometricLog1pHelper final : public DelayedUnaryIsometricOperationHelper<OutputValue_, InputValue_, Index_> {
666public:
667 std::optional<Index_> nrow() const {
668 return std::nullopt;
669 }
670
671 std::optional<Index_> ncol() const {
672 return std::nullopt;
673 }
674
675public:
676 bool zero_depends_on_row() const {
677 return false;
678 }
679
681 return false;
682 }
683
685 return false;
686 }
687
689 return false;
690 }
691
692private:
693 void core(const InputValue_* input, const Index_ length, OutputValue_* const output) const {
694 if constexpr(std::is_same<InputValue_, OutputValue_>::value) {
695 input = output; // basically an assertion to the compiler to allow it to skip aliasing protection.
696 }
697 for (Index_ i = 0; i < length; ++i) {
698 output[i] = std::log1p(input[i]);
699 }
700 }
701
702public:
703 void dense(const bool, const Index_, const Index_, const Index_ length, const InputValue_* const input, OutputValue_* const output) const {
704 core(input, length, output);
705 }
706
707 void dense(const bool, const Index_, const std::vector<Index_>& indices, const InputValue_* const input, OutputValue_* const output) const {
708 core(input, indices.size(), output);
709 }
710
711public:
712 bool is_sparse() const {
713 return true;
714 }
715
716 void sparse(const bool, const Index_, const Index_ number, const InputValue_* const input, const Index_* const, OutputValue_* const output) const {
717 core(input, number, output);
718 }
719
720 OutputValue_ fill(const bool, const Index_) const {
721 return 0;
722 }
723};
724
735template<typename OutputValue_, typename InputValue_, typename Index_>
736class DelayedUnaryIsometricRoundHelper final : public DelayedUnaryIsometricOperationHelper<OutputValue_, InputValue_, Index_> {
737public:
738 std::optional<Index_> nrow() const {
739 return std::nullopt;
740 }
741
742 std::optional<Index_> ncol() const {
743 return std::nullopt;
744 }
745
746public:
747 bool zero_depends_on_row() const {
748 return false;
749 }
750
752 return false;
753 }
754
756 return false;
757 }
758
760 return false;
761 }
762
763private:
764 void core(const InputValue_* input, const Index_ length, OutputValue_* const output) const {
765 if constexpr(std::is_same<InputValue_, OutputValue_>::value) {
766 input = output; // basically an assertion to the compiler to allow it to skip aliasing protection.
767 }
768 for (Index_ i = 0; i < length; ++i) {
769 output[i] = std::round(input[i]);
770 }
771 }
772
773public:
774 void dense(const bool, const Index_, const Index_, const Index_ length, const InputValue_* const input, OutputValue_* const output) const {
775 core(input, length, output);
776 }
777
778 void dense(const bool, const Index_, const std::vector<Index_>& indices, const InputValue_* const input, OutputValue_* const output) const {
779 core(input, indices.size(), output);
780 }
781
782public:
783 bool is_sparse() const {
784 return true;
785 }
786
787 void sparse(const bool, const Index_, const Index_ number, const InputValue_* const input, const Index_* const, OutputValue_* const output) const {
788 core(input, number, output);
789 }
790
791 OutputValue_ fill(const bool, const Index_) const {
792 return 0;
793 }
794};
795
806template<typename OutputValue_, typename InputValue_, typename Index_>
807class DelayedUnaryIsometricExpHelper final : public DelayedUnaryIsometricOperationHelper<OutputValue_, InputValue_, Index_> {
808public:
809 std::optional<Index_> nrow() const {
810 return std::nullopt;
811 }
812
813 std::optional<Index_> ncol() const {
814 return std::nullopt;
815 }
816
817public:
818 bool zero_depends_on_row() const {
819 return false;
820 }
821
823 return false;
824 }
825
827 return false;
828 }
829
831 return false;
832 }
833
834private:
835 void core(const InputValue_* input, const Index_ length, OutputValue_* const output) const {
836 if constexpr(std::is_same<InputValue_, OutputValue_>::value) {
837 input = output; // basically an assertion to the compiler to allow it to skip aliasing protection.
838 }
839 for (Index_ i = 0; i < length; ++i) {
840 output[i] = std::exp(input[i]);
841 }
842 }
843
844public:
845 void dense(const bool, const Index_, const Index_, const Index_ length, const InputValue_* const input, OutputValue_* const output) const {
846 core(input, length, output);
847 }
848
849 void dense(const bool, const Index_, const std::vector<Index_>& indices, const InputValue_* const input, OutputValue_* const output) const {
850 core(input, indices.size(), output);
851 }
852
853public:
854 bool is_sparse() const {
855 return false;
856 }
857
858 void sparse(const bool, const Index_, const Index_ number, const InputValue_* const input, const Index_* const, OutputValue_* const output) const {
859 core(input, number, output);
860 }
861
862 OutputValue_ fill(const bool, const Index_) const {
863 return 1;
864 }
865};
866
877template<typename OutputValue_, typename InputValue_, typename Index_>
878class DelayedUnaryIsometricExpm1Helper final : public DelayedUnaryIsometricOperationHelper<OutputValue_, InputValue_, Index_> {
879public:
880 std::optional<Index_> nrow() const {
881 return std::nullopt;
882 }
883
884 std::optional<Index_> ncol() const {
885 return std::nullopt;
886 }
887
888public:
889 bool zero_depends_on_row() const {
890 return false;
891 }
892
894 return false;
895 }
896
898 return false;
899 }
900
902 return false;
903 }
904
905private:
906 void core(const InputValue_* input, const Index_ length, OutputValue_* const output) const {
907 if constexpr(std::is_same<InputValue_, OutputValue_>::value) {
908 input = output; // basically an assertion to the compiler to allow it to skip aliasing protection.
909 }
910 for (Index_ i = 0; i < length; ++i) {
911 output[i] = std::expm1(input[i]);
912 }
913 }
914
915public:
916 void dense(const bool, const Index_, const Index_, const Index_ length, const InputValue_* const input, OutputValue_* const output) const {
917 core(input, length, output);
918 }
919
920 void dense(const bool, const Index_, const std::vector<Index_>& indices, const InputValue_* const input, OutputValue_* const output) const {
921 core(input, indices.size(), output);
922 }
923
924public:
925 bool is_sparse() const {
926 return true;
927 }
928
929 void sparse(const bool, const Index_, const Index_ number, const InputValue_* const input, const Index_* const, OutputValue_* const output) const {
930 core(input, number, output);
931 }
932
933 OutputValue_ fill(const bool, const Index_) const {
934 return 0;
935 }
936};
937
948template<typename OutputValue_, typename InputValue_, typename Index_>
949class DelayedUnaryIsometricAcosHelper final : public DelayedUnaryIsometricOperationHelper<OutputValue_, InputValue_, Index_> {
950public:
951 std::optional<Index_> nrow() const {
952 return std::nullopt;
953 }
954
955 std::optional<Index_> ncol() const {
956 return std::nullopt;
957 }
958
959public:
960 bool zero_depends_on_row() const {
961 return false;
962 }
963
965 return false;
966 }
967
969 return false;
970 }
971
973 return false;
974 }
975
976private:
977 void core(const InputValue_* input, const Index_ length, OutputValue_* const output) const {
978 if constexpr(std::is_same<InputValue_, OutputValue_>::value) {
979 input = output; // basically an assertion to the compiler to allow it to skip aliasing protection.
980 }
981 for (Index_ i = 0; i < length; ++i) {
982 output[i] = std::acos(input[i]);
983 }
984 }
985
986public:
987 void dense(const bool, const Index_, const Index_, const Index_ length, const InputValue_* const input, OutputValue_* const output) const {
988 core(input, length, output);
989 }
990
991 void dense(const bool, const Index_, const std::vector<Index_>& indices, const InputValue_* const input, OutputValue_* const output) const {
992 core(input, indices.size(), output);
993 }
994
995public:
996 bool is_sparse() const {
997 return false;
998 }
999
1000 void sparse(const bool, const Index_, const Index_ number, const InputValue_* const input, const Index_* const, OutputValue_* const output) const {
1001 core(input, number, output);
1002 }
1003
1004 OutputValue_ fill(const bool, const Index_) const {
1005 // Use the implementation-defined special value.
1006 return std::acos(0);
1007 }
1008};
1009
1020template<typename OutputValue_, typename InputValue_, typename Index_>
1021class DelayedUnaryIsometricAcoshHelper final : public DelayedUnaryIsometricOperationHelper<OutputValue_, InputValue_, Index_> {
1022public:
1023 std::optional<Index_> nrow() const {
1024 return std::nullopt;
1025 }
1026
1027 std::optional<Index_> ncol() const {
1028 return std::nullopt;
1029 }
1030
1031public:
1032 bool zero_depends_on_row() const {
1033 return false;
1034 }
1035
1037 return false;
1038 }
1039
1041 return false;
1042 }
1043
1045 return false;
1046 }
1047
1048private:
1049 void core(const InputValue_* input, const Index_ length, OutputValue_* const output) const {
1050 if constexpr(std::is_same<InputValue_, OutputValue_>::value) {
1051 input = output; // basically an assertion to the compiler to allow it to skip aliasing protection.
1052 }
1053 for (Index_ i = 0; i < length; ++i) {
1054 output[i] = std::acosh(input[i]);
1055 }
1056 }
1057
1058public:
1059 void dense(const bool, const Index_, const Index_, const Index_ length, const InputValue_* const input, OutputValue_* const output) const {
1060 core(input, length, output);
1061 }
1062
1063 void dense(const bool, const Index_, const std::vector<Index_>& indices, const InputValue_* const input, OutputValue_* const output) const {
1064 core(input, indices.size(), output);
1065 }
1066
1067public:
1068 bool is_sparse() const {
1069 return false;
1070 }
1071
1072 void sparse(const bool, const Index_, const Index_ number, const InputValue_* const input, const Index_* const, OutputValue_* const output) const {
1073 core(input, number, output);
1074 }
1075
1076 OutputValue_ fill(const bool, const Index_) const {
1077 // Use the implementation-defined special value.
1078 return std::acosh(static_cast<InputValue_>(0));
1079 }
1080};
1081
1092template<typename OutputValue_, typename InputValue_, typename Index_>
1093class DelayedUnaryIsometricAsinHelper final : public DelayedUnaryIsometricOperationHelper<OutputValue_, InputValue_, Index_> {
1094public:
1095 std::optional<Index_> nrow() const {
1096 return std::nullopt;
1097 }
1098
1099 std::optional<Index_> ncol() const {
1100 return std::nullopt;
1101 }
1102
1103public:
1104 bool zero_depends_on_row() const {
1105 return false;
1106 }
1107
1109 return false;
1110 }
1111
1113 return false;
1114 }
1115
1117 return false;
1118 }
1119
1120private:
1121 void core(const InputValue_* input, const Index_ length, OutputValue_* const output) const {
1122 if constexpr(std::is_same<InputValue_, OutputValue_>::value) {
1123 input = output; // basically an assertion to the compiler to allow it to skip aliasing protection.
1124 }
1125 for (Index_ i = 0; i < length; ++i) {
1126 output[i] = std::asin(input[i]);
1127 }
1128 }
1129
1130public:
1131 void dense(const bool, const Index_, const Index_, const Index_ length, const InputValue_* const input, OutputValue_* const output) const {
1132 core(input, length, output);
1133 }
1134
1135 void dense(const bool, const Index_, const std::vector<Index_>& indices, const InputValue_* const input, OutputValue_* const output) const {
1136 core(input, indices.size(), output);
1137 }
1138
1139public:
1140 bool is_sparse() const {
1141 return true;
1142 }
1143
1144 void sparse(const bool, const Index_, const Index_ number, const InputValue_* const input, const Index_* const, OutputValue_* const output) const {
1145 core(input, number, output);
1146 }
1147
1148 OutputValue_ fill(const bool, const Index_) const {
1149 return 0;
1150 }
1151};
1152
1163template<typename OutputValue_, typename InputValue_, typename Index_>
1164class DelayedUnaryIsometricAsinhHelper final : public DelayedUnaryIsometricOperationHelper<OutputValue_, InputValue_, Index_> {
1165public:
1166 std::optional<Index_> nrow() const {
1167 return std::nullopt;
1168 }
1169
1170 std::optional<Index_> ncol() const {
1171 return std::nullopt;
1172 }
1173
1174public:
1175 bool zero_depends_on_row() const {
1176 return false;
1177 }
1178
1180 return false;
1181 }
1182
1184 return false;
1185 }
1186
1188 return false;
1189 }
1190
1191private:
1192 void core(const InputValue_* input, const Index_ length, OutputValue_* const output) const {
1193 if constexpr(std::is_same<InputValue_, OutputValue_>::value) {
1194 input = output; // basically an assertion to the compiler to allow it to skip aliasing protection.
1195 }
1196 for (Index_ i = 0; i < length; ++i) {
1197 output[i] = std::asinh(input[i]);
1198 }
1199 }
1200
1201public:
1202 void dense(const bool, const Index_, const Index_, const Index_ length, const InputValue_* const input, OutputValue_* const output) const {
1203 core(input, length, output);
1204 }
1205
1206 void dense(const bool, const Index_, const std::vector<Index_>& indices, const InputValue_* const input, OutputValue_* const output) const {
1207 core(input, indices.size(), output);
1208 }
1209
1210public:
1211 bool is_sparse() const {
1212 return true;
1213 }
1214
1215 void sparse(const bool, const Index_, const Index_ number, const InputValue_* const input, const Index_* const, OutputValue_* const output) const {
1216 core(input, number, output);
1217 }
1218
1219 OutputValue_ fill(const bool, const Index_) const {
1220 return 0;
1221 }
1222};
1223
1234template<typename OutputValue_, typename InputValue_, typename Index_>
1235class DelayedUnaryIsometricAtanHelper final : public DelayedUnaryIsometricOperationHelper<OutputValue_, InputValue_, Index_> {
1236public:
1237 std::optional<Index_> nrow() const {
1238 return std::nullopt;
1239 }
1240
1241 std::optional<Index_> ncol() const {
1242 return std::nullopt;
1243 }
1244
1245public:
1246 bool zero_depends_on_row() const {
1247 return false;
1248 }
1249
1251 return false;
1252 }
1253
1255 return false;
1256 }
1257
1259 return false;
1260 }
1261
1262private:
1263 void core(const InputValue_* input, const Index_ length, OutputValue_* const output) const {
1264 if constexpr(std::is_same<InputValue_, OutputValue_>::value) {
1265 input = output; // basically an assertion to the compiler to allow it to skip aliasing protection.
1266 }
1267 for (Index_ i = 0; i < length; ++i) {
1268 output[i] = std::atan(input[i]);
1269 }
1270 }
1271
1272public:
1273 void dense(const bool, const Index_, const Index_, const Index_ length, const InputValue_* const input, OutputValue_* const output) const {
1274 core(input, length, output);
1275 }
1276
1277 void dense(const bool, const Index_, const std::vector<Index_>& indices, const InputValue_* const input, OutputValue_* const output) const {
1278 core(input, indices.size(), output);
1279 }
1280
1281public:
1282 bool is_sparse() const {
1283 return true;
1284 }
1285
1286 void sparse(const bool, const Index_, const Index_ number, const InputValue_* const input, const Index_* const, OutputValue_* const output) const {
1287 core(input, number, output);
1288 }
1289
1290 OutputValue_ fill(const bool, const Index_) const {
1291 return 0;
1292 }
1293};
1294
1305template<typename OutputValue_, typename InputValue_, typename Index_>
1306class DelayedUnaryIsometricAtanhHelper final : public DelayedUnaryIsometricOperationHelper<OutputValue_, InputValue_, Index_> {
1307public:
1308 std::optional<Index_> nrow() const {
1309 return std::nullopt;
1310 }
1311
1312 std::optional<Index_> ncol() const {
1313 return std::nullopt;
1314 }
1315
1316public:
1317 bool zero_depends_on_row() const {
1318 return false;
1319 }
1320
1322 return false;
1323 }
1324
1326 return false;
1327 }
1328
1330 return false;
1331 }
1332
1333private:
1334 void core(const InputValue_* input, const Index_ length, OutputValue_* const output) const {
1335 if constexpr(std::is_same<InputValue_, OutputValue_>::value) {
1336 input = output; // basically an assertion to the compiler to allow it to skip aliasing protection.
1337 }
1338 for (Index_ i = 0; i < length; ++i) {
1339 output[i] = std::atanh(input[i]);
1340 }
1341 }
1342
1343public:
1344 void dense(const bool, const Index_, const Index_, const Index_ length, const InputValue_* const input, OutputValue_* const output) const {
1345 core(input, length, output);
1346 }
1347
1348 void dense(const bool, const Index_, const std::vector<Index_>& indices, const InputValue_* const input, OutputValue_* const output) const {
1349 core(input, indices.size(), output);
1350 }
1351
1352public:
1353 bool is_sparse() const {
1354 return true;
1355 }
1356
1357 void sparse(const bool, const Index_, const Index_ number, const InputValue_* const input, const Index_* const, OutputValue_* const output) const {
1358 core(input, number, output);
1359 }
1360
1361 OutputValue_ fill(const bool, const Index_) const {
1362 return 0;
1363 }
1364};
1365
1376template<typename OutputValue_, typename InputValue_, typename Index_>
1377class DelayedUnaryIsometricCosHelper final : public DelayedUnaryIsometricOperationHelper<OutputValue_, InputValue_, Index_> {
1378public:
1379 std::optional<Index_> nrow() const {
1380 return std::nullopt;
1381 }
1382
1383 std::optional<Index_> ncol() const {
1384 return std::nullopt;
1385 }
1386
1387public:
1388 bool zero_depends_on_row() const {
1389 return false;
1390 }
1391
1393 return false;
1394 }
1395
1397 return false;
1398 }
1399
1401 return false;
1402 }
1403
1404private:
1405 void core(const InputValue_* input, const Index_ length, OutputValue_* const output) const {
1406 if constexpr(std::is_same<InputValue_, OutputValue_>::value) {
1407 input = output; // basically an assertion to the compiler to allow it to skip aliasing protection.
1408 }
1409 for (Index_ i = 0; i < length; ++i) {
1410 output[i] = std::cos(input[i]);
1411 }
1412 }
1413
1414public:
1415 void dense(const bool, const Index_, const Index_, const Index_ length, const InputValue_* const input, OutputValue_* const output) const {
1416 core(input, length, output);
1417 }
1418
1419 void dense(const bool, const Index_, const std::vector<Index_>& indices, const InputValue_* const input, OutputValue_* const output) const {
1420 core(input, indices.size(), output);
1421 }
1422
1423public:
1424 bool is_sparse() const {
1425 return false;
1426 }
1427
1428 void sparse(const bool, const Index_, const Index_ number, const InputValue_* const input, const Index_* const, OutputValue_* const output) const {
1429 core(input, number, output);
1430 }
1431
1432 OutputValue_ fill(const bool, const Index_) const {
1433 return 1;
1434 }
1435};
1436
1447template<typename OutputValue_, typename InputValue_, typename Index_>
1448class DelayedUnaryIsometricCoshHelper final : public DelayedUnaryIsometricOperationHelper<OutputValue_, InputValue_, Index_> {
1449public:
1450 std::optional<Index_> nrow() const {
1451 return std::nullopt;
1452 }
1453
1454 std::optional<Index_> ncol() const {
1455 return std::nullopt;
1456 }
1457
1458public:
1459 bool zero_depends_on_row() const {
1460 return false;
1461 }
1462
1464 return false;
1465 }
1466
1468 return false;
1469 }
1470
1472 return false;
1473 }
1474
1475private:
1476 void core(const InputValue_* input, const Index_ length, OutputValue_* const output) const {
1477 if constexpr(std::is_same<InputValue_, OutputValue_>::value) {
1478 input = output; // basically an assertion to the compiler to allow it to skip aliasing protection.
1479 }
1480 for (Index_ i = 0; i < length; ++i) {
1481 output[i] = std::cosh(input[i]);
1482 }
1483 }
1484
1485public:
1486 void dense(const bool, const Index_, const Index_, const Index_ length, const InputValue_* const input, OutputValue_* const output) const {
1487 core(input, length, output);
1488 }
1489
1490 void dense(const bool, const Index_, const std::vector<Index_>& indices, const InputValue_* const input, OutputValue_* const output) const {
1491 core(input, indices.size(), output);
1492 }
1493
1494public:
1495 bool is_sparse() const {
1496 return false;
1497 }
1498
1499 void sparse(const bool, const Index_, const Index_ number, const InputValue_* const input, const Index_* const, OutputValue_* const output) const {
1500 core(input, number, output);
1501 }
1502
1503 OutputValue_ fill(const bool, const Index_) const {
1504 return 1;
1505 }
1506};
1507
1518template<typename OutputValue_, typename InputValue_, typename Index_>
1519class DelayedUnaryIsometricSinHelper final : public DelayedUnaryIsometricOperationHelper<OutputValue_, InputValue_, Index_> {
1520public:
1521 std::optional<Index_> nrow() const {
1522 return std::nullopt;
1523 }
1524
1525 std::optional<Index_> ncol() const {
1526 return std::nullopt;
1527 }
1528
1529public:
1530 bool zero_depends_on_row() const {
1531 return false;
1532 }
1533
1535 return false;
1536 }
1537
1539 return false;
1540 }
1541
1543 return false;
1544 }
1545
1546private:
1547 void core(const InputValue_* input, const Index_ length, OutputValue_* const output) const {
1548 if constexpr(std::is_same<InputValue_, OutputValue_>::value) {
1549 input = output; // basically an assertion to the compiler to allow it to skip aliasing protection.
1550 }
1551 for (Index_ i = 0; i < length; ++i) {
1552 output[i] = std::sin(input[i]);
1553 }
1554 }
1555
1556public:
1557 void dense(const bool, const Index_, const Index_, const Index_ length, const InputValue_* const input, OutputValue_* const output) const {
1558 core(input, length, output);
1559 }
1560
1561 void dense(const bool, const Index_, const std::vector<Index_>& indices, const InputValue_* const input, OutputValue_* const output) const {
1562 core(input, indices.size(), output);
1563 }
1564
1565public:
1566 bool is_sparse() const {
1567 return true;
1568 }
1569
1570 void sparse(const bool, const Index_, const Index_ number, const InputValue_* const input, const Index_* const, OutputValue_* const output) const {
1571 core(input, number, output);
1572 }
1573
1574 OutputValue_ fill(const bool, const Index_) const {
1575 return 0;
1576 }
1577};
1578
1589template<typename OutputValue_, typename InputValue_, typename Index_>
1590class DelayedUnaryIsometricSinhHelper final : public DelayedUnaryIsometricOperationHelper<OutputValue_, InputValue_, Index_> {
1591public:
1592 std::optional<Index_> nrow() const {
1593 return std::nullopt;
1594 }
1595
1596 std::optional<Index_> ncol() const {
1597 return std::nullopt;
1598 }
1599
1600public:
1601 bool zero_depends_on_row() const {
1602 return false;
1603 }
1604
1606 return false;
1607 }
1608
1610 return false;
1611 }
1612
1614 return false;
1615 }
1616
1617private:
1618 void core(const InputValue_* input, const Index_ length, OutputValue_* const output) const {
1619 if constexpr(std::is_same<InputValue_, OutputValue_>::value) {
1620 input = output; // basically an assertion to the compiler to allow it to skip aliasing protection.
1621 }
1622 for (Index_ i = 0; i < length; ++i) {
1623 output[i] = std::sinh(input[i]);
1624 }
1625 }
1626
1627public:
1628 void dense(const bool, const Index_, const Index_, const Index_ length, const InputValue_* const input, OutputValue_* const output) const {
1629 core(input, length, output);
1630 }
1631
1632 void dense(const bool, const Index_, const std::vector<Index_>& indices, const InputValue_* const input, OutputValue_* const output) const {
1633 core(input, indices.size(), output);
1634 }
1635
1636public:
1637 bool is_sparse() const {
1638 return true;
1639 }
1640
1641 void sparse(const bool, const Index_, const Index_ number, const InputValue_* const input, const Index_* const, OutputValue_* const output) const {
1642 core(input, number, output);
1643 }
1644
1645 OutputValue_ fill(const bool, const Index_) const {
1646 return 0;
1647 }
1648};
1649
1660template<typename OutputValue_, typename InputValue_, typename Index_>
1661class DelayedUnaryIsometricTanHelper final : public DelayedUnaryIsometricOperationHelper<OutputValue_, InputValue_, Index_> {
1662public:
1663 std::optional<Index_> nrow() const {
1664 return std::nullopt;
1665 }
1666
1667 std::optional<Index_> ncol() const {
1668 return std::nullopt;
1669 }
1670
1671public:
1672 bool zero_depends_on_row() const {
1673 return false;
1674 }
1675
1677 return false;
1678 }
1679
1681 return false;
1682 }
1683
1685 return false;
1686 }
1687
1688private:
1689 void core(const InputValue_* input, const Index_ length, OutputValue_* const output) const {
1690 if constexpr(std::is_same<InputValue_, OutputValue_>::value) {
1691 input = output; // basically an assertion to the compiler to allow it to skip aliasing protection.
1692 }
1693 for (Index_ i = 0; i < length; ++i) {
1694 output[i] = std::tan(input[i]);
1695 }
1696 }
1697
1698public:
1699 void dense(const bool, const Index_, const Index_, const Index_ length, const InputValue_* const input, OutputValue_* const output) const {
1700 core(input, length, output);
1701 }
1702
1703 void dense(const bool, const Index_, const std::vector<Index_>& indices, const InputValue_* const input, OutputValue_* const output) const {
1704 core(input, indices.size(), output);
1705 }
1706
1707public:
1708 bool is_sparse() const {
1709 return true;
1710 }
1711
1712 void sparse(const bool, const Index_, const Index_ number, const InputValue_* const input, const Index_* const, OutputValue_* const output) const {
1713 core(input, number, output);
1714 }
1715
1716 OutputValue_ fill(const bool, const Index_) const {
1717 return 0;
1718 }
1719};
1720
1731template<typename OutputValue_, typename InputValue_, typename Index_>
1732class DelayedUnaryIsometricTanhHelper final : public DelayedUnaryIsometricOperationHelper<OutputValue_, InputValue_, Index_> {
1733public:
1734 std::optional<Index_> nrow() const {
1735 return std::nullopt;
1736 }
1737
1738 std::optional<Index_> ncol() const {
1739 return std::nullopt;
1740 }
1741
1742public:
1743 bool zero_depends_on_row() const {
1744 return false;
1745 }
1746
1748 return false;
1749 }
1750
1752 return false;
1753 }
1754
1756 return false;
1757 }
1758
1759private:
1760 void core(const InputValue_* input, const Index_ length, OutputValue_* const output) const {
1761 if constexpr(std::is_same<InputValue_, OutputValue_>::value) {
1762 input = output; // basically an assertion to the compiler to allow it to skip aliasing protection.
1763 }
1764 for (Index_ i = 0; i < length; ++i) {
1765 output[i] = std::tanh(input[i]);
1766 }
1767 }
1768
1769public:
1770 void dense(const bool, const Index_, const Index_, const Index_ length, const InputValue_* const input, OutputValue_* const output) const {
1771 core(input, length, output);
1772 }
1773
1774 void dense(const bool, const Index_, const std::vector<Index_>& indices, const InputValue_* const input, OutputValue_* const output) const {
1775 core(input, indices.size(), output);
1776 }
1777
1778public:
1779 bool is_sparse() const {
1780 return true;
1781 }
1782
1783 void sparse(const bool, const Index_, const Index_ number, const InputValue_* const input, const Index_* const, OutputValue_* const output) const {
1784 core(input, number, output);
1785 }
1786
1787 OutputValue_ fill(const bool, const Index_) const {
1788 return 0;
1789 }
1790};
1791
1802template<typename OutputValue_, typename InputValue_, typename Index_>
1803class DelayedUnaryIsometricGammaHelper final : public DelayedUnaryIsometricOperationHelper<OutputValue_, InputValue_, Index_> {
1804public:
1805 std::optional<Index_> nrow() const {
1806 return std::nullopt;
1807 }
1808
1809 std::optional<Index_> ncol() const {
1810 return std::nullopt;
1811 }
1812
1813public:
1814 bool zero_depends_on_row() const {
1815 return false;
1816 }
1817
1819 return false;
1820 }
1821
1823 return false;
1824 }
1825
1827 return false;
1828 }
1829
1830private:
1831 void core(const InputValue_* input, const Index_ length, OutputValue_* const output) const {
1832 if constexpr(std::is_same<InputValue_, OutputValue_>::value) {
1833 input = output; // basically an assertion to the compiler to allow it to skip aliasing protection.
1834 }
1835 for (Index_ i = 0; i < length; ++i) {
1836 output[i] = std::tgamma(input[i]);
1837 }
1838 }
1839
1840public:
1841 void dense(const bool, const Index_, const Index_, const Index_ length, const InputValue_* const input, OutputValue_* const output) const {
1842 core(input, length, output);
1843 }
1844
1845 void dense(const bool, const Index_, const std::vector<Index_>& indices, const InputValue_* const input, OutputValue_* const output) const {
1846 core(input, indices.size(), output);
1847 }
1848
1849public:
1850 bool is_sparse() const {
1851 return false;
1852 }
1853
1854 void sparse(const bool, const Index_, const Index_ number, const InputValue_* const input, const Index_* const, OutputValue_* const output) const {
1855 core(input, number, output);
1856 }
1857
1858 OutputValue_ fill(const bool, const Index_) const {
1859 // Use the implementation-defined special value.
1860 return std::tgamma(static_cast<InputValue_>(0));
1861 }
1862};
1863
1874template<typename OutputValue_, typename InputValue_, typename Index_>
1875class DelayedUnaryIsometricLgammaHelper final : public DelayedUnaryIsometricOperationHelper<OutputValue_, InputValue_, Index_> {
1876public:
1877 std::optional<Index_> nrow() const {
1878 return std::nullopt;
1879 }
1880
1881 std::optional<Index_> ncol() const {
1882 return std::nullopt;
1883 }
1884
1885public:
1886 bool zero_depends_on_row() const {
1887 return false;
1888 }
1889
1891 return false;
1892 }
1893
1895 return false;
1896 }
1897
1899 return false;
1900 }
1901
1902private:
1903 void core(const InputValue_* input, const Index_ length, OutputValue_* const output) const {
1904 if constexpr(std::is_same<InputValue_, OutputValue_>::value) {
1905 input = output; // basically an assertion to the compiler to allow it to skip aliasing protection.
1906 }
1907 for (Index_ i = 0; i < length; ++i) {
1908 output[i] = std::lgamma(input[i]);
1909 }
1910 }
1911
1912public:
1913 void dense(const bool, const Index_, const Index_, const Index_ length, const InputValue_* const input, OutputValue_* const output) const {
1914 core(input, length, output);
1915 }
1916
1917 void dense(const bool, const Index_, const std::vector<Index_>& indices, const InputValue_* const input, OutputValue_* const output) const {
1918 core(input, indices.size(), output);
1919 }
1920
1921public:
1922 bool is_sparse() const {
1923 return false;
1924 }
1925
1926 void sparse(const bool, const Index_, const Index_ number, const InputValue_* const input, const Index_* const, OutputValue_* const output) const {
1927 core(input, number, output);
1928 }
1929
1930 OutputValue_ fill(const bool, const Index_) const {
1931 // Use the implementation-defined special value.
1932 return std::lgamma(static_cast<InputValue_>(0));
1933 }
1934};
1935
1939// Back-compatibility only.
1940template<typename OutputValue_ = double, typename InputValue_ = double, typename Index_ = int>
1941using DelayedUnaryIsometricAbs = DelayedUnaryIsometricAbsHelper<OutputValue_, InputValue_, Index_>;
1942
1943template<typename OutputValue_ = double, typename InputValue_ = double, typename Index_ = int>
1944using DelayedUnaryIsometricSign = DelayedUnaryIsometricSignHelper<OutputValue_, InputValue_, Index_>;
1945
1946template<typename OutputValue_ = double, typename InputValue_ = double, typename Index_ = int, typename Base_ = InputValue_>
1947using DelayedUnaryIsometricLog = DelayedUnaryIsometricCustomLogHelper<OutputValue_, InputValue_, Index_, Base_>;
1948
1949template<typename OutputValue_ = double, typename InputValue_ = double, typename Index_ = int>
1950using DelayedUnaryIsometricSqrt = DelayedUnaryIsometricSqrtHelper<OutputValue_, InputValue_, Index_>;
1951
1952template<typename OutputValue_ = double, typename InputValue_ = double, typename Index_ = int>
1953using DelayedUnaryIsometricCeiling = DelayedUnaryIsometricCeilingHelper<OutputValue_, InputValue_, Index_>;
1954
1955template<typename OutputValue_ = double, typename InputValue_ = double, typename Index_ = int>
1956using DelayedUnaryIsometricFloor = DelayedUnaryIsometricFloorHelper<OutputValue_, InputValue_, Index_>;
1957
1958template<typename OutputValue_ = double, typename InputValue_ = double, typename Index_ = int>
1959using DelayedUnaryIsometricTrunc = DelayedUnaryIsometricTruncHelper<OutputValue_, InputValue_, Index_>;
1960
1961template<typename OutputValue_ = double, typename InputValue_ = double, typename Index_ = int, typename Base_ = InputValue_>
1962using DelayedUnaryIsometricLog1p = DelayedUnaryIsometricLog1pHelper<OutputValue_, InputValue_, Index_>;
1963
1964template<typename OutputValue_ = double, typename InputValue_ = double, typename Index_ = int>
1965using DelayedUnaryIsometricRound = DelayedUnaryIsometricRoundHelper<OutputValue_, InputValue_, Index_>;
1966
1967template<typename OutputValue_ = double, typename InputValue_ = double, typename Index_ = int>
1968using DelayedUnaryIsometricExp = DelayedUnaryIsometricExpHelper<OutputValue_, InputValue_, Index_>;
1969
1970template<typename OutputValue_ = double, typename InputValue_ = double, typename Index_ = int>
1971using DelayedUnaryIsometricExpm1 = DelayedUnaryIsometricExpm1Helper<OutputValue_, InputValue_, Index_>;
1972
1973template<typename OutputValue_ = double, typename InputValue_ = double, typename Index_ = int>
1974using DelayedUnaryIsometricAcos = DelayedUnaryIsometricAcosHelper<OutputValue_, InputValue_, Index_>;
1975
1976template<typename OutputValue_ = double, typename InputValue_ = double, typename Index_ = int>
1977using DelayedUnaryIsometricAcosh = DelayedUnaryIsometricAcoshHelper<OutputValue_, InputValue_, Index_>;
1978
1979template<typename OutputValue_ = double, typename InputValue_ = double, typename Index_ = int>
1980using DelayedUnaryIsometricAsin = DelayedUnaryIsometricAsinHelper<OutputValue_, InputValue_, Index_>;
1981
1982template<typename OutputValue_ = double, typename InputValue_ = double, typename Index_ = int>
1983using DelayedUnaryIsometricAsinh = DelayedUnaryIsometricAsinhHelper<OutputValue_, InputValue_, Index_>;
1984
1985template<typename OutputValue_ = double, typename InputValue_ = double, typename Index_ = int>
1986using DelayedUnaryIsometricAtan = DelayedUnaryIsometricAtanHelper<OutputValue_, InputValue_, Index_>;
1987
1988template<typename OutputValue_ = double, typename InputValue_ = double, typename Index_ = int>
1989using DelayedUnaryIsometricAtanh = DelayedUnaryIsometricAtanhHelper<OutputValue_, InputValue_, Index_>;
1990
1991template<typename OutputValue_ = double, typename InputValue_ = double, typename Index_ = int>
1992using DelayedUnaryIsometricCos = DelayedUnaryIsometricCosHelper<OutputValue_, InputValue_, Index_>;
1993
1994template<typename OutputValue_ = double, typename InputValue_ = double, typename Index_ = int>
1995using DelayedUnaryIsometricCosh = DelayedUnaryIsometricCoshHelper<OutputValue_, InputValue_, Index_>;
1996
1997template<typename OutputValue_ = double, typename InputValue_ = double, typename Index_ = int>
1998using DelayedUnaryIsometricSin = DelayedUnaryIsometricSinHelper<OutputValue_, InputValue_, Index_>;
1999
2000template<typename OutputValue_ = double, typename InputValue_ = double, typename Index_ = int>
2001using DelayedUnaryIsometricSinh = DelayedUnaryIsometricSinhHelper<OutputValue_, InputValue_, Index_>;
2002
2003template<typename OutputValue_ = double, typename InputValue_ = double, typename Index_ = int>
2004using DelayedUnaryIsometricTan = DelayedUnaryIsometricTanHelper<OutputValue_, InputValue_, Index_>;
2005
2006template<typename OutputValue_ = double, typename InputValue_ = double, typename Index_ = int>
2007using DelayedUnaryIsometricTanh = DelayedUnaryIsometricTanhHelper<OutputValue_, InputValue_, Index_>;
2008
2009template<typename OutputValue_ = double, typename InputValue_ = double, typename Index_ = int>
2010using DelayedUnaryIsometricGamma = DelayedUnaryIsometricGammaHelper<OutputValue_, InputValue_, Index_>;
2011
2012template<typename OutputValue_ = double, typename InputValue_ = double, typename Index_ = int>
2013using DelayedUnaryIsometricLgamma = DelayedUnaryIsometricLgammaHelper<OutputValue_, InputValue_, Index_>;
2018}
2019
2020#endif
Helper for delayed calculation of the sign of each matrix entry.
Definition math_helpers.hpp:26
void dense(const bool, const Index_, const Index_, const Index_ length, const InputValue_ *const input, OutputValue_ *const output) const
Definition math_helpers.hpp:64
OutputValue_ fill(const bool, const Index_) const
Definition math_helpers.hpp:81
bool is_sparse() const
Definition math_helpers.hpp:73
std::optional< Index_ > nrow() const
Definition math_helpers.hpp:28
std::optional< Index_ > ncol() const
Definition math_helpers.hpp:32
bool non_zero_depends_on_column() const
Definition math_helpers.hpp:49
bool zero_depends_on_column() const
Definition math_helpers.hpp:41
bool non_zero_depends_on_row() const
Definition math_helpers.hpp:45
void dense(const bool, const Index_, const std::vector< Index_ > &indices, const InputValue_ *const input, OutputValue_ *const output) const
Definition math_helpers.hpp:68
void sparse(const bool, const Index_, const Index_ number, const InputValue_ *const input, const Index_ *const, OutputValue_ *const output) const
Definition math_helpers.hpp:77
bool zero_depends_on_row() const
Definition math_helpers.hpp:37
Helper for delayed calculation of the inverse cosine of each matrix entry.
Definition math_helpers.hpp:949
bool zero_depends_on_column() const
Definition math_helpers.hpp:964
void dense(const bool, const Index_, const Index_, const Index_ length, const InputValue_ *const input, OutputValue_ *const output) const
Definition math_helpers.hpp:987
bool non_zero_depends_on_row() const
Definition math_helpers.hpp:968
void sparse(const bool, const Index_, const Index_ number, const InputValue_ *const input, const Index_ *const, OutputValue_ *const output) const
Definition math_helpers.hpp:1000
void dense(const bool, const Index_, const std::vector< Index_ > &indices, const InputValue_ *const input, OutputValue_ *const output) const
Definition math_helpers.hpp:991
OutputValue_ fill(const bool, const Index_) const
Definition math_helpers.hpp:1004
bool is_sparse() const
Definition math_helpers.hpp:996
bool zero_depends_on_row() const
Definition math_helpers.hpp:960
std::optional< Index_ > nrow() const
Definition math_helpers.hpp:951
std::optional< Index_ > ncol() const
Definition math_helpers.hpp:955
bool non_zero_depends_on_column() const
Definition math_helpers.hpp:972
Helper for delayed calculation of the inverse hyperbolic cosine of each matrix entry.
Definition math_helpers.hpp:1021
void sparse(const bool, const Index_, const Index_ number, const InputValue_ *const input, const Index_ *const, OutputValue_ *const output) const
Definition math_helpers.hpp:1072
bool non_zero_depends_on_column() const
Definition math_helpers.hpp:1044
void dense(const bool, const Index_, const std::vector< Index_ > &indices, const InputValue_ *const input, OutputValue_ *const output) const
Definition math_helpers.hpp:1063
bool is_sparse() const
Definition math_helpers.hpp:1068
void dense(const bool, const Index_, const Index_, const Index_ length, const InputValue_ *const input, OutputValue_ *const output) const
Definition math_helpers.hpp:1059
bool non_zero_depends_on_row() const
Definition math_helpers.hpp:1040
std::optional< Index_ > ncol() const
Definition math_helpers.hpp:1027
OutputValue_ fill(const bool, const Index_) const
Definition math_helpers.hpp:1076
bool zero_depends_on_row() const
Definition math_helpers.hpp:1032
std::optional< Index_ > nrow() const
Definition math_helpers.hpp:1023
bool zero_depends_on_column() const
Definition math_helpers.hpp:1036
Helper for delayed calculation of the inverse sine of each matrix entry.
Definition math_helpers.hpp:1093
bool zero_depends_on_row() const
Definition math_helpers.hpp:1104
OutputValue_ fill(const bool, const Index_) const
Definition math_helpers.hpp:1148
void sparse(const bool, const Index_, const Index_ number, const InputValue_ *const input, const Index_ *const, OutputValue_ *const output) const
Definition math_helpers.hpp:1144
void dense(const bool, const Index_, const Index_, const Index_ length, const InputValue_ *const input, OutputValue_ *const output) const
Definition math_helpers.hpp:1131
void dense(const bool, const Index_, const std::vector< Index_ > &indices, const InputValue_ *const input, OutputValue_ *const output) const
Definition math_helpers.hpp:1135
bool zero_depends_on_column() const
Definition math_helpers.hpp:1108
bool non_zero_depends_on_column() const
Definition math_helpers.hpp:1116
std::optional< Index_ > ncol() const
Definition math_helpers.hpp:1099
bool is_sparse() const
Definition math_helpers.hpp:1140
std::optional< Index_ > nrow() const
Definition math_helpers.hpp:1095
bool non_zero_depends_on_row() const
Definition math_helpers.hpp:1112
Helper for delayed calculation of the inverse hyperbolic sine of each matrix entry.
Definition math_helpers.hpp:1164
OutputValue_ fill(const bool, const Index_) const
Definition math_helpers.hpp:1219
std::optional< Index_ > ncol() const
Definition math_helpers.hpp:1170
void dense(const bool, const Index_, const Index_, const Index_ length, const InputValue_ *const input, OutputValue_ *const output) const
Definition math_helpers.hpp:1202
void dense(const bool, const Index_, const std::vector< Index_ > &indices, const InputValue_ *const input, OutputValue_ *const output) const
Definition math_helpers.hpp:1206
std::optional< Index_ > nrow() const
Definition math_helpers.hpp:1166
bool non_zero_depends_on_column() const
Definition math_helpers.hpp:1187
bool is_sparse() const
Definition math_helpers.hpp:1211
void sparse(const bool, const Index_, const Index_ number, const InputValue_ *const input, const Index_ *const, OutputValue_ *const output) const
Definition math_helpers.hpp:1215
bool zero_depends_on_column() const
Definition math_helpers.hpp:1179
bool zero_depends_on_row() const
Definition math_helpers.hpp:1175
bool non_zero_depends_on_row() const
Definition math_helpers.hpp:1183
Helper for delayed calculation of the inverse tangent of each matrix entry.
Definition math_helpers.hpp:1235
bool non_zero_depends_on_column() const
Definition math_helpers.hpp:1258
bool zero_depends_on_row() const
Definition math_helpers.hpp:1246
void dense(const bool, const Index_, const Index_, const Index_ length, const InputValue_ *const input, OutputValue_ *const output) const
Definition math_helpers.hpp:1273
bool non_zero_depends_on_row() const
Definition math_helpers.hpp:1254
void dense(const bool, const Index_, const std::vector< Index_ > &indices, const InputValue_ *const input, OutputValue_ *const output) const
Definition math_helpers.hpp:1277
std::optional< Index_ > nrow() const
Definition math_helpers.hpp:1237
bool is_sparse() const
Definition math_helpers.hpp:1282
void sparse(const bool, const Index_, const Index_ number, const InputValue_ *const input, const Index_ *const, OutputValue_ *const output) const
Definition math_helpers.hpp:1286
bool zero_depends_on_column() const
Definition math_helpers.hpp:1250
std::optional< Index_ > ncol() const
Definition math_helpers.hpp:1241
OutputValue_ fill(const bool, const Index_) const
Definition math_helpers.hpp:1290
Helper for delayed calculation of the inverse hyperbolic tangent of each matrix entry.
Definition math_helpers.hpp:1306
void sparse(const bool, const Index_, const Index_ number, const InputValue_ *const input, const Index_ *const, OutputValue_ *const output) const
Definition math_helpers.hpp:1357
OutputValue_ fill(const bool, const Index_) const
Definition math_helpers.hpp:1361
bool non_zero_depends_on_column() const
Definition math_helpers.hpp:1329
bool zero_depends_on_row() const
Definition math_helpers.hpp:1317
bool is_sparse() const
Definition math_helpers.hpp:1353
void dense(const bool, const Index_, const std::vector< Index_ > &indices, const InputValue_ *const input, OutputValue_ *const output) const
Definition math_helpers.hpp:1348
bool zero_depends_on_column() const
Definition math_helpers.hpp:1321
void dense(const bool, const Index_, const Index_, const Index_ length, const InputValue_ *const input, OutputValue_ *const output) const
Definition math_helpers.hpp:1344
std::optional< Index_ > ncol() const
Definition math_helpers.hpp:1312
bool non_zero_depends_on_row() const
Definition math_helpers.hpp:1325
std::optional< Index_ > nrow() const
Definition math_helpers.hpp:1308
Helper for delayed calculation of the ceiling of each matrix entry.
Definition math_helpers.hpp:452
void dense(const bool, const Index_, const std::vector< Index_ > &indices, const InputValue_ *const input, OutputValue_ *const output) const
Definition math_helpers.hpp:494
std::optional< Index_ > nrow() const
Definition math_helpers.hpp:454
void dense(const bool, const Index_, const Index_, const Index_ length, const InputValue_ *const input, OutputValue_ *const output) const
Definition math_helpers.hpp:490
bool zero_depends_on_row() const
Definition math_helpers.hpp:463
bool non_zero_depends_on_row() const
Definition math_helpers.hpp:471
bool non_zero_depends_on_column() const
Definition math_helpers.hpp:475
bool is_sparse() const
Definition math_helpers.hpp:499
void sparse(const bool, const Index_, const Index_ number, const InputValue_ *const input, const Index_ *const, OutputValue_ *const output) const
Definition math_helpers.hpp:503
OutputValue_ fill(const bool, const Index_) const
Definition math_helpers.hpp:507
bool zero_depends_on_column() const
Definition math_helpers.hpp:467
std::optional< Index_ > ncol() const
Definition math_helpers.hpp:458
Helper for delayed calculation of the cosine of a matrix entry.
Definition math_helpers.hpp:1377
bool non_zero_depends_on_row() const
Definition math_helpers.hpp:1396
void sparse(const bool, const Index_, const Index_ number, const InputValue_ *const input, const Index_ *const, OutputValue_ *const output) const
Definition math_helpers.hpp:1428
bool zero_depends_on_row() const
Definition math_helpers.hpp:1388
bool is_sparse() const
Definition math_helpers.hpp:1424
bool non_zero_depends_on_column() const
Definition math_helpers.hpp:1400
void dense(const bool, const Index_, const std::vector< Index_ > &indices, const InputValue_ *const input, OutputValue_ *const output) const
Definition math_helpers.hpp:1419
std::optional< Index_ > ncol() const
Definition math_helpers.hpp:1383
OutputValue_ fill(const bool, const Index_) const
Definition math_helpers.hpp:1432
std::optional< Index_ > nrow() const
Definition math_helpers.hpp:1379
bool zero_depends_on_column() const
Definition math_helpers.hpp:1392
void dense(const bool, const Index_, const Index_, const Index_ length, const InputValue_ *const input, OutputValue_ *const output) const
Definition math_helpers.hpp:1415
Helper for delayed calculation of the hyperbolic cosine of each matrix entry.
Definition math_helpers.hpp:1448
bool zero_depends_on_column() const
Definition math_helpers.hpp:1463
bool is_sparse() const
Definition math_helpers.hpp:1495
OutputValue_ fill(const bool, const Index_) const
Definition math_helpers.hpp:1503
void dense(const bool, const Index_, const Index_, const Index_ length, const InputValue_ *const input, OutputValue_ *const output) const
Definition math_helpers.hpp:1486
bool zero_depends_on_row() const
Definition math_helpers.hpp:1459
bool non_zero_depends_on_row() const
Definition math_helpers.hpp:1467
std::optional< Index_ > ncol() const
Definition math_helpers.hpp:1454
void dense(const bool, const Index_, const std::vector< Index_ > &indices, const InputValue_ *const input, OutputValue_ *const output) const
Definition math_helpers.hpp:1490
std::optional< Index_ > nrow() const
Definition math_helpers.hpp:1450
bool non_zero_depends_on_column() const
Definition math_helpers.hpp:1471
void sparse(const bool, const Index_, const Index_ number, const InputValue_ *const input, const Index_ *const, OutputValue_ *const output) const
Definition math_helpers.hpp:1499
Helper for delayed calculation of a custom logarithm of each matrix entry.
Definition math_helpers.hpp:301
bool non_zero_depends_on_column() const
Definition math_helpers.hpp:330
void dense(const bool, const Index_, const std::vector< Index_ > &indices, const InputValue_ *const input, OutputValue_ *const output) const
Definition math_helpers.hpp:351
bool is_sparse() const
Definition math_helpers.hpp:356
bool non_zero_depends_on_row() const
Definition math_helpers.hpp:326
std::optional< Index_ > ncol() const
Definition math_helpers.hpp:313
void sparse(const bool, const Index_, const Index_ number, const InputValue_ *const input, const Index_ *const, OutputValue_ *const output) const
Definition math_helpers.hpp:360
bool zero_depends_on_row() const
Definition math_helpers.hpp:318
DelayedUnaryIsometricCustomLogHelper(Base_ base)
Definition math_helpers.hpp:306
void dense(const bool, const Index_, const Index_, const Index_ length, const InputValue_ *const input, OutputValue_ *const output) const
Definition math_helpers.hpp:347
OutputValue_ fill(const bool, const Index_) const
Definition math_helpers.hpp:364
std::optional< Index_ > nrow() const
Definition math_helpers.hpp:309
bool zero_depends_on_column() const
Definition math_helpers.hpp:322
Helper for delayed calculation of the exponent function for each matrix entry.
Definition math_helpers.hpp:807
std::optional< Index_ > ncol() const
Definition math_helpers.hpp:813
bool non_zero_depends_on_row() const
Definition math_helpers.hpp:826
bool zero_depends_on_row() const
Definition math_helpers.hpp:818
std::optional< Index_ > nrow() const
Definition math_helpers.hpp:809
void sparse(const bool, const Index_, const Index_ number, const InputValue_ *const input, const Index_ *const, OutputValue_ *const output) const
Definition math_helpers.hpp:858
void dense(const bool, const Index_, const std::vector< Index_ > &indices, const InputValue_ *const input, OutputValue_ *const output) const
Definition math_helpers.hpp:849
OutputValue_ fill(const bool, const Index_) const
Definition math_helpers.hpp:862
bool is_sparse() const
Definition math_helpers.hpp:854
bool zero_depends_on_column() const
Definition math_helpers.hpp:822
bool non_zero_depends_on_column() const
Definition math_helpers.hpp:830
void dense(const bool, const Index_, const Index_, const Index_ length, const InputValue_ *const input, OutputValue_ *const output) const
Definition math_helpers.hpp:845
Helper for delayed calculation of the exponential function of each matrix entry minus 1.
Definition math_helpers.hpp:878
bool zero_depends_on_row() const
Definition math_helpers.hpp:889
bool is_sparse() const
Definition math_helpers.hpp:925
std::optional< Index_ > nrow() const
Definition math_helpers.hpp:880
void sparse(const bool, const Index_, const Index_ number, const InputValue_ *const input, const Index_ *const, OutputValue_ *const output) const
Definition math_helpers.hpp:929
void dense(const bool, const Index_, const std::vector< Index_ > &indices, const InputValue_ *const input, OutputValue_ *const output) const
Definition math_helpers.hpp:920
bool non_zero_depends_on_column() const
Definition math_helpers.hpp:901
bool zero_depends_on_column() const
Definition math_helpers.hpp:893
OutputValue_ fill(const bool, const Index_) const
Definition math_helpers.hpp:933
void dense(const bool, const Index_, const Index_, const Index_ length, const InputValue_ *const input, OutputValue_ *const output) const
Definition math_helpers.hpp:916
bool non_zero_depends_on_row() const
Definition math_helpers.hpp:897
std::optional< Index_ > ncol() const
Definition math_helpers.hpp:884
Helper for delayed calculation of a logarithm of each matrix entry.
Definition math_helpers.hpp:185
std::optional< Index_ > ncol() const
Definition math_helpers.hpp:191
bool zero_depends_on_row() const
Definition math_helpers.hpp:196
bool non_zero_depends_on_column() const
Definition math_helpers.hpp:208
std::optional< Index_ > nrow() const
Definition math_helpers.hpp:187
bool is_sparse() const
Definition math_helpers.hpp:242
void dense(const bool, const Index_, const Index_, const Index_ length, const InputValue_ *const input, OutputValue_ *const output) const
Definition math_helpers.hpp:233
bool zero_depends_on_column() const
Definition math_helpers.hpp:200
void sparse(const bool, const Index_, const Index_ number, const InputValue_ *const input, const Index_ *const, OutputValue_ *const output) const
Definition math_helpers.hpp:246
void dense(const bool, const Index_, const std::vector< Index_ > &indices, const InputValue_ *const input, OutputValue_ *const output) const
Definition math_helpers.hpp:237
OutputValue_ fill(const bool, const Index_) const
Definition math_helpers.hpp:250
bool non_zero_depends_on_row() const
Definition math_helpers.hpp:204
Helper for delayed calculation of the floor of each matrix entry.
Definition math_helpers.hpp:523
std::optional< Index_ > ncol() const
Definition math_helpers.hpp:529
void sparse(const bool, const Index_, const Index_ number, const InputValue_ *const input, const Index_ *const, OutputValue_ *const output) const
Definition math_helpers.hpp:574
bool zero_depends_on_row() const
Definition math_helpers.hpp:534
void dense(const bool, const Index_, const std::vector< Index_ > &indices, const InputValue_ *const input, OutputValue_ *const output) const
Definition math_helpers.hpp:565
void dense(const bool, const Index_, const Index_, const Index_ length, const InputValue_ *const input, OutputValue_ *const output) const
Definition math_helpers.hpp:561
bool zero_depends_on_column() const
Definition math_helpers.hpp:538
bool non_zero_depends_on_column() const
Definition math_helpers.hpp:546
bool is_sparse() const
Definition math_helpers.hpp:570
OutputValue_ fill(const bool, const Index_) const
Definition math_helpers.hpp:578
bool non_zero_depends_on_row() const
Definition math_helpers.hpp:542
std::optional< Index_ > nrow() const
Definition math_helpers.hpp:525
Apply the gamma function to a matrix entry.
Definition math_helpers.hpp:1803
std::optional< Index_ > ncol() const
Definition math_helpers.hpp:1809
bool zero_depends_on_column() const
Definition math_helpers.hpp:1818
void sparse(const bool, const Index_, const Index_ number, const InputValue_ *const input, const Index_ *const, OutputValue_ *const output) const
Definition math_helpers.hpp:1854
bool non_zero_depends_on_row() const
Definition math_helpers.hpp:1822
OutputValue_ fill(const bool, const Index_) const
Definition math_helpers.hpp:1858
bool non_zero_depends_on_column() const
Definition math_helpers.hpp:1826
void dense(const bool, const Index_, const Index_, const Index_ length, const InputValue_ *const input, OutputValue_ *const output) const
Definition math_helpers.hpp:1841
bool zero_depends_on_row() const
Definition math_helpers.hpp:1814
std::optional< Index_ > nrow() const
Definition math_helpers.hpp:1805
bool is_sparse() const
Definition math_helpers.hpp:1850
void dense(const bool, const Index_, const std::vector< Index_ > &indices, const InputValue_ *const input, OutputValue_ *const output) const
Definition math_helpers.hpp:1845
Apply the log-gamma function to a matrix entry.
Definition math_helpers.hpp:1875
void dense(const bool, const Index_, const Index_, const Index_ length, const InputValue_ *const input, OutputValue_ *const output) const
Definition math_helpers.hpp:1913
std::optional< Index_ > nrow() const
Definition math_helpers.hpp:1877
void sparse(const bool, const Index_, const Index_ number, const InputValue_ *const input, const Index_ *const, OutputValue_ *const output) const
Definition math_helpers.hpp:1926
bool is_sparse() const
Definition math_helpers.hpp:1922
OutputValue_ fill(const bool, const Index_) const
Definition math_helpers.hpp:1930
std::optional< Index_ > ncol() const
Definition math_helpers.hpp:1881
void dense(const bool, const Index_, const std::vector< Index_ > &indices, const InputValue_ *const input, OutputValue_ *const output) const
Definition math_helpers.hpp:1917
bool non_zero_depends_on_column() const
Definition math_helpers.hpp:1898
bool non_zero_depends_on_row() const
Definition math_helpers.hpp:1894
bool zero_depends_on_row() const
Definition math_helpers.hpp:1886
bool zero_depends_on_column() const
Definition math_helpers.hpp:1890
Helper for the delayed calculation of the logarithm of each matrix entry plus 1.
Definition math_helpers.hpp:665
std::optional< Index_ > ncol() const
Definition math_helpers.hpp:671
void dense(const bool, const Index_, const std::vector< Index_ > &indices, const InputValue_ *const input, OutputValue_ *const output) const
Definition math_helpers.hpp:707
bool non_zero_depends_on_column() const
Definition math_helpers.hpp:688
void sparse(const bool, const Index_, const Index_ number, const InputValue_ *const input, const Index_ *const, OutputValue_ *const output) const
Definition math_helpers.hpp:716
void dense(const bool, const Index_, const Index_, const Index_ length, const InputValue_ *const input, OutputValue_ *const output) const
Definition math_helpers.hpp:703
bool zero_depends_on_column() const
Definition math_helpers.hpp:680
bool non_zero_depends_on_row() const
Definition math_helpers.hpp:684
bool is_sparse() const
Definition math_helpers.hpp:712
std::optional< Index_ > nrow() const
Definition math_helpers.hpp:667
bool zero_depends_on_row() const
Definition math_helpers.hpp:676
OutputValue_ fill(const bool, const Index_) const
Definition math_helpers.hpp:720
Helper operation interface for DelayedUnaryIsometricOperation.
Definition helper_interface.hpp:27
Helper for delayed rounding of each matrix entry to the nearest integer.
Definition math_helpers.hpp:736
std::optional< Index_ > nrow() const
Definition math_helpers.hpp:738
bool zero_depends_on_row() const
Definition math_helpers.hpp:747
std::optional< Index_ > ncol() const
Definition math_helpers.hpp:742
void dense(const bool, const Index_, const std::vector< Index_ > &indices, const InputValue_ *const input, OutputValue_ *const output) const
Definition math_helpers.hpp:778
void sparse(const bool, const Index_, const Index_ number, const InputValue_ *const input, const Index_ *const, OutputValue_ *const output) const
Definition math_helpers.hpp:787
bool non_zero_depends_on_row() const
Definition math_helpers.hpp:755
bool zero_depends_on_column() const
Definition math_helpers.hpp:751
void dense(const bool, const Index_, const Index_, const Index_ length, const InputValue_ *const input, OutputValue_ *const output) const
Definition math_helpers.hpp:774
OutputValue_ fill(const bool, const Index_) const
Definition math_helpers.hpp:791
bool is_sparse() const
Definition math_helpers.hpp:783
bool non_zero_depends_on_column() const
Definition math_helpers.hpp:759
Helper for delayed calculation of the sign of each matrix entry.
Definition math_helpers.hpp:99
std::optional< Index_ > nrow() const
Definition math_helpers.hpp:101
bool is_sparse() const
Definition math_helpers.hpp:159
bool zero_depends_on_row() const
Definition math_helpers.hpp:110
bool non_zero_depends_on_column() const
Definition math_helpers.hpp:122
bool non_zero_depends_on_row() const
Definition math_helpers.hpp:118
void dense(const bool, const Index_, const std::vector< Index_ > &indices, const InputValue_ *const input, OutputValue_ *const output) const
Definition math_helpers.hpp:154
void dense(const bool, const Index_, const Index_, const Index_ length, const InputValue_ *const input, OutputValue_ *const output) const
Definition math_helpers.hpp:150
void sparse(const bool, const Index_, const Index_ number, const InputValue_ *const input, const Index_ *const, OutputValue_ *const output) const
Definition math_helpers.hpp:163
OutputValue_ fill(const bool, const Index_) const
Definition math_helpers.hpp:167
std::optional< Index_ > ncol() const
Definition math_helpers.hpp:105
bool zero_depends_on_column() const
Definition math_helpers.hpp:114
Helper for delayed calculation of the sine of each matrix entry.
Definition math_helpers.hpp:1519
bool zero_depends_on_column() const
Definition math_helpers.hpp:1534
bool non_zero_depends_on_column() const
Definition math_helpers.hpp:1542
bool zero_depends_on_row() const
Definition math_helpers.hpp:1530
void dense(const bool, const Index_, const Index_, const Index_ length, const InputValue_ *const input, OutputValue_ *const output) const
Definition math_helpers.hpp:1557
void sparse(const bool, const Index_, const Index_ number, const InputValue_ *const input, const Index_ *const, OutputValue_ *const output) const
Definition math_helpers.hpp:1570
std::optional< Index_ > ncol() const
Definition math_helpers.hpp:1525
OutputValue_ fill(const bool, const Index_) const
Definition math_helpers.hpp:1574
std::optional< Index_ > nrow() const
Definition math_helpers.hpp:1521
void dense(const bool, const Index_, const std::vector< Index_ > &indices, const InputValue_ *const input, OutputValue_ *const output) const
Definition math_helpers.hpp:1561
bool is_sparse() const
Definition math_helpers.hpp:1566
bool non_zero_depends_on_row() const
Definition math_helpers.hpp:1538
Helper for delayed calculation of the hyperbolic sine of each matrix entry.
Definition math_helpers.hpp:1590
void sparse(const bool, const Index_, const Index_ number, const InputValue_ *const input, const Index_ *const, OutputValue_ *const output) const
Definition math_helpers.hpp:1641
bool is_sparse() const
Definition math_helpers.hpp:1637
bool zero_depends_on_column() const
Definition math_helpers.hpp:1605
bool zero_depends_on_row() const
Definition math_helpers.hpp:1601
std::optional< Index_ > nrow() const
Definition math_helpers.hpp:1592
void dense(const bool, const Index_, const std::vector< Index_ > &indices, const InputValue_ *const input, OutputValue_ *const output) const
Definition math_helpers.hpp:1632
void dense(const bool, const Index_, const Index_, const Index_ length, const InputValue_ *const input, OutputValue_ *const output) const
Definition math_helpers.hpp:1628
bool non_zero_depends_on_row() const
Definition math_helpers.hpp:1609
bool non_zero_depends_on_column() const
Definition math_helpers.hpp:1613
OutputValue_ fill(const bool, const Index_) const
Definition math_helpers.hpp:1645
std::optional< Index_ > ncol() const
Definition math_helpers.hpp:1596
Helper for delayed calculation of the square root of each matrix entry.
Definition math_helpers.hpp:381
void sparse(const bool, const Index_, const Index_ number, const InputValue_ *const input, const Index_ *const, OutputValue_ *const output) const
Definition math_helpers.hpp:432
std::optional< Index_ > ncol() const
Definition math_helpers.hpp:387
bool non_zero_depends_on_row() const
Definition math_helpers.hpp:400
std::optional< Index_ > nrow() const
Definition math_helpers.hpp:383
bool zero_depends_on_column() const
Definition math_helpers.hpp:396
bool is_sparse() const
Definition math_helpers.hpp:428
bool non_zero_depends_on_column() const
Definition math_helpers.hpp:404
OutputValue_ fill(const bool, const Index_) const
Definition math_helpers.hpp:436
void dense(const bool, const Index_, const std::vector< Index_ > &indices, const InputValue_ *const input, OutputValue_ *const output) const
Definition math_helpers.hpp:423
void dense(const bool, const Index_, const Index_, const Index_ length, const InputValue_ *const input, OutputValue_ *const output) const
Definition math_helpers.hpp:419
bool zero_depends_on_row() const
Definition math_helpers.hpp:392
Helper for delayed calculation of the tangent of each matrix entry.
Definition math_helpers.hpp:1661
bool is_sparse() const
Definition math_helpers.hpp:1708
std::optional< Index_ > ncol() const
Definition math_helpers.hpp:1667
bool zero_depends_on_row() const
Definition math_helpers.hpp:1672
bool zero_depends_on_column() const
Definition math_helpers.hpp:1676
bool non_zero_depends_on_column() const
Definition math_helpers.hpp:1684
OutputValue_ fill(const bool, const Index_) const
Definition math_helpers.hpp:1716
bool non_zero_depends_on_row() const
Definition math_helpers.hpp:1680
void dense(const bool, const Index_, const std::vector< Index_ > &indices, const InputValue_ *const input, OutputValue_ *const output) const
Definition math_helpers.hpp:1703
std::optional< Index_ > nrow() const
Definition math_helpers.hpp:1663
void dense(const bool, const Index_, const Index_, const Index_ length, const InputValue_ *const input, OutputValue_ *const output) const
Definition math_helpers.hpp:1699
void sparse(const bool, const Index_, const Index_ number, const InputValue_ *const input, const Index_ *const, OutputValue_ *const output) const
Definition math_helpers.hpp:1712
Helper for delayed calculation of the hyperbolic tangent of each matrix entry.
Definition math_helpers.hpp:1732
bool non_zero_depends_on_column() const
Definition math_helpers.hpp:1755
void dense(const bool, const Index_, const Index_, const Index_ length, const InputValue_ *const input, OutputValue_ *const output) const
Definition math_helpers.hpp:1770
void sparse(const bool, const Index_, const Index_ number, const InputValue_ *const input, const Index_ *const, OutputValue_ *const output) const
Definition math_helpers.hpp:1783
bool non_zero_depends_on_row() const
Definition math_helpers.hpp:1751
OutputValue_ fill(const bool, const Index_) const
Definition math_helpers.hpp:1787
bool zero_depends_on_column() const
Definition math_helpers.hpp:1747
std::optional< Index_ > ncol() const
Definition math_helpers.hpp:1738
std::optional< Index_ > nrow() const
Definition math_helpers.hpp:1734
void dense(const bool, const Index_, const std::vector< Index_ > &indices, const InputValue_ *const input, OutputValue_ *const output) const
Definition math_helpers.hpp:1774
bool is_sparse() const
Definition math_helpers.hpp:1779
bool zero_depends_on_row() const
Definition math_helpers.hpp:1743
Helper for delayed truncation of each matrix entry to an integer.
Definition math_helpers.hpp:594
void dense(const bool, const Index_, const Index_, const Index_ length, const InputValue_ *const input, OutputValue_ *const output) const
Definition math_helpers.hpp:632
bool zero_depends_on_row() const
Definition math_helpers.hpp:605
bool non_zero_depends_on_row() const
Definition math_helpers.hpp:613
void dense(const bool, const Index_, const std::vector< Index_ > &indices, const InputValue_ *const input, OutputValue_ *const output) const
Definition math_helpers.hpp:636
bool non_zero_depends_on_column() const
Definition math_helpers.hpp:617
std::optional< Index_ > nrow() const
Definition math_helpers.hpp:596
void sparse(const bool, const Index_, const Index_ number, const InputValue_ *const input, const Index_ *const, OutputValue_ *const output) const
Definition math_helpers.hpp:645
bool zero_depends_on_column() const
Definition math_helpers.hpp:609
std::optional< Index_ > ncol() const
Definition math_helpers.hpp:600
bool is_sparse() const
Definition math_helpers.hpp:641
OutputValue_ fill(const bool, const Index_) const
Definition math_helpers.hpp:649
Flexible representations for matrix data.
Definition Extractor.hpp:15
Interface for tatami::DelayedUnaryIsometricOperation helpers.