@@ -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