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, Index_ length, OutputValue_* 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(bool, Index_, Index_, Index_ length, const InputValue_* input, OutputValue_* output) const {
65 core(input, length, output);
66 }
67
68 void dense(bool, Index_, const std::vector<Index_>& indices, const InputValue_* input, OutputValue_* output) const {
69 core(input, indices.size(), output);
70 }
71
72public:
73 bool is_sparse() const {
74 return true;
75 }
76
77 void sparse(bool, Index_, Index_ number, const InputValue_* input, const Index_*, OutputValue_* output) const {
78 core(input, number, output);
79 }
80
81 OutputValue_ fill(bool, 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, Index_ length, OutputValue_* 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(bool, Index_, Index_, Index_ length, const InputValue_* input, OutputValue_* output) const {
151 core(input, length, output);
152 }
153
154 void dense(bool, Index_, const std::vector<Index_>& indices, const InputValue_* input, OutputValue_* output) const {
155 core(input, indices.size(), output);
156 }
157
158public:
159 bool is_sparse() const {
160 return true;
161 }
162
163 void sparse(bool, Index_, Index_ number, const InputValue_* input, const Index_*, OutputValue_* output) const {
164 core(input, number, output);
165 }
166
167 OutputValue_ fill(bool, Index_) const {
168 return 0;
169 }
170};
171
183template<typename OutputValue_, typename InputValue_, typename Index_, typename Base_>
184class DelayedUnaryIsometricLogHelper final : public DelayedUnaryIsometricOperationHelper<OutputValue_, InputValue_, Index_> {
185public:
190
194 DelayedUnaryIsometricLogHelper(Base_ base) : my_base(std::log(base)) {}
195
196public:
197 std::optional<Index_> nrow() const {
198 return std::nullopt;
199 }
200
201 std::optional<Index_> ncol() const {
202 return std::nullopt;
203 }
204
205public:
206 bool zero_depends_on_row() const {
207 return false;
208 }
209
211 return false;
212 }
213
215 return false;
216 }
217
219 return false;
220 }
221
222private:
223 Base_ my_base;
224
225 void core(const InputValue_* input, Index_ length, OutputValue_* output) const {
226 if constexpr(std::is_same<InputValue_, OutputValue_>::value) {
227 input = output; // basically an assertion to the compiler to allow it to skip aliasing protection.
228 }
229 for (Index_ i = 0; i < length; ++i) {
230 output[i] = std::log(input[i]) / my_base;
231 }
232 }
233
234public:
235 void dense(bool, Index_, Index_, Index_ length, const InputValue_* input, OutputValue_* output) const {
236 core(input, length, output);
237 }
238
239 void dense(bool, Index_, const std::vector<Index_>& indices, const InputValue_* input, OutputValue_* output) const {
240 core(input, indices.size(), output);
241 }
242
243public:
244 bool is_sparse() const {
245 return false;
246 }
247
248 void sparse(bool, Index_, Index_ number, const InputValue_* input, const Index_*, OutputValue_* output) const {
249 core(input, number, output);
250 }
251
252 OutputValue_ fill(bool, Index_) const {
253 // Use the implementation-defined value.
254 return std::log(static_cast<OutputValue_>(0));
255 }
256};
257
268template<typename OutputValue_, typename InputValue_, typename Index_>
269class DelayedUnaryIsometricSqrtHelper final : public DelayedUnaryIsometricOperationHelper<OutputValue_, InputValue_, Index_> {
270public:
271 std::optional<Index_> nrow() const {
272 return std::nullopt;
273 }
274
275 std::optional<Index_> ncol() const {
276 return std::nullopt;
277 }
278
279public:
280 bool zero_depends_on_row() const {
281 return false;
282 }
283
285 return false;
286 }
287
289 return false;
290 }
291
293 return false;
294 }
295
296private:
297 void core(const InputValue_* input, Index_ length, OutputValue_* output) const {
298 if constexpr(std::is_same<InputValue_, OutputValue_>::value) {
299 input = output; // basically an assertion to the compiler to allow it to skip aliasing protection.
300 }
301 for (Index_ i = 0; i < length; ++i) {
302 output[i] = std::sqrt(input[i]);
303 }
304 }
305
306public:
307 void dense(bool, Index_, Index_, Index_ length, const InputValue_* input, OutputValue_* output) const {
308 core(input, length, output);
309 }
310
311 void dense(bool, Index_, const std::vector<Index_>& indices, const InputValue_* input, OutputValue_* output) const {
312 core(input, indices.size(), output);
313 }
314
315public:
316 bool is_sparse() const {
317 return true;
318 }
319
320 void sparse(bool, Index_, Index_ number, const InputValue_* input, const Index_*, OutputValue_* output) const {
321 core(input, number, output);
322 }
323
324 OutputValue_ fill(bool, Index_) const {
325 return 0;
326 }
327};
328
339template<typename OutputValue_, typename InputValue_, typename Index_>
340class DelayedUnaryIsometricCeilingHelper final : public DelayedUnaryIsometricOperationHelper<OutputValue_, InputValue_, Index_> {
341public:
342 std::optional<Index_> nrow() const {
343 return std::nullopt;
344 }
345
346 std::optional<Index_> ncol() const {
347 return std::nullopt;
348 }
349
350public:
351 bool zero_depends_on_row() const {
352 return false;
353 }
354
356 return false;
357 }
358
360 return false;
361 }
362
364 return false;
365 }
366
367private:
368 void core(const InputValue_* input, Index_ length, OutputValue_* output) const {
369 if constexpr(std::is_same<InputValue_, OutputValue_>::value) {
370 input = output; // basically an assertion to the compiler to allow it to skip aliasing protection.
371 }
372 for (Index_ i = 0; i < length; ++i) {
373 output[i] = std::ceil(input[i]);
374 }
375 }
376
377public:
378 void dense(bool, Index_, Index_, Index_ length, const InputValue_* input, OutputValue_* output) const {
379 core(input, length, output);
380 }
381
382 void dense(bool, Index_, const std::vector<Index_>& indices, const InputValue_* input, OutputValue_* output) const {
383 core(input, indices.size(), output);
384 }
385
386public:
387 bool is_sparse() const {
388 return true;
389 }
390
391 void sparse(bool, Index_, Index_ number, const InputValue_* input, const Index_*, OutputValue_* output) const {
392 core(input, number, output);
393 }
394
395 OutputValue_ fill(bool, Index_) const {
396 return 0;
397 }
398};
399
410template<typename OutputValue_, typename InputValue_, typename Index_>
411class DelayedUnaryIsometricFloorHelper final : public DelayedUnaryIsometricOperationHelper<OutputValue_, InputValue_, Index_> {
412public:
413 std::optional<Index_> nrow() const {
414 return std::nullopt;
415 }
416
417 std::optional<Index_> ncol() const {
418 return std::nullopt;
419 }
420
421public:
422 bool zero_depends_on_row() const {
423 return false;
424 }
425
427 return false;
428 }
429
431 return false;
432 }
433
435 return false;
436 }
437
438private:
439 void core(const InputValue_* input, Index_ length, OutputValue_* output) const {
440 if constexpr(std::is_same<InputValue_, OutputValue_>::value) {
441 input = output; // basically an assertion to the compiler to allow it to skip aliasing protection.
442 }
443 for (Index_ i = 0; i < length; ++i) {
444 output[i] = std::floor(input[i]);
445 }
446 }
447
448public:
449 void dense(bool, Index_, Index_, Index_ length, const InputValue_* input, OutputValue_* output) const {
450 core(input, length, output);
451 }
452
453 void dense(bool, Index_, const std::vector<Index_>& indices, const InputValue_* input, OutputValue_* output) const {
454 core(input, indices.size(), output);
455 }
456
457public:
458 bool is_sparse() const {
459 return true;
460 }
461
462 void sparse(bool, Index_, Index_ number, const InputValue_* input, const Index_*, OutputValue_* output) const {
463 core(input, number, output);
464 }
465
466 OutputValue_ fill(bool, Index_) const {
467 return 0;
468 }
469};
470
481template<typename OutputValue_, typename InputValue_, typename Index_>
482class DelayedUnaryIsometricTruncHelper final : public DelayedUnaryIsometricOperationHelper<OutputValue_, InputValue_, Index_> {
483public:
484 std::optional<Index_> nrow() const {
485 return std::nullopt;
486 }
487
488 std::optional<Index_> ncol() const {
489 return std::nullopt;
490 }
491
492public:
493 bool zero_depends_on_row() const {
494 return false;
495 }
496
498 return false;
499 }
500
502 return false;
503 }
504
506 return false;
507 }
508
509private:
510 void core(const InputValue_* input, Index_ length, OutputValue_* output) const {
511 if constexpr(std::is_same<InputValue_, OutputValue_>::value) {
512 input = output; // basically an assertion to the compiler to allow it to skip aliasing protection.
513 }
514 for (Index_ i = 0; i < length; ++i) {
515 output[i] = std::trunc(input[i]);
516 }
517 }
518
519public:
520 void dense(bool, Index_, Index_, Index_ length, const InputValue_* input, OutputValue_* output) const {
521 core(input, length, output);
522 }
523
524 void dense(bool, Index_, const std::vector<Index_>& indices, const InputValue_* input, OutputValue_* output) const {
525 core(input, indices.size(), output);
526 }
527
528public:
529 bool is_sparse() const {
530 return true;
531 }
532
533 void sparse(bool, Index_, Index_ number, const InputValue_* input, const Index_*, OutputValue_* output) const {
534 core(input, number, output);
535 }
536
537 OutputValue_ fill(bool, Index_) const {
538 return 0;
539 }
540};
541
553template<typename OutputValue_, typename InputValue_, typename Index_, typename Base_>
554class DelayedUnaryIsometricLog1pHelper final : public DelayedUnaryIsometricOperationHelper<OutputValue_, InputValue_, Index_> {
555public:
560
564 DelayedUnaryIsometricLog1pHelper(Base_ base) : my_base(std::log(base)) {}
565
566public:
567 std::optional<Index_> nrow() const {
568 return std::nullopt;
569 }
570
571 std::optional<Index_> ncol() const {
572 return std::nullopt;
573 }
574
575public:
576 bool zero_depends_on_row() const {
577 return false;
578 }
579
581 return false;
582 }
583
585 return false;
586 }
587
589 return false;
590 }
591
592private:
593 void core(const InputValue_* input, Index_ length, OutputValue_* output) const {
594 if constexpr(std::is_same<InputValue_, OutputValue_>::value) {
595 input = output; // basically an assertion to the compiler to allow it to skip aliasing protection.
596 }
597 for (Index_ i = 0; i < length; ++i) {
598 output[i] = std::log1p(input[i]) / my_base;
599 }
600 }
601
602 Base_ my_base;
603
604public:
605 void dense(bool, Index_, Index_, Index_ length, const InputValue_* input, OutputValue_* output) const {
606 core(input, length, output);
607 }
608
609 void dense(bool, Index_, const std::vector<Index_>& indices, const InputValue_* input, OutputValue_* output) const {
610 core(input, indices.size(), output);
611 }
612
613public:
614 bool is_sparse() const {
615 return true;
616 }
617
618 void sparse(bool, Index_, Index_ number, const InputValue_* input, const Index_*, OutputValue_* output) const {
619 core(input, number, output);
620 }
621
622 OutputValue_ fill(bool, Index_) const {
623 return 0;
624 }
625};
626
637template<typename OutputValue_, typename InputValue_, typename Index_>
638class DelayedUnaryIsometricRoundHelper final : public DelayedUnaryIsometricOperationHelper<OutputValue_, InputValue_, Index_> {
639public:
640 std::optional<Index_> nrow() const {
641 return std::nullopt;
642 }
643
644 std::optional<Index_> ncol() const {
645 return std::nullopt;
646 }
647
648public:
649 bool zero_depends_on_row() const {
650 return false;
651 }
652
654 return false;
655 }
656
658 return false;
659 }
660
662 return false;
663 }
664
665private:
666 void core(const InputValue_* input, Index_ length, OutputValue_* output) const {
667 if constexpr(std::is_same<InputValue_, OutputValue_>::value) {
668 input = output; // basically an assertion to the compiler to allow it to skip aliasing protection.
669 }
670 for (Index_ i = 0; i < length; ++i) {
671 output[i] = std::round(input[i]);
672 }
673 }
674
675public:
676 void dense(bool, Index_, Index_, Index_ length, const InputValue_* input, OutputValue_* output) const {
677 core(input, length, output);
678 }
679
680 void dense(bool, Index_, const std::vector<Index_>& indices, const InputValue_* input, OutputValue_* output) const {
681 core(input, indices.size(), output);
682 }
683
684public:
685 bool is_sparse() const {
686 return true;
687 }
688
689 void sparse(bool, Index_, Index_ number, const InputValue_* input, const Index_*, OutputValue_* output) const {
690 core(input, number, output);
691 }
692
693 OutputValue_ fill(bool, Index_) const {
694 return 0;
695 }
696};
697
708template<typename OutputValue_, typename InputValue_, typename Index_>
709class DelayedUnaryIsometricExpHelper final : public DelayedUnaryIsometricOperationHelper<OutputValue_, InputValue_, Index_> {
710public:
711 std::optional<Index_> nrow() const {
712 return std::nullopt;
713 }
714
715 std::optional<Index_> ncol() const {
716 return std::nullopt;
717 }
718
719public:
720 bool zero_depends_on_row() const {
721 return false;
722 }
723
725 return false;
726 }
727
729 return false;
730 }
731
733 return false;
734 }
735
736private:
737 void core(const InputValue_* input, Index_ length, OutputValue_* output) const {
738 if constexpr(std::is_same<InputValue_, OutputValue_>::value) {
739 input = output; // basically an assertion to the compiler to allow it to skip aliasing protection.
740 }
741 for (Index_ i = 0; i < length; ++i) {
742 output[i] = std::exp(input[i]);
743 }
744 }
745
746public:
747 void dense(bool, Index_, Index_, Index_ length, const InputValue_* input, OutputValue_* output) const {
748 core(input, length, output);
749 }
750
751 void dense(bool, Index_, const std::vector<Index_>& indices, const InputValue_* input, OutputValue_* output) const {
752 core(input, indices.size(), output);
753 }
754
755public:
756 bool is_sparse() const {
757 return false;
758 }
759
760 void sparse(bool, Index_, Index_ number, const InputValue_* input, const Index_*, OutputValue_* output) const {
761 core(input, number, output);
762 }
763
764 OutputValue_ fill(bool, Index_) const {
765 return 1;
766 }
767};
768
779template<typename OutputValue_, typename InputValue_, typename Index_>
780class DelayedUnaryIsometricExpm1Helper final : public DelayedUnaryIsometricOperationHelper<OutputValue_, InputValue_, Index_> {
781public:
782 std::optional<Index_> nrow() const {
783 return std::nullopt;
784 }
785
786 std::optional<Index_> ncol() const {
787 return std::nullopt;
788 }
789
790public:
791 bool zero_depends_on_row() const {
792 return false;
793 }
794
796 return false;
797 }
798
800 return false;
801 }
802
804 return false;
805 }
806
807private:
808 void core(const InputValue_* input, Index_ length, OutputValue_* output) const {
809 if constexpr(std::is_same<InputValue_, OutputValue_>::value) {
810 input = output; // basically an assertion to the compiler to allow it to skip aliasing protection.
811 }
812 for (Index_ i = 0; i < length; ++i) {
813 output[i] = std::expm1(input[i]);
814 }
815 }
816
817public:
818 void dense(bool, Index_, Index_, Index_ length, const InputValue_* input, OutputValue_* output) const {
819 core(input, length, output);
820 }
821
822 void dense(bool, Index_, const std::vector<Index_>& indices, const InputValue_* input, OutputValue_* output) const {
823 core(input, indices.size(), output);
824 }
825
826public:
827 bool is_sparse() const {
828 return true;
829 }
830
831 void sparse(bool, Index_, Index_ number, const InputValue_* input, const Index_*, OutputValue_* output) const {
832 core(input, number, output);
833 }
834
835 OutputValue_ fill(bool, Index_) const {
836 return 0;
837 }
838};
839
850template<typename OutputValue_, typename InputValue_, typename Index_>
851class DelayedUnaryIsometricAcosHelper final : public DelayedUnaryIsometricOperationHelper<OutputValue_, InputValue_, Index_> {
852public:
853 std::optional<Index_> nrow() const {
854 return std::nullopt;
855 }
856
857 std::optional<Index_> ncol() const {
858 return std::nullopt;
859 }
860
861public:
862 bool zero_depends_on_row() const {
863 return false;
864 }
865
867 return false;
868 }
869
871 return false;
872 }
873
875 return false;
876 }
877
878private:
879 void core(const InputValue_* input, Index_ length, OutputValue_* output) const {
880 if constexpr(std::is_same<InputValue_, OutputValue_>::value) {
881 input = output; // basically an assertion to the compiler to allow it to skip aliasing protection.
882 }
883 for (Index_ i = 0; i < length; ++i) {
884 output[i] = std::acos(input[i]);
885 }
886 }
887
888public:
889 void dense(bool, Index_, Index_, Index_ length, const InputValue_* input, OutputValue_* output) const {
890 core(input, length, output);
891 }
892
893 void dense(bool, Index_, const std::vector<Index_>& indices, const InputValue_* input, OutputValue_* output) const {
894 core(input, indices.size(), output);
895 }
896
897public:
898 bool is_sparse() const {
899 return false;
900 }
901
902 void sparse(bool, Index_, Index_ number, const InputValue_* input, const Index_*, OutputValue_* output) const {
903 core(input, number, output);
904 }
905
906 OutputValue_ fill(bool, Index_) const {
907 // Use the implementation-defined special value.
908 return std::acos(0);
909 }
910};
911
922template<typename OutputValue_, typename InputValue_, typename Index_>
923class DelayedUnaryIsometricAcoshHelper final : public DelayedUnaryIsometricOperationHelper<OutputValue_, InputValue_, Index_> {
924public:
925 std::optional<Index_> nrow() const {
926 return std::nullopt;
927 }
928
929 std::optional<Index_> ncol() const {
930 return std::nullopt;
931 }
932
933public:
934 bool zero_depends_on_row() const {
935 return false;
936 }
937
939 return false;
940 }
941
943 return false;
944 }
945
947 return false;
948 }
949
950private:
951 void core(const InputValue_* input, Index_ length, OutputValue_* output) const {
952 if constexpr(std::is_same<InputValue_, OutputValue_>::value) {
953 input = output; // basically an assertion to the compiler to allow it to skip aliasing protection.
954 }
955 for (Index_ i = 0; i < length; ++i) {
956 output[i] = std::acosh(input[i]);
957 }
958 }
959
960public:
961 void dense(bool, Index_, Index_, Index_ length, const InputValue_* input, OutputValue_* output) const {
962 core(input, length, output);
963 }
964
965 void dense(bool, Index_, const std::vector<Index_>& indices, const InputValue_* input, OutputValue_* output) const {
966 core(input, indices.size(), output);
967 }
968
969public:
970 bool is_sparse() const {
971 return false;
972 }
973
974 void sparse(bool, Index_, Index_ number, const InputValue_* input, const Index_*, OutputValue_* output) const {
975 core(input, number, output);
976 }
977
978 OutputValue_ fill(bool, Index_) const {
979 // Use the implementation-defined special value.
980 return std::acosh(static_cast<InputValue_>(0));
981 }
982};
983
994template<typename OutputValue_, typename InputValue_, typename Index_>
995class DelayedUnaryIsometricAsinHelper final : public DelayedUnaryIsometricOperationHelper<OutputValue_, InputValue_, Index_> {
996public:
997 std::optional<Index_> nrow() const {
998 return std::nullopt;
999 }
1000
1001 std::optional<Index_> ncol() const {
1002 return std::nullopt;
1003 }
1004
1005public:
1006 bool zero_depends_on_row() const {
1007 return false;
1008 }
1009
1011 return false;
1012 }
1013
1015 return false;
1016 }
1017
1019 return false;
1020 }
1021
1022private:
1023 void core(const InputValue_* input, Index_ length, OutputValue_* output) const {
1024 if constexpr(std::is_same<InputValue_, OutputValue_>::value) {
1025 input = output; // basically an assertion to the compiler to allow it to skip aliasing protection.
1026 }
1027 for (Index_ i = 0; i < length; ++i) {
1028 output[i] = std::asin(input[i]);
1029 }
1030 }
1031
1032public:
1033 void dense(bool, Index_, Index_, Index_ length, const InputValue_* input, OutputValue_* output) const {
1034 core(input, length, output);
1035 }
1036
1037 void dense(bool, Index_, const std::vector<Index_>& indices, const InputValue_* input, OutputValue_* output) const {
1038 core(input, indices.size(), output);
1039 }
1040
1041public:
1042 bool is_sparse() const {
1043 return true;
1044 }
1045
1046 void sparse(bool, Index_, Index_ number, const InputValue_* input, const Index_*, OutputValue_* output) const {
1047 core(input, number, output);
1048 }
1049
1050 OutputValue_ fill(bool, Index_) const {
1051 return 0;
1052 }
1053};
1054
1065template<typename OutputValue_, typename InputValue_, typename Index_>
1066class DelayedUnaryIsometricAsinhHelper final : public DelayedUnaryIsometricOperationHelper<OutputValue_, InputValue_, Index_> {
1067public:
1068 std::optional<Index_> nrow() const {
1069 return std::nullopt;
1070 }
1071
1072 std::optional<Index_> ncol() const {
1073 return std::nullopt;
1074 }
1075
1076public:
1077 bool zero_depends_on_row() const {
1078 return false;
1079 }
1080
1082 return false;
1083 }
1084
1086 return false;
1087 }
1088
1090 return false;
1091 }
1092
1093private:
1094 void core(const InputValue_* input, Index_ length, OutputValue_* output) const {
1095 if constexpr(std::is_same<InputValue_, OutputValue_>::value) {
1096 input = output; // basically an assertion to the compiler to allow it to skip aliasing protection.
1097 }
1098 for (Index_ i = 0; i < length; ++i) {
1099 output[i] = std::asinh(input[i]);
1100 }
1101 }
1102
1103public:
1104 void dense(bool, Index_, Index_, Index_ length, const InputValue_* input, OutputValue_* output) const {
1105 core(input, length, output);
1106 }
1107
1108 void dense(bool, Index_, const std::vector<Index_>& indices, const InputValue_* input, OutputValue_* output) const {
1109 core(input, indices.size(), output);
1110 }
1111
1112public:
1113 bool is_sparse() const {
1114 return true;
1115 }
1116
1117 void sparse(bool, Index_, Index_ number, const InputValue_* input, const Index_*, OutputValue_* output) const {
1118 core(input, number, output);
1119 }
1120
1121 OutputValue_ fill(bool, Index_) const {
1122 return 0;
1123 }
1124};
1125
1136template<typename OutputValue_, typename InputValue_, typename Index_>
1137class DelayedUnaryIsometricAtanHelper final : public DelayedUnaryIsometricOperationHelper<OutputValue_, InputValue_, Index_> {
1138public:
1139 std::optional<Index_> nrow() const {
1140 return std::nullopt;
1141 }
1142
1143 std::optional<Index_> ncol() const {
1144 return std::nullopt;
1145 }
1146
1147public:
1148 bool zero_depends_on_row() const {
1149 return false;
1150 }
1151
1153 return false;
1154 }
1155
1157 return false;
1158 }
1159
1161 return false;
1162 }
1163
1164private:
1165 void core(const InputValue_* input, Index_ length, OutputValue_* output) const {
1166 if constexpr(std::is_same<InputValue_, OutputValue_>::value) {
1167 input = output; // basically an assertion to the compiler to allow it to skip aliasing protection.
1168 }
1169 for (Index_ i = 0; i < length; ++i) {
1170 output[i] = std::atan(input[i]);
1171 }
1172 }
1173
1174public:
1175 void dense(bool, Index_, Index_, Index_ length, const InputValue_* input, OutputValue_* output) const {
1176 core(input, length, output);
1177 }
1178
1179 void dense(bool, Index_, const std::vector<Index_>& indices, const InputValue_* input, OutputValue_* output) const {
1180 core(input, indices.size(), output);
1181 }
1182
1183public:
1184 bool is_sparse() const {
1185 return true;
1186 }
1187
1188 void sparse(bool, Index_, Index_ number, const InputValue_* input, const Index_*, OutputValue_* output) const {
1189 core(input, number, output);
1190 }
1191
1192 OutputValue_ fill(bool, Index_) const {
1193 return 0;
1194 }
1195};
1196
1207template<typename OutputValue_, typename InputValue_, typename Index_>
1208class DelayedUnaryIsometricAtanhHelper final : public DelayedUnaryIsometricOperationHelper<OutputValue_, InputValue_, Index_> {
1209public:
1210 std::optional<Index_> nrow() const {
1211 return std::nullopt;
1212 }
1213
1214 std::optional<Index_> ncol() const {
1215 return std::nullopt;
1216 }
1217
1218public:
1219 bool zero_depends_on_row() const {
1220 return false;
1221 }
1222
1224 return false;
1225 }
1226
1228 return false;
1229 }
1230
1232 return false;
1233 }
1234
1235private:
1236 void core(const InputValue_* input, Index_ length, OutputValue_* output) const {
1237 if constexpr(std::is_same<InputValue_, OutputValue_>::value) {
1238 input = output; // basically an assertion to the compiler to allow it to skip aliasing protection.
1239 }
1240 for (Index_ i = 0; i < length; ++i) {
1241 output[i] = std::atanh(input[i]);
1242 }
1243 }
1244
1245public:
1246 void dense(bool, Index_, Index_, Index_ length, const InputValue_* input, OutputValue_* output) const {
1247 core(input, length, output);
1248 }
1249
1250 void dense(bool, Index_, const std::vector<Index_>& indices, const InputValue_* input, OutputValue_* output) const {
1251 core(input, indices.size(), output);
1252 }
1253
1254public:
1255 bool is_sparse() const {
1256 return true;
1257 }
1258
1259 void sparse(bool, Index_, Index_ number, const InputValue_* input, const Index_*, OutputValue_* output) const {
1260 core(input, number, output);
1261 }
1262
1263 OutputValue_ fill(bool, Index_) const {
1264 return 0;
1265 }
1266};
1267
1278template<typename OutputValue_, typename InputValue_, typename Index_>
1279class DelayedUnaryIsometricCosHelper final : public DelayedUnaryIsometricOperationHelper<OutputValue_, InputValue_, Index_> {
1280public:
1281 std::optional<Index_> nrow() const {
1282 return std::nullopt;
1283 }
1284
1285 std::optional<Index_> ncol() const {
1286 return std::nullopt;
1287 }
1288
1289public:
1290 bool zero_depends_on_row() const {
1291 return false;
1292 }
1293
1295 return false;
1296 }
1297
1299 return false;
1300 }
1301
1303 return false;
1304 }
1305
1306private:
1307 void core(const InputValue_* input, Index_ length, OutputValue_* output) const {
1308 if constexpr(std::is_same<InputValue_, OutputValue_>::value) {
1309 input = output; // basically an assertion to the compiler to allow it to skip aliasing protection.
1310 }
1311 for (Index_ i = 0; i < length; ++i) {
1312 output[i] = std::cos(input[i]);
1313 }
1314 }
1315
1316public:
1317 void dense(bool, Index_, Index_, Index_ length, const InputValue_* input, OutputValue_* output) const {
1318 core(input, length, output);
1319 }
1320
1321 void dense(bool, Index_, const std::vector<Index_>& indices, const InputValue_* input, OutputValue_* output) const {
1322 core(input, indices.size(), output);
1323 }
1324
1325public:
1326 bool is_sparse() const {
1327 return false;
1328 }
1329
1330 void sparse(bool, Index_, Index_ number, const InputValue_* input, const Index_*, OutputValue_* output) const {
1331 core(input, number, output);
1332 }
1333
1334 OutputValue_ fill(bool, Index_) const {
1335 return 1;
1336 }
1337};
1338
1349template<typename OutputValue_, typename InputValue_, typename Index_>
1350class DelayedUnaryIsometricCoshHelper final : public DelayedUnaryIsometricOperationHelper<OutputValue_, InputValue_, Index_> {
1351public:
1352 std::optional<Index_> nrow() const {
1353 return std::nullopt;
1354 }
1355
1356 std::optional<Index_> ncol() const {
1357 return std::nullopt;
1358 }
1359
1360public:
1361 bool zero_depends_on_row() const {
1362 return false;
1363 }
1364
1366 return false;
1367 }
1368
1370 return false;
1371 }
1372
1374 return false;
1375 }
1376
1377private:
1378 void core(const InputValue_* input, Index_ length, OutputValue_* output) const {
1379 if constexpr(std::is_same<InputValue_, OutputValue_>::value) {
1380 input = output; // basically an assertion to the compiler to allow it to skip aliasing protection.
1381 }
1382 for (Index_ i = 0; i < length; ++i) {
1383 output[i] = std::cosh(input[i]);
1384 }
1385 }
1386
1387public:
1388 void dense(bool, Index_, Index_, Index_ length, const InputValue_* input, OutputValue_* output) const {
1389 core(input, length, output);
1390 }
1391
1392 void dense(bool, Index_, const std::vector<Index_>& indices, const InputValue_* input, OutputValue_* output) const {
1393 core(input, indices.size(), output);
1394 }
1395
1396public:
1397 bool is_sparse() const {
1398 return false;
1399 }
1400
1401 void sparse(bool, Index_, Index_ number, const InputValue_* input, const Index_*, OutputValue_* output) const {
1402 core(input, number, output);
1403 }
1404
1405 OutputValue_ fill(bool, Index_) const {
1406 return 1;
1407 }
1408};
1409
1420template<typename OutputValue_, typename InputValue_, typename Index_>
1421class DelayedUnaryIsometricSinHelper final : public DelayedUnaryIsometricOperationHelper<OutputValue_, InputValue_, Index_> {
1422public:
1423 std::optional<Index_> nrow() const {
1424 return std::nullopt;
1425 }
1426
1427 std::optional<Index_> ncol() const {
1428 return std::nullopt;
1429 }
1430
1431public:
1432 bool zero_depends_on_row() const {
1433 return false;
1434 }
1435
1437 return false;
1438 }
1439
1441 return false;
1442 }
1443
1445 return false;
1446 }
1447
1448private:
1449 void core(const InputValue_* input, Index_ length, OutputValue_* output) const {
1450 if constexpr(std::is_same<InputValue_, OutputValue_>::value) {
1451 input = output; // basically an assertion to the compiler to allow it to skip aliasing protection.
1452 }
1453 for (Index_ i = 0; i < length; ++i) {
1454 output[i] = std::sin(input[i]);
1455 }
1456 }
1457
1458public:
1459 void dense(bool, Index_, Index_, Index_ length, const InputValue_* input, OutputValue_* output) const {
1460 core(input, length, output);
1461 }
1462
1463 void dense(bool, Index_, const std::vector<Index_>& indices, const InputValue_* input, OutputValue_* output) const {
1464 core(input, indices.size(), output);
1465 }
1466
1467public:
1468 bool is_sparse() const {
1469 return true;
1470 }
1471
1472 void sparse(bool, Index_, Index_ number, const InputValue_* input, const Index_*, OutputValue_* output) const {
1473 core(input, number, output);
1474 }
1475
1476 OutputValue_ fill(bool, Index_) const {
1477 return 0;
1478 }
1479};
1480
1491template<typename OutputValue_, typename InputValue_, typename Index_>
1492class DelayedUnaryIsometricSinhHelper final : public DelayedUnaryIsometricOperationHelper<OutputValue_, InputValue_, Index_> {
1493public:
1494 std::optional<Index_> nrow() const {
1495 return std::nullopt;
1496 }
1497
1498 std::optional<Index_> ncol() const {
1499 return std::nullopt;
1500 }
1501
1502public:
1503 bool zero_depends_on_row() const {
1504 return false;
1505 }
1506
1508 return false;
1509 }
1510
1512 return false;
1513 }
1514
1516 return false;
1517 }
1518
1519private:
1520 void core(const InputValue_* input, Index_ length, OutputValue_* output) const {
1521 if constexpr(std::is_same<InputValue_, OutputValue_>::value) {
1522 input = output; // basically an assertion to the compiler to allow it to skip aliasing protection.
1523 }
1524 for (Index_ i = 0; i < length; ++i) {
1525 output[i] = std::sinh(input[i]);
1526 }
1527 }
1528
1529public:
1530 void dense(bool, Index_, Index_, Index_ length, const InputValue_* input, OutputValue_* output) const {
1531 core(input, length, output);
1532 }
1533
1534 void dense(bool, Index_, const std::vector<Index_>& indices, const InputValue_* input, OutputValue_* output) const {
1535 core(input, indices.size(), output);
1536 }
1537
1538public:
1539 bool is_sparse() const {
1540 return true;
1541 }
1542
1543 void sparse(bool, Index_, Index_ number, const InputValue_* input, const Index_*, OutputValue_* output) const {
1544 core(input, number, output);
1545 }
1546
1547 OutputValue_ fill(bool, Index_) const {
1548 return 0;
1549 }
1550};
1551
1562template<typename OutputValue_, typename InputValue_, typename Index_>
1563class DelayedUnaryIsometricTanHelper final : public DelayedUnaryIsometricOperationHelper<OutputValue_, InputValue_, Index_> {
1564public:
1565 std::optional<Index_> nrow() const {
1566 return std::nullopt;
1567 }
1568
1569 std::optional<Index_> ncol() const {
1570 return std::nullopt;
1571 }
1572
1573public:
1574 bool zero_depends_on_row() const {
1575 return false;
1576 }
1577
1579 return false;
1580 }
1581
1583 return false;
1584 }
1585
1587 return false;
1588 }
1589
1590private:
1591 void core(const InputValue_* input, Index_ length, OutputValue_* output) const {
1592 if constexpr(std::is_same<InputValue_, OutputValue_>::value) {
1593 input = output; // basically an assertion to the compiler to allow it to skip aliasing protection.
1594 }
1595 for (Index_ i = 0; i < length; ++i) {
1596 output[i] = std::tan(input[i]);
1597 }
1598 }
1599
1600public:
1601 void dense(bool, Index_, Index_, Index_ length, const InputValue_* input, OutputValue_* output) const {
1602 core(input, length, output);
1603 }
1604
1605 void dense(bool, Index_, const std::vector<Index_>& indices, const InputValue_* input, OutputValue_* output) const {
1606 core(input, indices.size(), output);
1607 }
1608
1609public:
1610 bool is_sparse() const {
1611 return true;
1612 }
1613
1614 void sparse(bool, Index_, Index_ number, const InputValue_* input, const Index_*, OutputValue_* output) const {
1615 core(input, number, output);
1616 }
1617
1618 OutputValue_ fill(bool, Index_) const {
1619 return 0;
1620 }
1621};
1622
1633template<typename OutputValue_, typename InputValue_, typename Index_>
1634class DelayedUnaryIsometricTanhHelper final : public DelayedUnaryIsometricOperationHelper<OutputValue_, InputValue_, Index_> {
1635public:
1636 std::optional<Index_> nrow() const {
1637 return std::nullopt;
1638 }
1639
1640 std::optional<Index_> ncol() const {
1641 return std::nullopt;
1642 }
1643
1644public:
1645 bool zero_depends_on_row() const {
1646 return false;
1647 }
1648
1650 return false;
1651 }
1652
1654 return false;
1655 }
1656
1658 return false;
1659 }
1660
1661private:
1662 void core(const InputValue_* input, Index_ length, OutputValue_* output) const {
1663 if constexpr(std::is_same<InputValue_, OutputValue_>::value) {
1664 input = output; // basically an assertion to the compiler to allow it to skip aliasing protection.
1665 }
1666 for (Index_ i = 0; i < length; ++i) {
1667 output[i] = std::tanh(input[i]);
1668 }
1669 }
1670
1671public:
1672 void dense(bool, Index_, Index_, Index_ length, const InputValue_* input, OutputValue_* output) const {
1673 core(input, length, output);
1674 }
1675
1676 void dense(bool, Index_, const std::vector<Index_>& indices, const InputValue_* input, OutputValue_* output) const {
1677 core(input, indices.size(), output);
1678 }
1679
1680public:
1681 bool is_sparse() const {
1682 return true;
1683 }
1684
1685 void sparse(bool, Index_, Index_ number, const InputValue_* input, const Index_*, OutputValue_* output) const {
1686 core(input, number, output);
1687 }
1688
1689 OutputValue_ fill(bool, Index_) const {
1690 return 0;
1691 }
1692};
1693
1704template<typename OutputValue_, typename InputValue_, typename Index_>
1705class DelayedUnaryIsometricGammaHelper final : public DelayedUnaryIsometricOperationHelper<OutputValue_, InputValue_, Index_> {
1706public:
1707 std::optional<Index_> nrow() const {
1708 return std::nullopt;
1709 }
1710
1711 std::optional<Index_> ncol() const {
1712 return std::nullopt;
1713 }
1714
1715public:
1716 bool zero_depends_on_row() const {
1717 return false;
1718 }
1719
1721 return false;
1722 }
1723
1725 return false;
1726 }
1727
1729 return false;
1730 }
1731
1732private:
1733 void core(const InputValue_* input, Index_ length, OutputValue_* output) const {
1734 if constexpr(std::is_same<InputValue_, OutputValue_>::value) {
1735 input = output; // basically an assertion to the compiler to allow it to skip aliasing protection.
1736 }
1737 for (Index_ i = 0; i < length; ++i) {
1738 output[i] = std::tgamma(input[i]);
1739 }
1740 }
1741
1742public:
1743 void dense(bool, Index_, Index_, Index_ length, const InputValue_* input, OutputValue_* output) const {
1744 core(input, length, output);
1745 }
1746
1747 void dense(bool, Index_, const std::vector<Index_>& indices, const InputValue_* input, OutputValue_* output) const {
1748 core(input, indices.size(), output);
1749 }
1750
1751public:
1752 bool is_sparse() const {
1753 return false;
1754 }
1755
1756 void sparse(bool, Index_, Index_ number, const InputValue_* input, const Index_*, OutputValue_* output) const {
1757 core(input, number, output);
1758 }
1759
1760 OutputValue_ fill(bool, Index_) const {
1761 // Use the implementation-defined special value.
1762 return std::tgamma(static_cast<InputValue_>(0));
1763 }
1764};
1765
1776template<typename OutputValue_, typename InputValue_, typename Index_>
1777class DelayedUnaryIsometricLgammaHelper final : public DelayedUnaryIsometricOperationHelper<OutputValue_, InputValue_, Index_> {
1778public:
1779 std::optional<Index_> nrow() const {
1780 return std::nullopt;
1781 }
1782
1783 std::optional<Index_> ncol() const {
1784 return std::nullopt;
1785 }
1786
1787public:
1788 bool zero_depends_on_row() const {
1789 return false;
1790 }
1791
1793 return false;
1794 }
1795
1797 return false;
1798 }
1799
1801 return false;
1802 }
1803
1804private:
1805 void core(const InputValue_* input, Index_ length, OutputValue_* output) const {
1806 if constexpr(std::is_same<InputValue_, OutputValue_>::value) {
1807 input = output; // basically an assertion to the compiler to allow it to skip aliasing protection.
1808 }
1809 for (Index_ i = 0; i < length; ++i) {
1810 output[i] = std::lgamma(input[i]);
1811 }
1812 }
1813
1814public:
1815 void dense(bool, Index_, Index_, Index_ length, const InputValue_* input, OutputValue_* output) const {
1816 core(input, length, output);
1817 }
1818
1819 void dense(bool, Index_, const std::vector<Index_>& indices, const InputValue_* input, OutputValue_* output) const {
1820 core(input, indices.size(), output);
1821 }
1822
1823public:
1824 bool is_sparse() const {
1825 return false;
1826 }
1827
1828 void sparse(bool, Index_, Index_ number, const InputValue_* input, const Index_*, OutputValue_* output) const {
1829 core(input, number, output);
1830 }
1831
1832 OutputValue_ fill(bool, Index_) const {
1833 // Use the implementation-defined special value.
1834 return std::lgamma(static_cast<InputValue_>(0));
1835 }
1836};
1837
1841// Back-compatibility only.
1842template<typename OutputValue_ = double, typename InputValue_ = double, typename Index_ = int>
1843using DelayedUnaryIsometricAbs = DelayedUnaryIsometricAbsHelper<OutputValue_, InputValue_, Index_>;
1844
1845template<typename OutputValue_ = double, typename InputValue_ = double, typename Index_ = int>
1846using DelayedUnaryIsometricSign = DelayedUnaryIsometricSignHelper<OutputValue_, InputValue_, Index_>;
1847
1848template<typename OutputValue_ = double, typename InputValue_ = double, typename Index_ = int, typename Base_ = InputValue_>
1849using DelayedUnaryIsometricLog = DelayedUnaryIsometricLogHelper<OutputValue_, InputValue_, Index_, Base_>;
1850
1851template<typename OutputValue_ = double, typename InputValue_ = double, typename Index_ = int>
1852using DelayedUnaryIsometricSqrt = DelayedUnaryIsometricSqrtHelper<OutputValue_, InputValue_, Index_>;
1853
1854template<typename OutputValue_ = double, typename InputValue_ = double, typename Index_ = int>
1855using DelayedUnaryIsometricCeiling = DelayedUnaryIsometricCeilingHelper<OutputValue_, InputValue_, Index_>;
1856
1857template<typename OutputValue_ = double, typename InputValue_ = double, typename Index_ = int>
1858using DelayedUnaryIsometricFloor = DelayedUnaryIsometricFloorHelper<OutputValue_, InputValue_, Index_>;
1859
1860template<typename OutputValue_ = double, typename InputValue_ = double, typename Index_ = int>
1861using DelayedUnaryIsometricTrunc = DelayedUnaryIsometricTruncHelper<OutputValue_, InputValue_, Index_>;
1862
1863template<typename OutputValue_ = double, typename InputValue_ = double, typename Index_ = int, typename Base_ = InputValue_>
1864using DelayedUnaryIsometricLog1p = DelayedUnaryIsometricLog1pHelper<OutputValue_, InputValue_, Index_, Base_>;
1865
1866template<typename OutputValue_ = double, typename InputValue_ = double, typename Index_ = int>
1867using DelayedUnaryIsometricRound = DelayedUnaryIsometricRoundHelper<OutputValue_, InputValue_, Index_>;
1868
1869template<typename OutputValue_ = double, typename InputValue_ = double, typename Index_ = int>
1870using DelayedUnaryIsometricExp = DelayedUnaryIsometricExpHelper<OutputValue_, InputValue_, Index_>;
1871
1872template<typename OutputValue_ = double, typename InputValue_ = double, typename Index_ = int>
1873using DelayedUnaryIsometricExpm1 = DelayedUnaryIsometricExpm1Helper<OutputValue_, InputValue_, Index_>;
1874
1875template<typename OutputValue_ = double, typename InputValue_ = double, typename Index_ = int>
1876using DelayedUnaryIsometricAcos = DelayedUnaryIsometricAcosHelper<OutputValue_, InputValue_, Index_>;
1877
1878template<typename OutputValue_ = double, typename InputValue_ = double, typename Index_ = int>
1879using DelayedUnaryIsometricAcosh = DelayedUnaryIsometricAcoshHelper<OutputValue_, InputValue_, Index_>;
1880
1881template<typename OutputValue_ = double, typename InputValue_ = double, typename Index_ = int>
1882using DelayedUnaryIsometricAsin = DelayedUnaryIsometricAsinHelper<OutputValue_, InputValue_, Index_>;
1883
1884template<typename OutputValue_ = double, typename InputValue_ = double, typename Index_ = int>
1885using DelayedUnaryIsometricAsinh = DelayedUnaryIsometricAsinhHelper<OutputValue_, InputValue_, Index_>;
1886
1887template<typename OutputValue_ = double, typename InputValue_ = double, typename Index_ = int>
1888using DelayedUnaryIsometricAtan = DelayedUnaryIsometricAtanHelper<OutputValue_, InputValue_, Index_>;
1889
1890template<typename OutputValue_ = double, typename InputValue_ = double, typename Index_ = int>
1891using DelayedUnaryIsometricAtanh = DelayedUnaryIsometricAtanhHelper<OutputValue_, InputValue_, Index_>;
1892
1893template<typename OutputValue_ = double, typename InputValue_ = double, typename Index_ = int>
1894using DelayedUnaryIsometricCos = DelayedUnaryIsometricCosHelper<OutputValue_, InputValue_, Index_>;
1895
1896template<typename OutputValue_ = double, typename InputValue_ = double, typename Index_ = int>
1897using DelayedUnaryIsometricCosh = DelayedUnaryIsometricCoshHelper<OutputValue_, InputValue_, Index_>;
1898
1899template<typename OutputValue_ = double, typename InputValue_ = double, typename Index_ = int>
1900using DelayedUnaryIsometricSin = DelayedUnaryIsometricSinHelper<OutputValue_, InputValue_, Index_>;
1901
1902template<typename OutputValue_ = double, typename InputValue_ = double, typename Index_ = int>
1903using DelayedUnaryIsometricSinh = DelayedUnaryIsometricSinhHelper<OutputValue_, InputValue_, Index_>;
1904
1905template<typename OutputValue_ = double, typename InputValue_ = double, typename Index_ = int>
1906using DelayedUnaryIsometricTan = DelayedUnaryIsometricTanHelper<OutputValue_, InputValue_, Index_>;
1907
1908template<typename OutputValue_ = double, typename InputValue_ = double, typename Index_ = int>
1909using DelayedUnaryIsometricTanh = DelayedUnaryIsometricTanhHelper<OutputValue_, InputValue_, Index_>;
1910
1911template<typename OutputValue_ = double, typename InputValue_ = double, typename Index_ = int>
1912using DelayedUnaryIsometricGamma = DelayedUnaryIsometricGammaHelper<OutputValue_, InputValue_, Index_>;
1913
1914template<typename OutputValue_ = double, typename InputValue_ = double, typename Index_ = int>
1915using DelayedUnaryIsometricLgamma = DelayedUnaryIsometricLgammaHelper<OutputValue_, InputValue_, Index_>;
1920}
1921
1922#endif
Helper for delayed calculation of the sign of each matrix entry.
Definition math_helpers.hpp:26
bool is_sparse() const
Definition math_helpers.hpp:73
void dense(bool, Index_, Index_, Index_ length, const InputValue_ *input, OutputValue_ *output) const
Definition math_helpers.hpp:64
OutputValue_ fill(bool, Index_) const
Definition math_helpers.hpp:81
std::optional< Index_ > nrow() const
Definition math_helpers.hpp:28
std::optional< Index_ > ncol() const
Definition math_helpers.hpp:32
void sparse(bool, Index_, Index_ number, const InputValue_ *input, const Index_ *, OutputValue_ *output) const
Definition math_helpers.hpp:77
void dense(bool, Index_, const std::vector< Index_ > &indices, const InputValue_ *input, OutputValue_ *output) const
Definition math_helpers.hpp:68
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
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:851
bool zero_depends_on_column() const
Definition math_helpers.hpp:866
void dense(bool, Index_, Index_, Index_ length, const InputValue_ *input, OutputValue_ *output) const
Definition math_helpers.hpp:889
bool non_zero_depends_on_row() const
Definition math_helpers.hpp:870
OutputValue_ fill(bool, Index_) const
Definition math_helpers.hpp:906
bool is_sparse() const
Definition math_helpers.hpp:898
bool zero_depends_on_row() const
Definition math_helpers.hpp:862
std::optional< Index_ > nrow() const
Definition math_helpers.hpp:853
void dense(bool, Index_, const std::vector< Index_ > &indices, const InputValue_ *input, OutputValue_ *output) const
Definition math_helpers.hpp:893
std::optional< Index_ > ncol() const
Definition math_helpers.hpp:857
bool non_zero_depends_on_column() const
Definition math_helpers.hpp:874
void sparse(bool, Index_, Index_ number, const InputValue_ *input, const Index_ *, OutputValue_ *output) const
Definition math_helpers.hpp:902
Helper for delayed calculation of the inverse hyperbolic cosine of each matrix entry.
Definition math_helpers.hpp:923
void sparse(bool, Index_, Index_ number, const InputValue_ *input, const Index_ *, OutputValue_ *output) const
Definition math_helpers.hpp:974
void dense(bool, Index_, Index_, Index_ length, const InputValue_ *input, OutputValue_ *output) const
Definition math_helpers.hpp:961
bool non_zero_depends_on_column() const
Definition math_helpers.hpp:946
bool is_sparse() const
Definition math_helpers.hpp:970
bool non_zero_depends_on_row() const
Definition math_helpers.hpp:942
OutputValue_ fill(bool, Index_) const
Definition math_helpers.hpp:978
void dense(bool, Index_, const std::vector< Index_ > &indices, const InputValue_ *input, OutputValue_ *output) const
Definition math_helpers.hpp:965
std::optional< Index_ > ncol() const
Definition math_helpers.hpp:929
bool zero_depends_on_row() const
Definition math_helpers.hpp:934
std::optional< Index_ > nrow() const
Definition math_helpers.hpp:925
bool zero_depends_on_column() const
Definition math_helpers.hpp:938
Helper for delayed calculation of the inverse sine of each matrix entry.
Definition math_helpers.hpp:995
bool zero_depends_on_row() const
Definition math_helpers.hpp:1006
void sparse(bool, Index_, Index_ number, const InputValue_ *input, const Index_ *, OutputValue_ *output) const
Definition math_helpers.hpp:1046
void dense(bool, Index_, Index_, Index_ length, const InputValue_ *input, OutputValue_ *output) const
Definition math_helpers.hpp:1033
OutputValue_ fill(bool, Index_) const
Definition math_helpers.hpp:1050
bool zero_depends_on_column() const
Definition math_helpers.hpp:1010
bool non_zero_depends_on_column() const
Definition math_helpers.hpp:1018
std::optional< Index_ > ncol() const
Definition math_helpers.hpp:1001
bool is_sparse() const
Definition math_helpers.hpp:1042
std::optional< Index_ > nrow() const
Definition math_helpers.hpp:997
bool non_zero_depends_on_row() const
Definition math_helpers.hpp:1014
void dense(bool, Index_, const std::vector< Index_ > &indices, const InputValue_ *input, OutputValue_ *output) const
Definition math_helpers.hpp:1037
Helper for delayed calculation of the inverse hyperbolic sine of each matrix entry.
Definition math_helpers.hpp:1066
void dense(bool, Index_, const std::vector< Index_ > &indices, const InputValue_ *input, OutputValue_ *output) const
Definition math_helpers.hpp:1108
std::optional< Index_ > ncol() const
Definition math_helpers.hpp:1072
void sparse(bool, Index_, Index_ number, const InputValue_ *input, const Index_ *, OutputValue_ *output) const
Definition math_helpers.hpp:1117
std::optional< Index_ > nrow() const
Definition math_helpers.hpp:1068
bool non_zero_depends_on_column() const
Definition math_helpers.hpp:1089
bool is_sparse() const
Definition math_helpers.hpp:1113
void dense(bool, Index_, Index_, Index_ length, const InputValue_ *input, OutputValue_ *output) const
Definition math_helpers.hpp:1104
OutputValue_ fill(bool, Index_) const
Definition math_helpers.hpp:1121
bool zero_depends_on_column() const
Definition math_helpers.hpp:1081
bool zero_depends_on_row() const
Definition math_helpers.hpp:1077
bool non_zero_depends_on_row() const
Definition math_helpers.hpp:1085
Helper for delayed calculation of the inverse tangent of each matrix entry.
Definition math_helpers.hpp:1137
bool non_zero_depends_on_column() const
Definition math_helpers.hpp:1160
void dense(bool, Index_, const std::vector< Index_ > &indices, const InputValue_ *input, OutputValue_ *output) const
Definition math_helpers.hpp:1179
OutputValue_ fill(bool, Index_) const
Definition math_helpers.hpp:1192
void dense(bool, Index_, Index_, Index_ length, const InputValue_ *input, OutputValue_ *output) const
Definition math_helpers.hpp:1175
bool zero_depends_on_row() const
Definition math_helpers.hpp:1148
bool non_zero_depends_on_row() const
Definition math_helpers.hpp:1156
std::optional< Index_ > nrow() const
Definition math_helpers.hpp:1139
bool is_sparse() const
Definition math_helpers.hpp:1184
bool zero_depends_on_column() const
Definition math_helpers.hpp:1152
void sparse(bool, Index_, Index_ number, const InputValue_ *input, const Index_ *, OutputValue_ *output) const
Definition math_helpers.hpp:1188
std::optional< Index_ > ncol() const
Definition math_helpers.hpp:1143
Helper for delayed calculation of the inverse hyperbolic tangent of each matrix entry.
Definition math_helpers.hpp:1208
bool non_zero_depends_on_column() const
Definition math_helpers.hpp:1231
bool zero_depends_on_row() const
Definition math_helpers.hpp:1219
void dense(bool, Index_, const std::vector< Index_ > &indices, const InputValue_ *input, OutputValue_ *output) const
Definition math_helpers.hpp:1250
OutputValue_ fill(bool, Index_) const
Definition math_helpers.hpp:1263
bool is_sparse() const
Definition math_helpers.hpp:1255
bool zero_depends_on_column() const
Definition math_helpers.hpp:1223
void sparse(bool, Index_, Index_ number, const InputValue_ *input, const Index_ *, OutputValue_ *output) const
Definition math_helpers.hpp:1259
void dense(bool, Index_, Index_, Index_ length, const InputValue_ *input, OutputValue_ *output) const
Definition math_helpers.hpp:1246
std::optional< Index_ > ncol() const
Definition math_helpers.hpp:1214
bool non_zero_depends_on_row() const
Definition math_helpers.hpp:1227
std::optional< Index_ > nrow() const
Definition math_helpers.hpp:1210
Helper for delayed calculation of the ceiling of each matrix entry.
Definition math_helpers.hpp:340
OutputValue_ fill(bool, Index_) const
Definition math_helpers.hpp:395
std::optional< Index_ > nrow() const
Definition math_helpers.hpp:342
bool zero_depends_on_row() const
Definition math_helpers.hpp:351
bool non_zero_depends_on_row() const
Definition math_helpers.hpp:359
bool non_zero_depends_on_column() const
Definition math_helpers.hpp:363
bool is_sparse() const
Definition math_helpers.hpp:387
void sparse(bool, Index_, Index_ number, const InputValue_ *input, const Index_ *, OutputValue_ *output) const
Definition math_helpers.hpp:391
void dense(bool, Index_, const std::vector< Index_ > &indices, const InputValue_ *input, OutputValue_ *output) const
Definition math_helpers.hpp:382
void dense(bool, Index_, Index_, Index_ length, const InputValue_ *input, OutputValue_ *output) const
Definition math_helpers.hpp:378
bool zero_depends_on_column() const
Definition math_helpers.hpp:355
std::optional< Index_ > ncol() const
Definition math_helpers.hpp:346
Helper for delayed calculation of the cosine of a matrix entry.
Definition math_helpers.hpp:1279
void sparse(bool, Index_, Index_ number, const InputValue_ *input, const Index_ *, OutputValue_ *output) const
Definition math_helpers.hpp:1330
bool non_zero_depends_on_row() const
Definition math_helpers.hpp:1298
bool zero_depends_on_row() const
Definition math_helpers.hpp:1290
bool is_sparse() const
Definition math_helpers.hpp:1326
bool non_zero_depends_on_column() const
Definition math_helpers.hpp:1302
void dense(bool, Index_, Index_, Index_ length, const InputValue_ *input, OutputValue_ *output) const
Definition math_helpers.hpp:1317
std::optional< Index_ > ncol() const
Definition math_helpers.hpp:1285
void dense(bool, Index_, const std::vector< Index_ > &indices, const InputValue_ *input, OutputValue_ *output) const
Definition math_helpers.hpp:1321
std::optional< Index_ > nrow() const
Definition math_helpers.hpp:1281
bool zero_depends_on_column() const
Definition math_helpers.hpp:1294
OutputValue_ fill(bool, Index_) const
Definition math_helpers.hpp:1334
Helper for delayed calculation of the hyperbolic cosine of each matrix entry.
Definition math_helpers.hpp:1350
bool zero_depends_on_column() const
Definition math_helpers.hpp:1365
bool is_sparse() const
Definition math_helpers.hpp:1397
bool zero_depends_on_row() const
Definition math_helpers.hpp:1361
bool non_zero_depends_on_row() const
Definition math_helpers.hpp:1369
std::optional< Index_ > ncol() const
Definition math_helpers.hpp:1356
void dense(bool, Index_, const std::vector< Index_ > &indices, const InputValue_ *input, OutputValue_ *output) const
Definition math_helpers.hpp:1392
std::optional< Index_ > nrow() const
Definition math_helpers.hpp:1352
void sparse(bool, Index_, Index_ number, const InputValue_ *input, const Index_ *, OutputValue_ *output) const
Definition math_helpers.hpp:1401
void dense(bool, Index_, Index_, Index_ length, const InputValue_ *input, OutputValue_ *output) const
Definition math_helpers.hpp:1388
bool non_zero_depends_on_column() const
Definition math_helpers.hpp:1373
OutputValue_ fill(bool, Index_) const
Definition math_helpers.hpp:1405
Helper for delayed calculation of the exponent function for each matrix entry.
Definition math_helpers.hpp:709
std::optional< Index_ > ncol() const
Definition math_helpers.hpp:715
OutputValue_ fill(bool, Index_) const
Definition math_helpers.hpp:764
bool non_zero_depends_on_row() const
Definition math_helpers.hpp:728
bool zero_depends_on_row() const
Definition math_helpers.hpp:720
std::optional< Index_ > nrow() const
Definition math_helpers.hpp:711
void dense(bool, Index_, Index_, Index_ length, const InputValue_ *input, OutputValue_ *output) const
Definition math_helpers.hpp:747
bool is_sparse() const
Definition math_helpers.hpp:756
void dense(bool, Index_, const std::vector< Index_ > &indices, const InputValue_ *input, OutputValue_ *output) const
Definition math_helpers.hpp:751
bool zero_depends_on_column() const
Definition math_helpers.hpp:724
bool non_zero_depends_on_column() const
Definition math_helpers.hpp:732
void sparse(bool, Index_, Index_ number, const InputValue_ *input, const Index_ *, OutputValue_ *output) const
Definition math_helpers.hpp:760
Helper for delayed calculation of the exponential function of each matrix entry minus 1.
Definition math_helpers.hpp:780
bool zero_depends_on_row() const
Definition math_helpers.hpp:791
void dense(bool, Index_, Index_, Index_ length, const InputValue_ *input, OutputValue_ *output) const
Definition math_helpers.hpp:818
bool is_sparse() const
Definition math_helpers.hpp:827
std::optional< Index_ > nrow() const
Definition math_helpers.hpp:782
void dense(bool, Index_, const std::vector< Index_ > &indices, const InputValue_ *input, OutputValue_ *output) const
Definition math_helpers.hpp:822
bool non_zero_depends_on_column() const
Definition math_helpers.hpp:803
OutputValue_ fill(bool, Index_) const
Definition math_helpers.hpp:835
bool zero_depends_on_column() const
Definition math_helpers.hpp:795
void sparse(bool, Index_, Index_ number, const InputValue_ *input, const Index_ *, OutputValue_ *output) const
Definition math_helpers.hpp:831
bool non_zero_depends_on_row() const
Definition math_helpers.hpp:799
std::optional< Index_ > ncol() const
Definition math_helpers.hpp:786
Helper for delayed calculation of the floor of each matrix entry.
Definition math_helpers.hpp:411
std::optional< Index_ > ncol() const
Definition math_helpers.hpp:417
bool zero_depends_on_row() const
Definition math_helpers.hpp:422
void sparse(bool, Index_, Index_ number, const InputValue_ *input, const Index_ *, OutputValue_ *output) const
Definition math_helpers.hpp:462
void dense(bool, Index_, const std::vector< Index_ > &indices, const InputValue_ *input, OutputValue_ *output) const
Definition math_helpers.hpp:453
bool zero_depends_on_column() const
Definition math_helpers.hpp:426
OutputValue_ fill(bool, Index_) const
Definition math_helpers.hpp:466
bool non_zero_depends_on_column() const
Definition math_helpers.hpp:434
bool is_sparse() const
Definition math_helpers.hpp:458
void dense(bool, Index_, Index_, Index_ length, const InputValue_ *input, OutputValue_ *output) const
Definition math_helpers.hpp:449
bool non_zero_depends_on_row() const
Definition math_helpers.hpp:430
std::optional< Index_ > nrow() const
Definition math_helpers.hpp:413
Apply the gamma function to a matrix entry.
Definition math_helpers.hpp:1705
void dense(bool, Index_, const std::vector< Index_ > &indices, const InputValue_ *input, OutputValue_ *output) const
Definition math_helpers.hpp:1747
std::optional< Index_ > ncol() const
Definition math_helpers.hpp:1711
bool zero_depends_on_column() const
Definition math_helpers.hpp:1720
bool non_zero_depends_on_row() const
Definition math_helpers.hpp:1724
void sparse(bool, Index_, Index_ number, const InputValue_ *input, const Index_ *, OutputValue_ *output) const
Definition math_helpers.hpp:1756
bool non_zero_depends_on_column() const
Definition math_helpers.hpp:1728
bool zero_depends_on_row() const
Definition math_helpers.hpp:1716
std::optional< Index_ > nrow() const
Definition math_helpers.hpp:1707
void dense(bool, Index_, Index_, Index_ length, const InputValue_ *input, OutputValue_ *output) const
Definition math_helpers.hpp:1743
OutputValue_ fill(bool, Index_) const
Definition math_helpers.hpp:1760
bool is_sparse() const
Definition math_helpers.hpp:1752
Apply the log-gamma function to a matrix entry.
Definition math_helpers.hpp:1777
void dense(bool, Index_, Index_, Index_ length, const InputValue_ *input, OutputValue_ *output) const
Definition math_helpers.hpp:1815
std::optional< Index_ > nrow() const
Definition math_helpers.hpp:1779
void sparse(bool, Index_, Index_ number, const InputValue_ *input, const Index_ *, OutputValue_ *output) const
Definition math_helpers.hpp:1828
bool is_sparse() const
Definition math_helpers.hpp:1824
OutputValue_ fill(bool, Index_) const
Definition math_helpers.hpp:1832
std::optional< Index_ > ncol() const
Definition math_helpers.hpp:1783
void dense(bool, Index_, const std::vector< Index_ > &indices, const InputValue_ *input, OutputValue_ *output) const
Definition math_helpers.hpp:1819
bool non_zero_depends_on_column() const
Definition math_helpers.hpp:1800
bool non_zero_depends_on_row() const
Definition math_helpers.hpp:1796
bool zero_depends_on_row() const
Definition math_helpers.hpp:1788
bool zero_depends_on_column() const
Definition math_helpers.hpp:1792
Helper for the delayed calculation of the logarithm of each matrix entry plus 1.
Definition math_helpers.hpp:554
std::optional< Index_ > ncol() const
Definition math_helpers.hpp:571
DelayedUnaryIsometricLog1pHelper()
Definition math_helpers.hpp:559
void dense(bool, Index_, const std::vector< Index_ > &indices, const InputValue_ *input, OutputValue_ *output) const
Definition math_helpers.hpp:609
void dense(bool, Index_, Index_, Index_ length, const InputValue_ *input, OutputValue_ *output) const
Definition math_helpers.hpp:605
bool non_zero_depends_on_row() const
Definition math_helpers.hpp:584
std::optional< Index_ > nrow() const
Definition math_helpers.hpp:567
bool is_sparse() const
Definition math_helpers.hpp:614
bool zero_depends_on_column() const
Definition math_helpers.hpp:580
bool non_zero_depends_on_column() const
Definition math_helpers.hpp:588
OutputValue_ fill(bool, Index_) const
Definition math_helpers.hpp:622
DelayedUnaryIsometricLog1pHelper(Base_ base)
Definition math_helpers.hpp:564
bool zero_depends_on_row() const
Definition math_helpers.hpp:576
void sparse(bool, Index_, Index_ number, const InputValue_ *input, const Index_ *, OutputValue_ *output) const
Definition math_helpers.hpp:618
Helper for delayed calculation of the logarithm of each matrix entry.
Definition math_helpers.hpp:184
void dense(bool, Index_, const std::vector< Index_ > &indices, const InputValue_ *input, OutputValue_ *output) const
Definition math_helpers.hpp:239
DelayedUnaryIsometricLogHelper(Base_ base)
Definition math_helpers.hpp:194
std::optional< Index_ > ncol() const
Definition math_helpers.hpp:201
bool zero_depends_on_column() const
Definition math_helpers.hpp:210
bool non_zero_depends_on_row() const
Definition math_helpers.hpp:214
void dense(bool, Index_, Index_, Index_ length, const InputValue_ *input, OutputValue_ *output) const
Definition math_helpers.hpp:235
std::optional< Index_ > nrow() const
Definition math_helpers.hpp:197
bool non_zero_depends_on_column() const
Definition math_helpers.hpp:218
bool zero_depends_on_row() const
Definition math_helpers.hpp:206
OutputValue_ fill(bool, Index_) const
Definition math_helpers.hpp:252
bool is_sparse() const
Definition math_helpers.hpp:244
void sparse(bool, Index_, Index_ number, const InputValue_ *input, const Index_ *, OutputValue_ *output) const
Definition math_helpers.hpp:248
DelayedUnaryIsometricLogHelper()
Definition math_helpers.hpp:189
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:638
void dense(bool, Index_, Index_, Index_ length, const InputValue_ *input, OutputValue_ *output) const
Definition math_helpers.hpp:676
std::optional< Index_ > nrow() const
Definition math_helpers.hpp:640
bool zero_depends_on_row() const
Definition math_helpers.hpp:649
std::optional< Index_ > ncol() const
Definition math_helpers.hpp:644
void dense(bool, Index_, const std::vector< Index_ > &indices, const InputValue_ *input, OutputValue_ *output) const
Definition math_helpers.hpp:680
bool non_zero_depends_on_row() const
Definition math_helpers.hpp:657
OutputValue_ fill(bool, Index_) const
Definition math_helpers.hpp:693
bool zero_depends_on_column() const
Definition math_helpers.hpp:653
void sparse(bool, Index_, Index_ number, const InputValue_ *input, const Index_ *, OutputValue_ *output) const
Definition math_helpers.hpp:689
bool is_sparse() const
Definition math_helpers.hpp:685
bool non_zero_depends_on_column() const
Definition math_helpers.hpp:661
Helper for delayed calculation of the sign of each matrix entry.
Definition math_helpers.hpp:99
OutputValue_ fill(bool, Index_) const
Definition math_helpers.hpp:167
std::optional< Index_ > nrow() const
Definition math_helpers.hpp:101
void dense(bool, Index_, Index_, Index_ length, const InputValue_ *input, OutputValue_ *output) const
Definition math_helpers.hpp:150
bool is_sparse() const
Definition math_helpers.hpp:159
bool zero_depends_on_row() const
Definition math_helpers.hpp:110
void sparse(bool, Index_, Index_ number, const InputValue_ *input, const Index_ *, OutputValue_ *output) const
Definition math_helpers.hpp:163
bool non_zero_depends_on_column() const
Definition math_helpers.hpp:122
bool non_zero_depends_on_row() const
Definition math_helpers.hpp:118
std::optional< Index_ > ncol() const
Definition math_helpers.hpp:105
void dense(bool, Index_, const std::vector< Index_ > &indices, const InputValue_ *input, OutputValue_ *output) const
Definition math_helpers.hpp:154
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:1421
bool zero_depends_on_column() const
Definition math_helpers.hpp:1436
bool non_zero_depends_on_column() const
Definition math_helpers.hpp:1444
OutputValue_ fill(bool, Index_) const
Definition math_helpers.hpp:1476
void sparse(bool, Index_, Index_ number, const InputValue_ *input, const Index_ *, OutputValue_ *output) const
Definition math_helpers.hpp:1472
void dense(bool, Index_, Index_, Index_ length, const InputValue_ *input, OutputValue_ *output) const
Definition math_helpers.hpp:1459
bool zero_depends_on_row() const
Definition math_helpers.hpp:1432
std::optional< Index_ > ncol() const
Definition math_helpers.hpp:1427
std::optional< Index_ > nrow() const
Definition math_helpers.hpp:1423
void dense(bool, Index_, const std::vector< Index_ > &indices, const InputValue_ *input, OutputValue_ *output) const
Definition math_helpers.hpp:1463
bool is_sparse() const
Definition math_helpers.hpp:1468
bool non_zero_depends_on_row() const
Definition math_helpers.hpp:1440
Helper for delayed calculation of the hyperbolic sine of each matrix entry.
Definition math_helpers.hpp:1492
bool is_sparse() const
Definition math_helpers.hpp:1539
bool zero_depends_on_column() const
Definition math_helpers.hpp:1507
bool zero_depends_on_row() const
Definition math_helpers.hpp:1503
std::optional< Index_ > nrow() const
Definition math_helpers.hpp:1494
void dense(bool, Index_, const std::vector< Index_ > &indices, const InputValue_ *input, OutputValue_ *output) const
Definition math_helpers.hpp:1534
void dense(bool, Index_, Index_, Index_ length, const InputValue_ *input, OutputValue_ *output) const
Definition math_helpers.hpp:1530
OutputValue_ fill(bool, Index_) const
Definition math_helpers.hpp:1547
void sparse(bool, Index_, Index_ number, const InputValue_ *input, const Index_ *, OutputValue_ *output) const
Definition math_helpers.hpp:1543
bool non_zero_depends_on_row() const
Definition math_helpers.hpp:1511
bool non_zero_depends_on_column() const
Definition math_helpers.hpp:1515
std::optional< Index_ > ncol() const
Definition math_helpers.hpp:1498
Helper for delayed calculation of the square root of each matrix entry.
Definition math_helpers.hpp:269
OutputValue_ fill(bool, Index_) const
Definition math_helpers.hpp:324
std::optional< Index_ > ncol() const
Definition math_helpers.hpp:275
void dense(bool, Index_, const std::vector< Index_ > &indices, const InputValue_ *input, OutputValue_ *output) const
Definition math_helpers.hpp:311
bool non_zero_depends_on_row() const
Definition math_helpers.hpp:288
std::optional< Index_ > nrow() const
Definition math_helpers.hpp:271
bool zero_depends_on_column() const
Definition math_helpers.hpp:284
void dense(bool, Index_, Index_, Index_ length, const InputValue_ *input, OutputValue_ *output) const
Definition math_helpers.hpp:307
bool is_sparse() const
Definition math_helpers.hpp:316
void sparse(bool, Index_, Index_ number, const InputValue_ *input, const Index_ *, OutputValue_ *output) const
Definition math_helpers.hpp:320
bool non_zero_depends_on_column() const
Definition math_helpers.hpp:292
bool zero_depends_on_row() const
Definition math_helpers.hpp:280
Helper for delayed calculation of the tangent of each matrix entry.
Definition math_helpers.hpp:1563
bool is_sparse() const
Definition math_helpers.hpp:1610
std::optional< Index_ > ncol() const
Definition math_helpers.hpp:1569
void dense(bool, Index_, Index_, Index_ length, const InputValue_ *input, OutputValue_ *output) const
Definition math_helpers.hpp:1601
bool zero_depends_on_row() const
Definition math_helpers.hpp:1574
bool zero_depends_on_column() const
Definition math_helpers.hpp:1578
void dense(bool, Index_, const std::vector< Index_ > &indices, const InputValue_ *input, OutputValue_ *output) const
Definition math_helpers.hpp:1605
bool non_zero_depends_on_column() const
Definition math_helpers.hpp:1586
bool non_zero_depends_on_row() const
Definition math_helpers.hpp:1582
OutputValue_ fill(bool, Index_) const
Definition math_helpers.hpp:1618
std::optional< Index_ > nrow() const
Definition math_helpers.hpp:1565
void sparse(bool, Index_, Index_ number, const InputValue_ *input, const Index_ *, OutputValue_ *output) const
Definition math_helpers.hpp:1614
Helper for delayed calculation of the hyperbolic tangent of each matrix entry.
Definition math_helpers.hpp:1634
bool non_zero_depends_on_column() const
Definition math_helpers.hpp:1657
void sparse(bool, Index_, Index_ number, const InputValue_ *input, const Index_ *, OutputValue_ *output) const
Definition math_helpers.hpp:1685
bool non_zero_depends_on_row() const
Definition math_helpers.hpp:1653
bool zero_depends_on_column() const
Definition math_helpers.hpp:1649
void dense(bool, Index_, const std::vector< Index_ > &indices, const InputValue_ *input, OutputValue_ *output) const
Definition math_helpers.hpp:1676
std::optional< Index_ > ncol() const
Definition math_helpers.hpp:1640
OutputValue_ fill(bool, Index_) const
Definition math_helpers.hpp:1689
void dense(bool, Index_, Index_, Index_ length, const InputValue_ *input, OutputValue_ *output) const
Definition math_helpers.hpp:1672
std::optional< Index_ > nrow() const
Definition math_helpers.hpp:1636
bool is_sparse() const
Definition math_helpers.hpp:1681
bool zero_depends_on_row() const
Definition math_helpers.hpp:1645
Helper for delayed truncation of each matrix entry to an integer.
Definition math_helpers.hpp:482
bool zero_depends_on_row() const
Definition math_helpers.hpp:493
void sparse(bool, Index_, Index_ number, const InputValue_ *input, const Index_ *, OutputValue_ *output) const
Definition math_helpers.hpp:533
void dense(bool, Index_, const std::vector< Index_ > &indices, const InputValue_ *input, OutputValue_ *output) const
Definition math_helpers.hpp:524
bool non_zero_depends_on_row() const
Definition math_helpers.hpp:501
void dense(bool, Index_, Index_, Index_ length, const InputValue_ *input, OutputValue_ *output) const
Definition math_helpers.hpp:520
bool non_zero_depends_on_column() const
Definition math_helpers.hpp:505
std::optional< Index_ > nrow() const
Definition math_helpers.hpp:484
bool zero_depends_on_column() const
Definition math_helpers.hpp:497
std::optional< Index_ > ncol() const
Definition math_helpers.hpp:488
OutputValue_ fill(bool, Index_) const
Definition math_helpers.hpp:537
bool is_sparse() const
Definition math_helpers.hpp:529
Flexible representations for matrix data.
Definition Extractor.hpp:15
Interface for tatami::DelayedUnaryIsometricOperation helpers.