Skip to content

Commit a03e963

Browse files
committed
demand maxn if use_bump_alloc is true
1 parent bc21b44 commit a03e963

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

cp-algo/math/factorials.hpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,9 @@
88
#include <ranges>
99

1010
namespace cp_algo::math {
11-
template<bool use_bump_alloc = false, int maxn = 100'000>
11+
template<bool use_bump_alloc = false, int maxn = -1>
1212
auto facts(auto const& args) {
13+
static_assert(!use_bump_alloc || maxn > 0, "maxn must be set if use_bump_alloc is true");
1314
constexpr int max_mod = 1'000'000'000;
1415
constexpr int accum = 4;
1516
constexpr int simd_size = 8;

verify/simd/many_facts.test.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ void solve() {
1515
vector<base> args(n);
1616
for(auto &x : args) {cin >> x;}
1717
cp_algo::checkpoint("read");
18-
auto res = facts(args);
18+
auto res = facts<true, 100'000>(args);
1919
for(auto it: res) {cout << it << "\n";}
2020
cp_algo::checkpoint("write");
2121
cp_algo::checkpoint<1>();

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy