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, Index_ length, OutputValue_* 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(
bool, Index_, Index_, Index_ length,
const InputValue_* input, OutputValue_* output)
const {
65 core(input, length, output);
68 void dense(
bool, Index_,
const std::vector<Index_>& indices,
const InputValue_* input, OutputValue_* output)
const {
69 core(input, indices.size(), output);
77 void sparse(
bool, Index_, Index_ number,
const InputValue_* input,
const Index_*, OutputValue_* output)
const {
78 core(input, number, output);
81 OutputValue_
fill(
bool, 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, Index_ length, OutputValue_* 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(
bool, Index_, Index_, Index_ length,
const InputValue_* input, OutputValue_* output)
const {
151 core(input, length, output);
154 void dense(
bool, Index_,
const std::vector<Index_>& indices,
const InputValue_* input, OutputValue_* output)
const {
155 core(input, indices.size(), output);
163 void sparse(
bool, Index_, Index_ number,
const InputValue_* input,
const Index_*, OutputValue_* output)
const {
164 core(input, number, output);
167 OutputValue_
fill(
bool, Index_)
const {
183template<
typename OutputValue_,
typename InputValue_,
typename Index_,
typename Base_>
197 std::optional<Index_>
nrow()
const {
201 std::optional<Index_>
ncol()
const {
225 void core(
const InputValue_* input, Index_ length, OutputValue_* output)
const {
226 if constexpr(std::is_same<InputValue_, OutputValue_>::value) {
229 for (Index_ i = 0; i < length; ++i) {
230 output[i] = std::log(input[i]) / my_base;
235 void dense(
bool, Index_, Index_, Index_ length,
const InputValue_* input, OutputValue_* output)
const {
236 core(input, length, output);
239 void dense(
bool, Index_,
const std::vector<Index_>& indices,
const InputValue_* input, OutputValue_* output)
const {
240 core(input, indices.size(), output);
248 void sparse(
bool, Index_, Index_ number,
const InputValue_* input,
const Index_*, OutputValue_* output)
const {
249 core(input, number, output);
252 OutputValue_
fill(
bool, Index_)
const {
254 return std::log(
static_cast<OutputValue_
>(0));
268template<
typename OutputValue_,
typename InputValue_,
typename Index_>
271 std::optional<Index_>
nrow()
const {
275 std::optional<Index_>
ncol()
const {
297 void core(
const InputValue_* input, Index_ length, OutputValue_* output)
const {
298 if constexpr(std::is_same<InputValue_, OutputValue_>::value) {
301 for (Index_ i = 0; i < length; ++i) {
302 output[i] = std::sqrt(input[i]);
307 void dense(
bool, Index_, Index_, Index_ length,
const InputValue_* input, OutputValue_* output)
const {
308 core(input, length, output);
311 void dense(
bool, Index_,
const std::vector<Index_>& indices,
const InputValue_* input, OutputValue_* output)
const {
312 core(input, indices.size(), output);
320 void sparse(
bool, Index_, Index_ number,
const InputValue_* input,
const Index_*, OutputValue_* output)
const {
321 core(input, number, output);
324 OutputValue_
fill(
bool, Index_)
const {
339template<
typename OutputValue_,
typename InputValue_,
typename Index_>
342 std::optional<Index_>
nrow()
const {
346 std::optional<Index_>
ncol()
const {
368 void core(
const InputValue_* input, Index_ length, OutputValue_* output)
const {
369 if constexpr(std::is_same<InputValue_, OutputValue_>::value) {
372 for (Index_ i = 0; i < length; ++i) {
373 output[i] = std::ceil(input[i]);
378 void dense(
bool, Index_, Index_, Index_ length,
const InputValue_* input, OutputValue_* output)
const {
379 core(input, length, output);
382 void dense(
bool, Index_,
const std::vector<Index_>& indices,
const InputValue_* input, OutputValue_* output)
const {
383 core(input, indices.size(), output);
391 void sparse(
bool, Index_, Index_ number,
const InputValue_* input,
const Index_*, OutputValue_* output)
const {
392 core(input, number, output);
395 OutputValue_
fill(
bool, Index_)
const {
410template<
typename OutputValue_,
typename InputValue_,
typename Index_>
413 std::optional<Index_>
nrow()
const {
417 std::optional<Index_>
ncol()
const {
439 void core(
const InputValue_* input, Index_ length, OutputValue_* output)
const {
440 if constexpr(std::is_same<InputValue_, OutputValue_>::value) {
443 for (Index_ i = 0; i < length; ++i) {
444 output[i] = std::floor(input[i]);
449 void dense(
bool, Index_, Index_, Index_ length,
const InputValue_* input, OutputValue_* output)
const {
450 core(input, length, output);
453 void dense(
bool, Index_,
const std::vector<Index_>& indices,
const InputValue_* input, OutputValue_* output)
const {
454 core(input, indices.size(), output);
462 void sparse(
bool, Index_, Index_ number,
const InputValue_* input,
const Index_*, OutputValue_* output)
const {
463 core(input, number, output);
466 OutputValue_
fill(
bool, Index_)
const {
481template<
typename OutputValue_,
typename InputValue_,
typename Index_>
484 std::optional<Index_>
nrow()
const {
488 std::optional<Index_>
ncol()
const {
510 void core(
const InputValue_* input, Index_ length, OutputValue_* output)
const {
511 if constexpr(std::is_same<InputValue_, OutputValue_>::value) {
514 for (Index_ i = 0; i < length; ++i) {
515 output[i] = std::trunc(input[i]);
520 void dense(
bool, Index_, Index_, Index_ length,
const InputValue_* input, OutputValue_* output)
const {
521 core(input, length, output);
524 void dense(
bool, Index_,
const std::vector<Index_>& indices,
const InputValue_* input, OutputValue_* output)
const {
525 core(input, indices.size(), output);
533 void sparse(
bool, Index_, Index_ number,
const InputValue_* input,
const Index_*, OutputValue_* output)
const {
534 core(input, number, output);
537 OutputValue_
fill(
bool, Index_)
const {
553template<
typename OutputValue_,
typename InputValue_,
typename Index_,
typename Base_>
567 std::optional<Index_>
nrow()
const {
571 std::optional<Index_>
ncol()
const {
593 void core(
const InputValue_* input, Index_ length, OutputValue_* output)
const {
594 if constexpr(std::is_same<InputValue_, OutputValue_>::value) {
597 for (Index_ i = 0; i < length; ++i) {
598 output[i] = std::log1p(input[i]) / my_base;
605 void dense(
bool, Index_, Index_, Index_ length,
const InputValue_* input, OutputValue_* output)
const {
606 core(input, length, output);
609 void dense(
bool, Index_,
const std::vector<Index_>& indices,
const InputValue_* input, OutputValue_* output)
const {
610 core(input, indices.size(), output);
618 void sparse(
bool, Index_, Index_ number,
const InputValue_* input,
const Index_*, OutputValue_* output)
const {
619 core(input, number, output);
622 OutputValue_
fill(
bool, Index_)
const {
637template<
typename OutputValue_,
typename InputValue_,
typename Index_>
640 std::optional<Index_>
nrow()
const {
644 std::optional<Index_>
ncol()
const {
666 void core(
const InputValue_* input, Index_ length, OutputValue_* output)
const {
667 if constexpr(std::is_same<InputValue_, OutputValue_>::value) {
670 for (Index_ i = 0; i < length; ++i) {
671 output[i] = std::round(input[i]);
676 void dense(
bool, Index_, Index_, Index_ length,
const InputValue_* input, OutputValue_* output)
const {
677 core(input, length, output);
680 void dense(
bool, Index_,
const std::vector<Index_>& indices,
const InputValue_* input, OutputValue_* output)
const {
681 core(input, indices.size(), output);
689 void sparse(
bool, Index_, Index_ number,
const InputValue_* input,
const Index_*, OutputValue_* output)
const {
690 core(input, number, output);
693 OutputValue_
fill(
bool, Index_)
const {
708template<
typename OutputValue_,
typename InputValue_,
typename Index_>
711 std::optional<Index_>
nrow()
const {
715 std::optional<Index_>
ncol()
const {
737 void core(
const InputValue_* input, Index_ length, OutputValue_* output)
const {
738 if constexpr(std::is_same<InputValue_, OutputValue_>::value) {
741 for (Index_ i = 0; i < length; ++i) {
742 output[i] = std::exp(input[i]);
747 void dense(
bool, Index_, Index_, Index_ length,
const InputValue_* input, OutputValue_* output)
const {
748 core(input, length, output);
751 void dense(
bool, Index_,
const std::vector<Index_>& indices,
const InputValue_* input, OutputValue_* output)
const {
752 core(input, indices.size(), output);
760 void sparse(
bool, Index_, Index_ number,
const InputValue_* input,
const Index_*, OutputValue_* output)
const {
761 core(input, number, output);
764 OutputValue_
fill(
bool, Index_)
const {
779template<
typename OutputValue_,
typename InputValue_,
typename Index_>
782 std::optional<Index_>
nrow()
const {
786 std::optional<Index_>
ncol()
const {
808 void core(
const InputValue_* input, Index_ length, OutputValue_* output)
const {
809 if constexpr(std::is_same<InputValue_, OutputValue_>::value) {
812 for (Index_ i = 0; i < length; ++i) {
813 output[i] = std::expm1(input[i]);
818 void dense(
bool, Index_, Index_, Index_ length,
const InputValue_* input, OutputValue_* output)
const {
819 core(input, length, output);
822 void dense(
bool, Index_,
const std::vector<Index_>& indices,
const InputValue_* input, OutputValue_* output)
const {
823 core(input, indices.size(), output);
831 void sparse(
bool, Index_, Index_ number,
const InputValue_* input,
const Index_*, OutputValue_* output)
const {
832 core(input, number, output);
835 OutputValue_
fill(
bool, Index_)
const {
850template<
typename OutputValue_,
typename InputValue_,
typename Index_>
853 std::optional<Index_>
nrow()
const {
857 std::optional<Index_>
ncol()
const {
879 void core(
const InputValue_* input, Index_ length, OutputValue_* output)
const {
880 if constexpr(std::is_same<InputValue_, OutputValue_>::value) {
883 for (Index_ i = 0; i < length; ++i) {
884 output[i] = std::acos(input[i]);
889 void dense(
bool, Index_, Index_, Index_ length,
const InputValue_* input, OutputValue_* output)
const {
890 core(input, length, output);
893 void dense(
bool, Index_,
const std::vector<Index_>& indices,
const InputValue_* input, OutputValue_* output)
const {
894 core(input, indices.size(), output);
902 void sparse(
bool, Index_, Index_ number,
const InputValue_* input,
const Index_*, OutputValue_* output)
const {
903 core(input, number, output);
906 OutputValue_
fill(
bool, Index_)
const {
922template<
typename OutputValue_,
typename InputValue_,
typename Index_>
925 std::optional<Index_>
nrow()
const {
929 std::optional<Index_>
ncol()
const {
951 void core(
const InputValue_* input, Index_ length, OutputValue_* output)
const {
952 if constexpr(std::is_same<InputValue_, OutputValue_>::value) {
955 for (Index_ i = 0; i < length; ++i) {
956 output[i] = std::acosh(input[i]);
961 void dense(
bool, Index_, Index_, Index_ length,
const InputValue_* input, OutputValue_* output)
const {
962 core(input, length, output);
965 void dense(
bool, Index_,
const std::vector<Index_>& indices,
const InputValue_* input, OutputValue_* output)
const {
966 core(input, indices.size(), output);
974 void sparse(
bool, Index_, Index_ number,
const InputValue_* input,
const Index_*, OutputValue_* output)
const {
975 core(input, number, output);
978 OutputValue_
fill(
bool, Index_)
const {
980 return std::acosh(
static_cast<InputValue_
>(0));
994template<
typename OutputValue_,
typename InputValue_,
typename Index_>
997 std::optional<Index_>
nrow()
const {
1001 std::optional<Index_>
ncol()
const {
1002 return std::nullopt;
1023 void core(
const InputValue_* input, Index_ length, OutputValue_* output)
const {
1024 if constexpr(std::is_same<InputValue_, OutputValue_>::value) {
1027 for (Index_ i = 0; i < length; ++i) {
1028 output[i] = std::asin(input[i]);
1033 void dense(
bool, Index_, Index_, Index_ length,
const InputValue_* input, OutputValue_* output)
const {
1034 core(input, length, output);
1037 void dense(
bool, Index_,
const std::vector<Index_>& indices,
const InputValue_* input, OutputValue_* output)
const {
1038 core(input, indices.size(), output);
1046 void sparse(
bool, Index_, Index_ number,
const InputValue_* input,
const Index_*, OutputValue_* output)
const {
1047 core(input, number, output);
1050 OutputValue_
fill(
bool, Index_)
const {
1065template<
typename OutputValue_,
typename InputValue_,
typename Index_>
1068 std::optional<Index_>
nrow()
const {
1069 return std::nullopt;
1072 std::optional<Index_>
ncol()
const {
1073 return std::nullopt;
1094 void core(
const InputValue_* input, Index_ length, OutputValue_* output)
const {
1095 if constexpr(std::is_same<InputValue_, OutputValue_>::value) {
1098 for (Index_ i = 0; i < length; ++i) {
1099 output[i] = std::asinh(input[i]);
1104 void dense(
bool, Index_, Index_, Index_ length,
const InputValue_* input, OutputValue_* output)
const {
1105 core(input, length, output);
1108 void dense(
bool, Index_,
const std::vector<Index_>& indices,
const InputValue_* input, OutputValue_* output)
const {
1109 core(input, indices.size(), output);
1117 void sparse(
bool, Index_, Index_ number,
const InputValue_* input,
const Index_*, OutputValue_* output)
const {
1118 core(input, number, output);
1121 OutputValue_
fill(
bool, Index_)
const {
1136template<
typename OutputValue_,
typename InputValue_,
typename Index_>
1139 std::optional<Index_>
nrow()
const {
1140 return std::nullopt;
1143 std::optional<Index_>
ncol()
const {
1144 return std::nullopt;
1165 void core(
const InputValue_* input, Index_ length, OutputValue_* output)
const {
1166 if constexpr(std::is_same<InputValue_, OutputValue_>::value) {
1169 for (Index_ i = 0; i < length; ++i) {
1170 output[i] = std::atan(input[i]);
1175 void dense(
bool, Index_, Index_, Index_ length,
const InputValue_* input, OutputValue_* output)
const {
1176 core(input, length, output);
1179 void dense(
bool, Index_,
const std::vector<Index_>& indices,
const InputValue_* input, OutputValue_* output)
const {
1180 core(input, indices.size(), output);
1188 void sparse(
bool, Index_, Index_ number,
const InputValue_* input,
const Index_*, OutputValue_* output)
const {
1189 core(input, number, output);
1192 OutputValue_
fill(
bool, Index_)
const {
1207template<
typename OutputValue_,
typename InputValue_,
typename Index_>
1210 std::optional<Index_>
nrow()
const {
1211 return std::nullopt;
1214 std::optional<Index_>
ncol()
const {
1215 return std::nullopt;
1236 void core(
const InputValue_* input, Index_ length, OutputValue_* output)
const {
1237 if constexpr(std::is_same<InputValue_, OutputValue_>::value) {
1240 for (Index_ i = 0; i < length; ++i) {
1241 output[i] = std::atanh(input[i]);
1246 void dense(
bool, Index_, Index_, Index_ length,
const InputValue_* input, OutputValue_* output)
const {
1247 core(input, length, output);
1250 void dense(
bool, Index_,
const std::vector<Index_>& indices,
const InputValue_* input, OutputValue_* output)
const {
1251 core(input, indices.size(), output);
1259 void sparse(
bool, Index_, Index_ number,
const InputValue_* input,
const Index_*, OutputValue_* output)
const {
1260 core(input, number, output);
1263 OutputValue_
fill(
bool, Index_)
const {
1278template<
typename OutputValue_,
typename InputValue_,
typename Index_>
1281 std::optional<Index_>
nrow()
const {
1282 return std::nullopt;
1285 std::optional<Index_>
ncol()
const {
1286 return std::nullopt;
1307 void core(
const InputValue_* input, Index_ length, OutputValue_* output)
const {
1308 if constexpr(std::is_same<InputValue_, OutputValue_>::value) {
1311 for (Index_ i = 0; i < length; ++i) {
1312 output[i] = std::cos(input[i]);
1317 void dense(
bool, Index_, Index_, Index_ length,
const InputValue_* input, OutputValue_* output)
const {
1318 core(input, length, output);
1321 void dense(
bool, Index_,
const std::vector<Index_>& indices,
const InputValue_* input, OutputValue_* output)
const {
1322 core(input, indices.size(), output);
1330 void sparse(
bool, Index_, Index_ number,
const InputValue_* input,
const Index_*, OutputValue_* output)
const {
1331 core(input, number, output);
1334 OutputValue_
fill(
bool, Index_)
const {
1349template<
typename OutputValue_,
typename InputValue_,
typename Index_>
1352 std::optional<Index_>
nrow()
const {
1353 return std::nullopt;
1356 std::optional<Index_>
ncol()
const {
1357 return std::nullopt;
1378 void core(
const InputValue_* input, Index_ length, OutputValue_* output)
const {
1379 if constexpr(std::is_same<InputValue_, OutputValue_>::value) {
1382 for (Index_ i = 0; i < length; ++i) {
1383 output[i] = std::cosh(input[i]);
1388 void dense(
bool, Index_, Index_, Index_ length,
const InputValue_* input, OutputValue_* output)
const {
1389 core(input, length, output);
1392 void dense(
bool, Index_,
const std::vector<Index_>& indices,
const InputValue_* input, OutputValue_* output)
const {
1393 core(input, indices.size(), output);
1401 void sparse(
bool, Index_, Index_ number,
const InputValue_* input,
const Index_*, OutputValue_* output)
const {
1402 core(input, number, output);
1405 OutputValue_
fill(
bool, Index_)
const {
1420template<
typename OutputValue_,
typename InputValue_,
typename Index_>
1423 std::optional<Index_>
nrow()
const {
1424 return std::nullopt;
1427 std::optional<Index_>
ncol()
const {
1428 return std::nullopt;
1449 void core(
const InputValue_* input, Index_ length, OutputValue_* output)
const {
1450 if constexpr(std::is_same<InputValue_, OutputValue_>::value) {
1453 for (Index_ i = 0; i < length; ++i) {
1454 output[i] = std::sin(input[i]);
1459 void dense(
bool, Index_, Index_, Index_ length,
const InputValue_* input, OutputValue_* output)
const {
1460 core(input, length, output);
1463 void dense(
bool, Index_,
const std::vector<Index_>& indices,
const InputValue_* input, OutputValue_* output)
const {
1464 core(input, indices.size(), output);
1472 void sparse(
bool, Index_, Index_ number,
const InputValue_* input,
const Index_*, OutputValue_* output)
const {
1473 core(input, number, output);
1476 OutputValue_
fill(
bool, Index_)
const {
1491template<
typename OutputValue_,
typename InputValue_,
typename Index_>
1494 std::optional<Index_>
nrow()
const {
1495 return std::nullopt;
1498 std::optional<Index_>
ncol()
const {
1499 return std::nullopt;
1520 void core(
const InputValue_* input, Index_ length, OutputValue_* output)
const {
1521 if constexpr(std::is_same<InputValue_, OutputValue_>::value) {
1524 for (Index_ i = 0; i < length; ++i) {
1525 output[i] = std::sinh(input[i]);
1530 void dense(
bool, Index_, Index_, Index_ length,
const InputValue_* input, OutputValue_* output)
const {
1531 core(input, length, output);
1534 void dense(
bool, Index_,
const std::vector<Index_>& indices,
const InputValue_* input, OutputValue_* output)
const {
1535 core(input, indices.size(), output);
1543 void sparse(
bool, Index_, Index_ number,
const InputValue_* input,
const Index_*, OutputValue_* output)
const {
1544 core(input, number, output);
1547 OutputValue_
fill(
bool, Index_)
const {
1562template<
typename OutputValue_,
typename InputValue_,
typename Index_>
1565 std::optional<Index_>
nrow()
const {
1566 return std::nullopt;
1569 std::optional<Index_>
ncol()
const {
1570 return std::nullopt;
1591 void core(
const InputValue_* input, Index_ length, OutputValue_* output)
const {
1592 if constexpr(std::is_same<InputValue_, OutputValue_>::value) {
1595 for (Index_ i = 0; i < length; ++i) {
1596 output[i] = std::tan(input[i]);
1601 void dense(
bool, Index_, Index_, Index_ length,
const InputValue_* input, OutputValue_* output)
const {
1602 core(input, length, output);
1605 void dense(
bool, Index_,
const std::vector<Index_>& indices,
const InputValue_* input, OutputValue_* output)
const {
1606 core(input, indices.size(), output);
1614 void sparse(
bool, Index_, Index_ number,
const InputValue_* input,
const Index_*, OutputValue_* output)
const {
1615 core(input, number, output);
1618 OutputValue_
fill(
bool, Index_)
const {
1633template<
typename OutputValue_,
typename InputValue_,
typename Index_>
1636 std::optional<Index_>
nrow()
const {
1637 return std::nullopt;
1640 std::optional<Index_>
ncol()
const {
1641 return std::nullopt;
1662 void core(
const InputValue_* input, Index_ length, OutputValue_* output)
const {
1663 if constexpr(std::is_same<InputValue_, OutputValue_>::value) {
1666 for (Index_ i = 0; i < length; ++i) {
1667 output[i] = std::tanh(input[i]);
1672 void dense(
bool, Index_, Index_, Index_ length,
const InputValue_* input, OutputValue_* output)
const {
1673 core(input, length, output);
1676 void dense(
bool, Index_,
const std::vector<Index_>& indices,
const InputValue_* input, OutputValue_* output)
const {
1677 core(input, indices.size(), output);
1685 void sparse(
bool, Index_, Index_ number,
const InputValue_* input,
const Index_*, OutputValue_* output)
const {
1686 core(input, number, output);
1689 OutputValue_
fill(
bool, Index_)
const {
1704template<
typename OutputValue_,
typename InputValue_,
typename Index_>
1707 std::optional<Index_>
nrow()
const {
1708 return std::nullopt;
1711 std::optional<Index_>
ncol()
const {
1712 return std::nullopt;
1733 void core(
const InputValue_* input, Index_ length, OutputValue_* output)
const {
1734 if constexpr(std::is_same<InputValue_, OutputValue_>::value) {
1737 for (Index_ i = 0; i < length; ++i) {
1738 output[i] = std::tgamma(input[i]);
1743 void dense(
bool, Index_, Index_, Index_ length,
const InputValue_* input, OutputValue_* output)
const {
1744 core(input, length, output);
1747 void dense(
bool, Index_,
const std::vector<Index_>& indices,
const InputValue_* input, OutputValue_* output)
const {
1748 core(input, indices.size(), output);
1756 void sparse(
bool, Index_, Index_ number,
const InputValue_* input,
const Index_*, OutputValue_* output)
const {
1757 core(input, number, output);
1760 OutputValue_
fill(
bool, Index_)
const {
1762 return std::tgamma(
static_cast<InputValue_
>(0));
1776template<
typename OutputValue_,
typename InputValue_,
typename Index_>
1779 std::optional<Index_>
nrow()
const {
1780 return std::nullopt;
1783 std::optional<Index_>
ncol()
const {
1784 return std::nullopt;
1805 void core(
const InputValue_* input, Index_ length, OutputValue_* output)
const {
1806 if constexpr(std::is_same<InputValue_, OutputValue_>::value) {
1809 for (Index_ i = 0; i < length; ++i) {
1810 output[i] = std::lgamma(input[i]);
1815 void dense(
bool, Index_, Index_, Index_ length,
const InputValue_* input, OutputValue_* output)
const {
1816 core(input, length, output);
1819 void dense(
bool, Index_,
const std::vector<Index_>& indices,
const InputValue_* input, OutputValue_* output)
const {
1820 core(input, indices.size(), output);
1828 void sparse(
bool, Index_, Index_ number,
const InputValue_* input,
const Index_*, OutputValue_* output)
const {
1829 core(input, number, output);
1832 OutputValue_
fill(
bool, Index_)
const {
1834 return std::lgamma(
static_cast<InputValue_
>(0));
1842template<
typename OutputValue_ =
double,
typename InputValue_ =
double,
typename Index_ =
int>
1843using DelayedUnaryIsometricAbs = DelayedUnaryIsometricAbsHelper<OutputValue_, InputValue_, Index_>;
1845template<
typename OutputValue_ =
double,
typename InputValue_ =
double,
typename Index_ =
int>
1846using DelayedUnaryIsometricSign = DelayedUnaryIsometricSignHelper<OutputValue_, InputValue_, Index_>;
1848template<
typename OutputValue_ =
double,
typename InputValue_ =
double,
typename Index_ =
int,
typename Base_ = InputValue_>
1849using DelayedUnaryIsometricLog = DelayedUnaryIsometricLogHelper<OutputValue_, InputValue_, Index_, Base_>;
1851template<
typename OutputValue_ =
double,
typename InputValue_ =
double,
typename Index_ =
int>
1852using DelayedUnaryIsometricSqrt = DelayedUnaryIsometricSqrtHelper<OutputValue_, InputValue_, Index_>;
1854template<
typename OutputValue_ =
double,
typename InputValue_ =
double,
typename Index_ =
int>
1855using DelayedUnaryIsometricCeiling = DelayedUnaryIsometricCeilingHelper<OutputValue_, InputValue_, Index_>;
1857template<
typename OutputValue_ =
double,
typename InputValue_ =
double,
typename Index_ =
int>
1858using DelayedUnaryIsometricFloor = DelayedUnaryIsometricFloorHelper<OutputValue_, InputValue_, Index_>;
1860template<
typename OutputValue_ =
double,
typename InputValue_ =
double,
typename Index_ =
int>
1861using DelayedUnaryIsometricTrunc = DelayedUnaryIsometricTruncHelper<OutputValue_, InputValue_, Index_>;
1863template<
typename OutputValue_ =
double,
typename InputValue_ =
double,
typename Index_ =
int,
typename Base_ = InputValue_>
1864using DelayedUnaryIsometricLog1p = DelayedUnaryIsometricLog1pHelper<OutputValue_, InputValue_, Index_, Base_>;
1866template<
typename OutputValue_ =
double,
typename InputValue_ =
double,
typename Index_ =
int>
1867using DelayedUnaryIsometricRound = DelayedUnaryIsometricRoundHelper<OutputValue_, InputValue_, Index_>;
1869template<
typename OutputValue_ =
double,
typename InputValue_ =
double,
typename Index_ =
int>
1870using DelayedUnaryIsometricExp = DelayedUnaryIsometricExpHelper<OutputValue_, InputValue_, Index_>;
1872template<
typename OutputValue_ =
double,
typename InputValue_ =
double,
typename Index_ =
int>
1873using DelayedUnaryIsometricExpm1 = DelayedUnaryIsometricExpm1Helper<OutputValue_, InputValue_, Index_>;
1875template<
typename OutputValue_ =
double,
typename InputValue_ =
double,
typename Index_ =
int>
1876using DelayedUnaryIsometricAcos = DelayedUnaryIsometricAcosHelper<OutputValue_, InputValue_, Index_>;
1878template<
typename OutputValue_ =
double,
typename InputValue_ =
double,
typename Index_ =
int>
1879using DelayedUnaryIsometricAcosh = DelayedUnaryIsometricAcoshHelper<OutputValue_, InputValue_, Index_>;
1881template<
typename OutputValue_ =
double,
typename InputValue_ =
double,
typename Index_ =
int>
1882using DelayedUnaryIsometricAsin = DelayedUnaryIsometricAsinHelper<OutputValue_, InputValue_, Index_>;
1884template<
typename OutputValue_ =
double,
typename InputValue_ =
double,
typename Index_ =
int>
1885using DelayedUnaryIsometricAsinh = DelayedUnaryIsometricAsinhHelper<OutputValue_, InputValue_, Index_>;
1887template<
typename OutputValue_ =
double,
typename InputValue_ =
double,
typename Index_ =
int>
1888using DelayedUnaryIsometricAtan = DelayedUnaryIsometricAtanHelper<OutputValue_, InputValue_, Index_>;
1890template<
typename OutputValue_ =
double,
typename InputValue_ =
double,
typename Index_ =
int>
1891using DelayedUnaryIsometricAtanh = DelayedUnaryIsometricAtanhHelper<OutputValue_, InputValue_, Index_>;
1893template<
typename OutputValue_ =
double,
typename InputValue_ =
double,
typename Index_ =
int>
1894using DelayedUnaryIsometricCos = DelayedUnaryIsometricCosHelper<OutputValue_, InputValue_, Index_>;
1896template<
typename OutputValue_ =
double,
typename InputValue_ =
double,
typename Index_ =
int>
1897using DelayedUnaryIsometricCosh = DelayedUnaryIsometricCoshHelper<OutputValue_, InputValue_, Index_>;
1899template<
typename OutputValue_ =
double,
typename InputValue_ =
double,
typename Index_ =
int>
1900using DelayedUnaryIsometricSin = DelayedUnaryIsometricSinHelper<OutputValue_, InputValue_, Index_>;
1902template<
typename OutputValue_ =
double,
typename InputValue_ =
double,
typename Index_ =
int>
1903using DelayedUnaryIsometricSinh = DelayedUnaryIsometricSinhHelper<OutputValue_, InputValue_, Index_>;
1905template<
typename OutputValue_ =
double,
typename InputValue_ =
double,
typename Index_ =
int>
1906using DelayedUnaryIsometricTan = DelayedUnaryIsometricTanHelper<OutputValue_, InputValue_, Index_>;
1908template<
typename OutputValue_ =
double,
typename InputValue_ =
double,
typename Index_ =
int>
1909using DelayedUnaryIsometricTanh = DelayedUnaryIsometricTanhHelper<OutputValue_, InputValue_, Index_>;
1911template<
typename OutputValue_ =
double,
typename InputValue_ =
double,
typename Index_ =
int>
1912using DelayedUnaryIsometricGamma = DelayedUnaryIsometricGammaHelper<OutputValue_, InputValue_, Index_>;
1914template<
typename OutputValue_ =
double,
typename InputValue_ =
double,
typename Index_ =
int>
1915using DelayedUnaryIsometricLgamma = DelayedUnaryIsometricLgammaHelper<OutputValue_, InputValue_, Index_>;
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.