Skip to content

Commit 9582940

Browse files
committed
exec_on_blocks -> Dirichlet helper
1 parent d771c0a commit 9582940

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

cp-algo/number_theory/dirichlet.hpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ namespace cp_algo::math {
2020
// Return the value to be saved in H[k]
2121
enum exec_mode { standard, reverse };
2222
template<exec_mode mode = standard>
23-
void exec_on_blocks(int64_t n, auto &H, auto const& F, auto const& G, auto &&callback) {
23+
void Dirichlet_helper(int64_t n, auto &H, auto const& F, auto const& G, auto &&callback) {
2424
auto [rt_n, num_floors] = floor_stats(n);
2525

2626
auto to_ord = [&](int64_t k) {
@@ -78,7 +78,7 @@ namespace cp_algo::math {
7878
auto m = size(F);
7979
std::decay_t<decltype(F)> H(m);
8080
H[1] = F[1] * G[1];
81-
exec_on_blocks(n, H, F, G, [&](auto k) {
81+
Dirichlet_helper(n, H, F, G, [&](auto k) {
8282
return H[k] + (F[k] - F[k-1]) * G[1] + (G[k] - G[k-1]) * F[1];
8383
});
8484
partial_sum(begin(H), end(H), begin(H));
@@ -90,7 +90,7 @@ namespace cp_algo::math {
9090
H[0] -= H[0];
9191
adjacent_difference(begin(H), end(H), begin(H));
9292
H[1] *= Gi;
93-
exec_on_blocks<reverse>(n, H, H, G, [&](auto k) {
93+
Dirichlet_helper<reverse>(n, H, H, G, [&](auto k) {
9494
return (Gi * (H[k] - (G[k] - G[k-1]) * H[1])) + H[k-1];
9595
});
9696
}

0 commit comments

Comments
 (0)