1#ifndef TATAMI_MATH_HELPERS_H
2#define TATAMI_MATH_HELPERS_H
25template<
typename OutputValue_,
typename InputValue_,
typename Index_>
28 std::optional<Index_>
nrow()
const {
32 std::optional<Index_>
ncol()
const {
54 void core(
const InputValue_* input,
const Index_ length, OutputValue_*
const output)
const {
55 if constexpr(std::is_same<InputValue_, OutputValue_>::value) {
58 for (Index_ i = 0; i < length; ++i) {
59 output[i] = std::abs(input[i]);
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);
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);
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);
81 OutputValue_
fill(
const bool,
const Index_)
const {
98template<
typename OutputValue_,
typename InputValue_,
typename Index_>
101 std::optional<Index_>
nrow()
const {
105 std::optional<Index_>
ncol()
const {
127 void core(
const InputValue_* input,
const Index_ length, OutputValue_*
const output)
const {
128 if constexpr(std::is_same<InputValue_, OutputValue_>::value) {
131 for (Index_ i = 0; i < length; ++i) {
134 if constexpr(std::numeric_limits<InputValue_>::has_quiet_NaN) {
135 return !std::isnan(val);
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();
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);
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);
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);
167 OutputValue_
fill(
const bool,
const Index_)
const {
184template<
int base_,
typename OutputValue_,
typename InputValue_,
typename Index_>
187 std::optional<Index_>
nrow()
const {
191 std::optional<Index_>
ncol()
const {
213 static auto logify(InputValue_ x) {
214 if constexpr(base_ == 2) {
216 }
else if constexpr(base_ == 10) {
217 return std::log10(x);
223 void core(
const InputValue_* input,
const Index_ length, OutputValue_*
const output)
const {
224 if constexpr(std::is_same<InputValue_, OutputValue_>::value) {
227 for (Index_ i = 0; i < length; ++i) {
228 output[i] = logify(input[i]);
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);
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);
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);
250 OutputValue_
fill(
const bool,
const Index_)
const {
266template<
typename OutputValue_,
typename InputValue_,
typename Index_>
276template<
typename OutputValue_,
typename InputValue_,
typename Index_>
286template<
typename OutputValue_,
typename InputValue_,
typename Index_>
300template<
typename OutputValue_,
typename InputValue_,
typename Index_,
typename Base_>
309 std::optional<Index_>
nrow()
const {
313 std::optional<Index_>
ncol()
const {
337 void core(
const InputValue_* input,
const Index_ length, OutputValue_*
const output)
const {
338 if constexpr(std::is_same<InputValue_, OutputValue_>::value) {
341 for (Index_ i = 0; i < length; ++i) {
342 output[i] = std::log(input[i]) / my_base;
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);
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);
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);
364 OutputValue_
fill(
const bool,
const Index_)
const {
366 return std::log(
static_cast<InputValue_
>(0)) / my_base;
380template<
typename OutputValue_,
typename InputValue_,
typename Index_>
383 std::optional<Index_>
nrow()
const {
387 std::optional<Index_>
ncol()
const {
409 void core(
const InputValue_* input,
const Index_ length, OutputValue_*
const output)
const {
410 if constexpr(std::is_same<InputValue_, OutputValue_>::value) {
413 for (Index_ i = 0; i < length; ++i) {
414 output[i] = std::sqrt(input[i]);
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);
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);
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);
436 OutputValue_
fill(
const bool,
const Index_)
const {
451template<
typename OutputValue_,
typename InputValue_,
typename Index_>
454 std::optional<Index_>
nrow()
const {
458 std::optional<Index_>
ncol()
const {
480 void core(
const InputValue_* input,
const Index_ length, OutputValue_*
const output)
const {
481 if constexpr(std::is_same<InputValue_, OutputValue_>::value) {
484 for (Index_ i = 0; i < length; ++i) {
485 output[i] = std::ceil(input[i]);
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);
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);
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);
507 OutputValue_
fill(
const bool,
const Index_)
const {
522template<
typename OutputValue_,
typename InputValue_,
typename Index_>
525 std::optional<Index_>
nrow()
const {
529 std::optional<Index_>
ncol()
const {
551 void core(
const InputValue_* input,
const Index_ length, OutputValue_*
const output)
const {
552 if constexpr(std::is_same<InputValue_, OutputValue_>::value) {
555 for (Index_ i = 0; i < length; ++i) {
556 output[i] = std::floor(input[i]);
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);
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);
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);
578 OutputValue_
fill(
const bool,
const Index_)
const {
593template<
typename OutputValue_,
typename InputValue_,
typename Index_>
596 std::optional<Index_>
nrow()
const {
600 std::optional<Index_>
ncol()
const {
622 void core(
const InputValue_* input,
const Index_ length, OutputValue_*
const output)
const {
623 if constexpr(std::is_same<InputValue_, OutputValue_>::value) {
626 for (Index_ i = 0; i < length; ++i) {
627 output[i] = std::trunc(input[i]);
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);
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);
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);
649 OutputValue_
fill(
const bool,
const Index_)
const {
664template<
typename OutputValue_,
typename InputValue_,
typename Index_>
667 std::optional<Index_>
nrow()
const {
671 std::optional<Index_>
ncol()
const {
693 void core(
const InputValue_* input,
const Index_ length, OutputValue_*
const output)
const {
694 if constexpr(std::is_same<InputValue_, OutputValue_>::value) {
697 for (Index_ i = 0; i < length; ++i) {
698 output[i] = std::log1p(input[i]);
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);
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);
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);
720 OutputValue_
fill(
const bool,
const Index_)
const {
735template<
typename OutputValue_,
typename InputValue_,
typename Index_>
738 std::optional<Index_>
nrow()
const {
742 std::optional<Index_>
ncol()
const {
764 void core(
const InputValue_* input,
const Index_ length, OutputValue_*
const output)
const {
765 if constexpr(std::is_same<InputValue_, OutputValue_>::value) {
768 for (Index_ i = 0; i < length; ++i) {
769 output[i] = std::round(input[i]);
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);
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);
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);
791 OutputValue_
fill(
const bool,
const Index_)
const {
806template<
typename OutputValue_,
typename InputValue_,
typename Index_>
809 std::optional<Index_>
nrow()
const {
813 std::optional<Index_>
ncol()
const {
835 void core(
const InputValue_* input,
const Index_ length, OutputValue_*
const output)
const {
836 if constexpr(std::is_same<InputValue_, OutputValue_>::value) {
839 for (Index_ i = 0; i < length; ++i) {
840 output[i] = std::exp(input[i]);
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);
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);
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);
862 OutputValue_
fill(
const bool,
const Index_)
const {
877template<
typename OutputValue_,
typename InputValue_,
typename Index_>
880 std::optional<Index_>
nrow()
const {
884 std::optional<Index_>
ncol()
const {
906 void core(
const InputValue_* input,
const Index_ length, OutputValue_*
const output)
const {
907 if constexpr(std::is_same<InputValue_, OutputValue_>::value) {
910 for (Index_ i = 0; i < length; ++i) {
911 output[i] = std::expm1(input[i]);
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);
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);
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);
933 OutputValue_
fill(
const bool,
const Index_)
const {
948template<
typename OutputValue_,
typename InputValue_,
typename Index_>
951 std::optional<Index_>
nrow()
const {
955 std::optional<Index_>
ncol()
const {
977 void core(
const InputValue_* input,
const Index_ length, OutputValue_*
const output)
const {
978 if constexpr(std::is_same<InputValue_, OutputValue_>::value) {
981 for (Index_ i = 0; i < length; ++i) {
982 output[i] = std::acos(input[i]);
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);
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);
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);
1004 OutputValue_
fill(
const bool,
const Index_)
const {
1006 return std::acos(0);
1020template<
typename OutputValue_,
typename InputValue_,
typename Index_>
1023 std::optional<Index_>
nrow()
const {
1024 return std::nullopt;
1027 std::optional<Index_>
ncol()
const {
1028 return std::nullopt;
1049 void core(
const InputValue_* input,
const Index_ length, OutputValue_*
const output)
const {
1050 if constexpr(std::is_same<InputValue_, OutputValue_>::value) {
1053 for (Index_ i = 0; i < length; ++i) {
1054 output[i] = std::acosh(input[i]);
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);
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);
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);
1076 OutputValue_
fill(
const bool,
const Index_)
const {
1078 return std::acosh(
static_cast<InputValue_
>(0));
1092template<
typename OutputValue_,
typename InputValue_,
typename Index_>
1095 std::optional<Index_>
nrow()
const {
1096 return std::nullopt;
1099 std::optional<Index_>
ncol()
const {
1100 return std::nullopt;
1121 void core(
const InputValue_* input,
const Index_ length, OutputValue_*
const output)
const {
1122 if constexpr(std::is_same<InputValue_, OutputValue_>::value) {
1125 for (Index_ i = 0; i < length; ++i) {
1126 output[i] = std::asin(input[i]);
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);
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);
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);
1148 OutputValue_
fill(
const bool,
const Index_)
const {
1163template<
typename OutputValue_,
typename InputValue_,
typename Index_>
1166 std::optional<Index_>
nrow()
const {
1167 return std::nullopt;
1170 std::optional<Index_>
ncol()
const {
1171 return std::nullopt;
1192 void core(
const InputValue_* input,
const Index_ length, OutputValue_*
const output)
const {
1193 if constexpr(std::is_same<InputValue_, OutputValue_>::value) {
1196 for (Index_ i = 0; i < length; ++i) {
1197 output[i] = std::asinh(input[i]);
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);
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);
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);
1219 OutputValue_
fill(
const bool,
const Index_)
const {
1234template<
typename OutputValue_,
typename InputValue_,
typename Index_>
1237 std::optional<Index_>
nrow()
const {
1238 return std::nullopt;
1241 std::optional<Index_>
ncol()
const {
1242 return std::nullopt;
1263 void core(
const InputValue_* input,
const Index_ length, OutputValue_*
const output)
const {
1264 if constexpr(std::is_same<InputValue_, OutputValue_>::value) {
1267 for (Index_ i = 0; i < length; ++i) {
1268 output[i] = std::atan(input[i]);
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);
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);
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);
1290 OutputValue_
fill(
const bool,
const Index_)
const {
1305template<
typename OutputValue_,
typename InputValue_,
typename Index_>
1308 std::optional<Index_>
nrow()
const {
1309 return std::nullopt;
1312 std::optional<Index_>
ncol()
const {
1313 return std::nullopt;
1334 void core(
const InputValue_* input,
const Index_ length, OutputValue_*
const output)
const {
1335 if constexpr(std::is_same<InputValue_, OutputValue_>::value) {
1338 for (Index_ i = 0; i < length; ++i) {
1339 output[i] = std::atanh(input[i]);
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);
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);
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);
1361 OutputValue_
fill(
const bool,
const Index_)
const {
1376template<
typename OutputValue_,
typename InputValue_,
typename Index_>
1379 std::optional<Index_>
nrow()
const {
1380 return std::nullopt;
1383 std::optional<Index_>
ncol()
const {
1384 return std::nullopt;
1405 void core(
const InputValue_* input,
const Index_ length, OutputValue_*
const output)
const {
1406 if constexpr(std::is_same<InputValue_, OutputValue_>::value) {
1409 for (Index_ i = 0; i < length; ++i) {
1410 output[i] = std::cos(input[i]);
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);
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);
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);
1432 OutputValue_
fill(
const bool,
const Index_)
const {
1447template<
typename OutputValue_,
typename InputValue_,
typename Index_>
1450 std::optional<Index_>
nrow()
const {
1451 return std::nullopt;
1454 std::optional<Index_>
ncol()
const {
1455 return std::nullopt;
1476 void core(
const InputValue_* input,
const Index_ length, OutputValue_*
const output)
const {
1477 if constexpr(std::is_same<InputValue_, OutputValue_>::value) {
1480 for (Index_ i = 0; i < length; ++i) {
1481 output[i] = std::cosh(input[i]);
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);
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);
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);
1503 OutputValue_
fill(
const bool,
const Index_)
const {
1518template<
typename OutputValue_,
typename InputValue_,
typename Index_>
1521 std::optional<Index_>
nrow()
const {
1522 return std::nullopt;
1525 std::optional<Index_>
ncol()
const {
1526 return std::nullopt;
1547 void core(
const InputValue_* input,
const Index_ length, OutputValue_*
const output)
const {
1548 if constexpr(std::is_same<InputValue_, OutputValue_>::value) {
1551 for (Index_ i = 0; i < length; ++i) {
1552 output[i] = std::sin(input[i]);
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);
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);
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);
1574 OutputValue_
fill(
const bool,
const Index_)
const {
1589template<
typename OutputValue_,
typename InputValue_,
typename Index_>
1592 std::optional<Index_>
nrow()
const {
1593 return std::nullopt;
1596 std::optional<Index_>
ncol()
const {
1597 return std::nullopt;
1618 void core(
const InputValue_* input,
const Index_ length, OutputValue_*
const output)
const {
1619 if constexpr(std::is_same<InputValue_, OutputValue_>::value) {
1622 for (Index_ i = 0; i < length; ++i) {
1623 output[i] = std::sinh(input[i]);
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);
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);
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);
1645 OutputValue_
fill(
const bool,
const Index_)
const {
1660template<
typename OutputValue_,
typename InputValue_,
typename Index_>
1663 std::optional<Index_>
nrow()
const {
1664 return std::nullopt;
1667 std::optional<Index_>
ncol()
const {
1668 return std::nullopt;
1689 void core(
const InputValue_* input,
const Index_ length, OutputValue_*
const output)
const {
1690 if constexpr(std::is_same<InputValue_, OutputValue_>::value) {
1693 for (Index_ i = 0; i < length; ++i) {
1694 output[i] = std::tan(input[i]);
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);
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);
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);
1716 OutputValue_
fill(
const bool,
const Index_)
const {
1731template<
typename OutputValue_,
typename InputValue_,
typename Index_>
1734 std::optional<Index_>
nrow()
const {
1735 return std::nullopt;
1738 std::optional<Index_>
ncol()
const {
1739 return std::nullopt;
1760 void core(
const InputValue_* input,
const Index_ length, OutputValue_*
const output)
const {
1761 if constexpr(std::is_same<InputValue_, OutputValue_>::value) {
1764 for (Index_ i = 0; i < length; ++i) {
1765 output[i] = std::tanh(input[i]);
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);
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);
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);
1787 OutputValue_
fill(
const bool,
const Index_)
const {
1802template<
typename OutputValue_,
typename InputValue_,
typename Index_>
1805 std::optional<Index_>
nrow()
const {
1806 return std::nullopt;
1809 std::optional<Index_>
ncol()
const {
1810 return std::nullopt;
1831 void core(
const InputValue_* input,
const Index_ length, OutputValue_*
const output)
const {
1832 if constexpr(std::is_same<InputValue_, OutputValue_>::value) {
1835 for (Index_ i = 0; i < length; ++i) {
1836 output[i] = std::tgamma(input[i]);
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);
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);
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);
1858 OutputValue_
fill(
const bool,
const Index_)
const {
1860 return std::tgamma(
static_cast<InputValue_
>(0));
1874template<
typename OutputValue_,
typename InputValue_,
typename Index_>
1877 std::optional<Index_>
nrow()
const {
1878 return std::nullopt;
1881 std::optional<Index_>
ncol()
const {
1882 return std::nullopt;
1903 void core(
const InputValue_* input,
const Index_ length, OutputValue_*
const output)
const {
1904 if constexpr(std::is_same<InputValue_, OutputValue_>::value) {
1907 for (Index_ i = 0; i < length; ++i) {
1908 output[i] = std::lgamma(input[i]);
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);
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);
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);
1930 OutputValue_
fill(
const bool,
const Index_)
const {
1932 return std::lgamma(
static_cast<InputValue_
>(0));
1940template<
typename OutputValue_ =
double,
typename InputValue_ =
double,
typename Index_ =
int>
1941using DelayedUnaryIsometricAbs = DelayedUnaryIsometricAbsHelper<OutputValue_, InputValue_, Index_>;
1943template<
typename OutputValue_ =
double,
typename InputValue_ =
double,
typename Index_ =
int>
1944using DelayedUnaryIsometricSign = DelayedUnaryIsometricSignHelper<OutputValue_, InputValue_, Index_>;
1946template<
typename OutputValue_ =
double,
typename InputValue_ =
double,
typename Index_ =
int,
typename Base_ = InputValue_>
1947using DelayedUnaryIsometricLog = DelayedUnaryIsometricCustomLogHelper<OutputValue_, InputValue_, Index_, Base_>;
1949template<
typename OutputValue_ =
double,
typename InputValue_ =
double,
typename Index_ =
int>
1950using DelayedUnaryIsometricSqrt = DelayedUnaryIsometricSqrtHelper<OutputValue_, InputValue_, Index_>;
1952template<
typename OutputValue_ =
double,
typename InputValue_ =
double,
typename Index_ =
int>
1953using DelayedUnaryIsometricCeiling = DelayedUnaryIsometricCeilingHelper<OutputValue_, InputValue_, Index_>;
1955template<
typename OutputValue_ =
double,
typename InputValue_ =
double,
typename Index_ =
int>
1956using DelayedUnaryIsometricFloor = DelayedUnaryIsometricFloorHelper<OutputValue_, InputValue_, Index_>;
1958template<
typename OutputValue_ =
double,
typename InputValue_ =
double,
typename Index_ =
int>
1959using DelayedUnaryIsometricTrunc = DelayedUnaryIsometricTruncHelper<OutputValue_, InputValue_, Index_>;
1961template<
typename OutputValue_ =
double,
typename InputValue_ =
double,
typename Index_ =
int,
typename Base_ = InputValue_>
1962using DelayedUnaryIsometricLog1p = DelayedUnaryIsometricLog1pHelper<OutputValue_, InputValue_, Index_>;
1964template<
typename OutputValue_ =
double,
typename InputValue_ =
double,
typename Index_ =
int>
1965using DelayedUnaryIsometricRound = DelayedUnaryIsometricRoundHelper<OutputValue_, InputValue_, Index_>;
1967template<
typename OutputValue_ =
double,
typename InputValue_ =
double,
typename Index_ =
int>
1968using DelayedUnaryIsometricExp = DelayedUnaryIsometricExpHelper<OutputValue_, InputValue_, Index_>;
1970template<
typename OutputValue_ =
double,
typename InputValue_ =
double,
typename Index_ =
int>
1971using DelayedUnaryIsometricExpm1 = DelayedUnaryIsometricExpm1Helper<OutputValue_, InputValue_, Index_>;
1973template<
typename OutputValue_ =
double,
typename InputValue_ =
double,
typename Index_ =
int>
1974using DelayedUnaryIsometricAcos = DelayedUnaryIsometricAcosHelper<OutputValue_, InputValue_, Index_>;
1976template<
typename OutputValue_ =
double,
typename InputValue_ =
double,
typename Index_ =
int>
1977using DelayedUnaryIsometricAcosh = DelayedUnaryIsometricAcoshHelper<OutputValue_, InputValue_, Index_>;
1979template<
typename OutputValue_ =
double,
typename InputValue_ =
double,
typename Index_ =
int>
1980using DelayedUnaryIsometricAsin = DelayedUnaryIsometricAsinHelper<OutputValue_, InputValue_, Index_>;
1982template<
typename OutputValue_ =
double,
typename InputValue_ =
double,
typename Index_ =
int>
1983using DelayedUnaryIsometricAsinh = DelayedUnaryIsometricAsinhHelper<OutputValue_, InputValue_, Index_>;
1985template<
typename OutputValue_ =
double,
typename InputValue_ =
double,
typename Index_ =
int>
1986using DelayedUnaryIsometricAtan = DelayedUnaryIsometricAtanHelper<OutputValue_, InputValue_, Index_>;
1988template<
typename OutputValue_ =
double,
typename InputValue_ =
double,
typename Index_ =
int>
1989using DelayedUnaryIsometricAtanh = DelayedUnaryIsometricAtanhHelper<OutputValue_, InputValue_, Index_>;
1991template<
typename OutputValue_ =
double,
typename InputValue_ =
double,
typename Index_ =
int>
1992using DelayedUnaryIsometricCos = DelayedUnaryIsometricCosHelper<OutputValue_, InputValue_, Index_>;
1994template<
typename OutputValue_ =
double,
typename InputValue_ =
double,
typename Index_ =
int>
1995using DelayedUnaryIsometricCosh = DelayedUnaryIsometricCoshHelper<OutputValue_, InputValue_, Index_>;
1997template<
typename OutputValue_ =
double,
typename InputValue_ =
double,
typename Index_ =
int>
1998using DelayedUnaryIsometricSin = DelayedUnaryIsometricSinHelper<OutputValue_, InputValue_, Index_>;
2000template<
typename OutputValue_ =
double,
typename InputValue_ =
double,
typename Index_ =
int>
2001using DelayedUnaryIsometricSinh = DelayedUnaryIsometricSinhHelper<OutputValue_, InputValue_, Index_>;
2003template<
typename OutputValue_ =
double,
typename InputValue_ =
double,
typename Index_ =
int>
2004using DelayedUnaryIsometricTan = DelayedUnaryIsometricTanHelper<OutputValue_, InputValue_, Index_>;
2006template<
typename OutputValue_ =
double,
typename InputValue_ =
double,
typename Index_ =
int>
2007using DelayedUnaryIsometricTanh = DelayedUnaryIsometricTanhHelper<OutputValue_, InputValue_, Index_>;
2009template<
typename OutputValue_ =
double,
typename InputValue_ =
double,
typename Index_ =
int>
2010using DelayedUnaryIsometricGamma = DelayedUnaryIsometricGammaHelper<OutputValue_, InputValue_, Index_>;
2012template<
typename OutputValue_ =
double,
typename InputValue_ =
double,
typename Index_ =
int>
2013using DelayedUnaryIsometricLgamma = DelayedUnaryIsometricLgammaHelper<OutputValue_, InputValue_, Index_>;
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.