Skip to content

Commit d4836fa

Browse files
authored
Merge pull request #344 from hitonanode/clang-format-19
clang-format-19 対応
2 parents b1ad247 + a8c8b58 commit d4836fa

File tree

9 files changed

+19
-292
lines changed

9 files changed

+19
-292
lines changed

.github/workflows/formatter.yml

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -8,18 +8,19 @@ on:
88

99
jobs:
1010
build:
11-
runs-on: ubuntu-22.04
11+
runs-on: ubuntu-24.04
1212

1313
steps:
14-
- uses: actions/checkout@v3
14+
- uses: actions/checkout@v4
1515

1616
# https://apt.llvm.org/
17-
- name: Install clang-format-16
17+
- name: Install clang-format-19
1818
run: |
19-
wget -O - https://apt.llvm.org/llvm-snapshot.gpg.key|sudo apt-key add -
20-
sudo add-apt-repository 'deb http://apt.llvm.org/jammy/ llvm-toolchain-jammy-16 main'
19+
wget -O - https://apt.llvm.org/llvm-snapshot.gpg.key | sudo apt-key add -
20+
sudo add-apt-repository 'deb http://apt.llvm.org/noble/ llvm-toolchain-noble-19 main'
21+
sudo add-apt-repository 'deb-src http://apt.llvm.org/noble/ llvm-toolchain-noble-19 main'
2122
sudo apt-get update
22-
sudo apt-get install -y clang-format-16
23+
sudo apt-get install -y clang-format-19
2324
2425
- name: Check formatting
25-
run: find ./ -name "*.hpp" -o -name "*.cpp" -not -iwholename ".verify-helper*" | xargs clang-format-16 --dry-run --Werror -style=file
26+
run: find . -name "*.hpp" -o -name "*.cpp" -not -iwholename "*/.verify-helper/*" | xargs clang-format-19 --dry-run --Werror -style=file

Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
.PHONY: format
22

33
format:
4-
find ./ -name "*.hpp" -o -name "*.cpp" -not -iwholename ".verify-helper*" | xargs clang-format --Werror -i -style=file
4+
find . -name "*.hpp" -o -name "*.cpp" -not -iwholename "*/.verify-helper/*" | xargs clang-format --Werror -i -style=file

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,4 +36,4 @@ Except such snippets, the programs written by the owner of the repo is under the
3636

3737
## Formatting
3838

39-
`clang-format-16` is used to lint `.cpp` / `.hpp` files. Default configuration file is `.clang-format`. See [formatter.yml](.github/workflows/formatter.yml) for detail.
39+
`clang-format-19` is used to lint `.cpp` / `.hpp` files. Default configuration file is `.clang-format`. See [formatter.yml](.github/workflows/formatter.yml) for detail.

convolution/fft_double.hpp

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,16 +3,14 @@
33
#include <utility>
44
#include <vector>
55

