Skip to content

Commit

Permalink
define custom maxn via CP_ALGO_MAXN
Browse files Browse the repository at this point in the history
  • Loading branch information
adamant-pwn committed Apr 30, 2024
1 parent e24a287 commit 5d053b9
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 0 deletions.
4 changes: 4 additions & 0 deletions cp-algo/algebra/common.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,11 @@
#include <functional>
#include <cstdint>
namespace cp_algo::algebra {
#ifdef CP_ALGO_MAXN
const int maxn = CP_ALGO_MAXN;
#else
const int maxn = 1 << 20;
#endif
const int magic = 250; // threshold for sizes to run the naive algo

auto bpow(auto const& x, int64_t n, auto const& one, auto op) {
Expand Down
1 change: 1 addition & 0 deletions verify/algebra/matrix/characteristic.test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
#define PROBLEM "https://judge.yosupo.jp/problem/characteristic_polynomial"
#pragma GCC optimize("Ofast,unroll-loops")
#pragma GCC target("avx2,tune=native")
#define CP_ALGO_MAXN 1 << 12
#include "cp-algo/linalg/frobenius.hpp"
#include <bits/stdc++.h>

Expand Down
1 change: 1 addition & 0 deletions verify/algebra/matrix/pow_fast.test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
#define PROBLEM "https://judge.yosupo.jp/problem/pow_of_matrix"
#pragma GCC optimize("Ofast,unroll-loops")
#pragma GCC target("avx2,tune=native")
#define CP_ALGO_MAXN 1 << 12
#include "cp-algo/linalg/frobenius.hpp"
#include <bits/stdc++.h>

Expand Down

0 comments on commit 5d053b9

Please sign in to comment.