6-
// CUT begin
76
// Convolution by FFT (Fast Fourier Transform)
87
// Algorithm based on http://kirika-comp.hatenablog.com/entry/2018/03/12/210446
98
// Verified: ATC001C (168 ms) https://atcoder.jp/contests/atc001/submissions/9243440
109
using cmplx = std::complex<double>;
1110
void fft(int N, std::vector<cmplx> &a, double dir) {
1211
int i = 0;
1312
for (int j = 1; j < N - 1; j++) {
14-
for (int k = N >> 1; k > (i ^= k); k >>= 1)
15-
;
13+
for (int k = N >> 1; k > (i ^= k); k >>= 1) {}
1614
if (j < i) std::swap(a[i], a[j]);
1715
}
1816

convolution/hadamard.hpp

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22
#include <cassert>
33
#include <vector>
44

5-
// CUT begin
65
// Fast Walsh-Hadamard transform and its abstraction
76
// Tutorials: <https://codeforces.com/blog/entry/71899>
87
// <https://csacademy.com/blog/fast-fourier-transform-and-variations-of-it>
@@ -11,7 +10,7 @@ template <typename T, typename F> void abstract_fwht(std::vector<T> &seq, F f) {
1110
assert(__builtin_popcount(n) == 1);
1211
for (int w = 1; w < n; w *= 2) {
1312
for (int i = 0; i < n; i += w * 2) {
14-
for (int j = 0; j < w; j++) { f(seq[i + j], seq[i + j + w]); }
13+
for (int j = 0; j < w; j++) f(seq.at(i + j), seq.at(i + j + w));
1514
}
1615
}
1716
}
@@ -26,7 +25,7 @@ std::vector<T> bitwise_conv(std::vector<T> x, std::vector<T> y, F1 f, F2 finv) {
2625
} else {
2726
abstract_fwht(x, f), abstract_fwht(y, f);
2827
}
29-
for (size_t i = 0; i < x.size(); i++) { x[i] *= y[i]; }
28+
for (int i = 0; i < (int)x.size(); i++) x.at(i) *= y.at(i);
3029
abstract_fwht(x, finv);
3130
return x;
3231
}
@@ -50,13 +49,11 @@ template <typename T> std::vector<T> xorconv(std::vector<T> x, std::vector<T> y)
5049
// bitwise AND conolution
5150
// ret[i] = \sum_{(j & k) == i} x[j] * y[k]
5251
template <typename T> std::vector<T> andconv(std::vector<T> x, std::vector<T> y) {
53-
return bitwise_conv(
54-
x, y, [](T &lo, T &hi) { lo += hi; }, [](T &lo, T &hi) { lo -= hi; });
52+
return bitwise_conv(x, y, [](T &lo, T &hi) { lo += hi; }, [](T &lo, T &hi) { lo -= hi; });
5553
}
5654

5755
// bitwise OR convolution
5856
// ret[i] = \sum_{(j | k) == i} x[j] * y[k]
5957
template <typename T> std::vector<T> orconv(std::vector<T> x, std::vector<T> y) {
60-
return bitwise_conv(
61-
x, y, [](T &lo, T &hi) { hi += lo; }, [](T &lo, T &hi) { hi -= lo; });
58+
return bitwise_conv(x, y, [](T &lo, T &hi) { hi += lo; }, [](T &lo, T &hi) { hi -= lo; });
6259
}

data_structure/rbst_fast.cpp

Lines changed: 0 additions & 268 deletions
This file was deleted.

flow/networksimplex.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1270,7 +1270,7 @@ template <typename Capacity = long long, typename Weight = long long> struct mcf
12701270
int E;
12711271
std::vector<std::vector<int>> in_eids, out_eids;
12721272
std::vector<std::pair<int, int>> arcs;
1273-
Digraph(int V = 0) : V(V), E(0), in_eids(V), out_eids(V){};
1273+
Digraph(int V = 0) : V(V), E(0), in_eids(V), out_eids(V) {};
12741274
int add_edge(int s, int t) {
12751275
assert(0 <= s and s < V);
12761276
assert(0 <= t and t < V);

multithread/multithread_example.cpp

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
using namespace std;
44
using pint = pair<int, int>;
55
#define FOR(i, begin, end) for (int i = (begin), i##_end_ = (end); i < i##_end_; i++)
6-
#define IFOR(i, begin, end) for (int i = (end)-1, i##_begin_ = (begin); i >= i##_begin_; i--)
6+
#define IFOR(i, begin, end) for (int i = (end) - 1, i##_begin_ = (begin); i >= i##_begin_; i--)
77
#define REP(i, n) FOR(i, 0, n)
88
#define IREP(i, n) IFOR(i, 0, n)
99
#define dbg(x) cerr << #x << " = " << (x) << " (L" << __LINE__ << ") " << __FILE__ << endl;
@@ -21,8 +21,7 @@ vector<string> ret;
2121
mutex mtx;
2222
vector<int> done;
2323

24-
void solve(int tc) { /* tc個目のテストケースを処理する関数 */
25-
}
24+
void solve(int tc) { /* tc個目のテストケースを処理する関数 */ }
2625

2726
void run() {
2827
/* 未完了で最も番号が若いテストケースを処理 */

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