generated from Tiphereth-A/TINplate
-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathtcgen.yml
303 lines (303 loc) · 9.13 KB
/
tcgen.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
mints:
# ascending order
# same priority <=> same category
priority: 0
# $m: member name
# $mb<idx>b: member name of requirement type <idx>
default_content:
requirements: null
include:
- src/code/math/mint.hpp
- src/code/math/mint_$m.hpp
after_include: |
using mint = tifa_libs::math::mint<tifa_libs::math::mint_$m, MOD>;
main_begin: null
member:
s30: null
s63: null
mintd:
priority: 0
default_content:
requirements: null
include:
- src/code/math/mint.hpp
- src/code/math/mint_$m.hpp
after_include: |
using mint = tifa_libs::math::mint<tifa_libs::math::mint_$m, __LINE__>;
main_begin: |
mint::set_mod(MOD);
member:
d31: null
d63: null
hash:
priority: 100
default_content:
requirements: null
include: null
after_include: |
template <class>
using hashfunc_t = void;
main_begin: null
member:
default: null
chash:
after_include: |
template <class T>
using hashfunc_t = chash<T>;
splitmix64:
include:
- src/code/edh/hash_splitmix64.hpp
after_include: |
template <class>
using hashfunc_t = tifa_libs::hash_splitmix64;
hashset:
priority: 200
default_content:
requirements:
- [hash]
include: null
after_include: null
main_begin: null
member:
std_hset:
after_include: |
template <class T>
using hashset = std::unordered_set<T, std::conditional_t<std::is_void_v<hashfunc_t<T>>, std::hash<T>, hashfunc_t<T>>>;
pbds_cc_hset:
after_include: |
template <class T>
using hashset = __gnu_pbds::cc_hash_table<T, __gnu_pbds::null_type, std::conditional_t<std::is_void_v<hashfunc_t<T>>, typename __gnu_pbds::detail::default_hash_fn<T>::type, hashfunc_t<T>>>;
pbds_gp_hset:
after_include: |
template <class T>
using hashset = __gnu_pbds::gp_hash_table<T, __gnu_pbds::null_type, std::conditional_t<std::is_void_v<hashfunc_t<T>>, typename __gnu_pbds::detail::default_hash_fn<T>::type, hashfunc_t<T>>>;
hashmap:
priority: 300
default_content:
requirements:
- [hash]
include: null
after_include: null
main_begin: null
member:
std_hmap:
after_include: |
template <class K, class V>
using hashmap = std::unordered_map<K, V, std::conditional_t<std::is_void_v<hashfunc_t<K>>, std::hash<K>, hashfunc_t<K>>>;
pbds_cc_hmap:
after_include: |
template <class K, class V>
using hashmap = __gnu_pbds::cc_hash_table<K, V, std::conditional_t<std::is_void_v<hashfunc_t<K>>, typename __gnu_pbds::detail::default_hash_fn<K>::type, hashfunc_t<K>>>;
pbds_gp_hmap:
after_include: |
template <class K, class V>
using hashmap = __gnu_pbds::gp_hash_table<K, V, std::conditional_t<std::is_void_v<hashfunc_t<K>>, typename __gnu_pbds::detail::default_hash_fn<K>::type, hashfunc_t<K>>>;
hashstr:
priority: 400
default_content:
requirements: null
include: null
after_include: null
main_begin: null
member:
hashstr1:
include:
- src/code/math/mint.hpp
- src/code/math/mint_2e61n1.hpp
- src/code/str/hash_substr.hpp
after_include: |
using mint = tifa_libs::math::mint<tifa_libs::math::mint_2e61n1>;
using hashstr = tifa_libs::str::hash_substr<mint>;
hashstr2s:
requirements:
- [mints]
include:
- src/code/str/hash_substr2.hpp
after_include: |
using mint0 = tifa_libs::math::mint<tifa_libs::math::mint_$mb0b, 998244353>;
using mint1 = tifa_libs::math::mint<tifa_libs::math::mint_$mb0b, 1000000007>;
using hashstr = tifa_libs::str::hash_substr2<mint0, mint1>;
hashstr2d:
requirements:
- [mintd]
include:
- src/code/str/hash_substr2.hpp
after_include: |
using mint0 = tifa_libs::math::mint<tifa_libs::math::mint_$mb0b, __LINE__>;
using mint1 = tifa_libs::math::mint<tifa_libs::math::mint_$mb0b, __LINE__>;
using hashstr = tifa_libs::str::hash_substr2<mint0, mint1>;
main_begin: |
mint0::set_mod(998244353);
mint1::set_mod(1000000007);
poly_anymod:
priority: 500
default_content:
requirements: null
include: null
after_include: null
main_begin: null
member:
p3ntt:
requirements:
- [mints, mintd]
- [mints] # `after_include` and `main_begin` will be ignored
include:
- src/code/poly/poly3ntt.hpp
after_include: |
using mint_$m1 = tifa_libs::math::mint<tifa_libs::math::mint_$mb1b, 167772161>;
using mint_$m2 = tifa_libs::math::mint<tifa_libs::math::mint_$mb1b, 469762049>;
using mint_$m3 = tifa_libs::math::mint<tifa_libs::math::mint_$mb1b, 754974721>;
using poly = tifa_libs::math::poly3ntt<mint, mint_$m1, mint_$m2, mint_$m3>;
pmtt:
requirements:
- [mints, mintd]
include:
- src/code/poly/polymtt.hpp
after_include: |
using poly = tifa_libs::math::polymtt<mint>;
poly_nttmod:
priority: 500
default_content:
requirements: null
include: null
after_include: null
main_begin: null
member:
pntt:
requirements:
- [mints]
include:
- src/code/poly/polyntt.hpp
after_include: |
using poly = tifa_libs::math::polyntt<mint>;
conv_anymod:
priority: 600
default_content:
requirements: null
include: null
after_include: null
main_begin: null
member:
3nttu64:
requirements:
- [mints]
include:
- src/code/conv/conv_3ntt.hpp
after_include: |
using mint_$m0 = tifa_libs::math::mint<tifa_libs::math::mint_$mb0b, 167772161>;
using mint_$m1 = tifa_libs::math::mint<tifa_libs::math::mint_$mb0b, 469762049>;
using mint_$m2 = tifa_libs::math::mint<tifa_libs::math::mint_$mb0b, 754974721>;
using ntt_$m0_t = tifa_libs::math::NTT<mint_$m0>;
using ntt_$m1_t = tifa_libs::math::NTT<mint_$m1>;
using ntt_$m2_t = tifa_libs::math::NTT<mint_$m2>;
using vec_t = vecuu;
auto conv_func(vec_t CR a, vec_t CR b) {
ntt_$m0_t ntt0;
ntt_$m1_t ntt1;
ntt_$m2_t ntt2;
return tifa_libs::math::conv_3ntt_u64(ntt0, ntt1, ntt2, a, b, MOD);
}
3ntt:
requirements:
- [mints, mintd]
- [mints] # `after_include` and `main_begin` will be ignored
include:
- src/code/conv/conv_3ntt.hpp
after_include: |
using mint_$m0 = tifa_libs::math::mint<tifa_libs::math::mint_$mb1b, 167772161>;
using mint_$m1 = tifa_libs::math::mint<tifa_libs::math::mint_$mb1b, 469762049>;
using mint_$m2 = tifa_libs::math::mint<tifa_libs::math::mint_$mb1b, 754974721>;
using ntt_$m0_t = tifa_libs::math::NTT<mint_$m0>;
using ntt_$m1_t = tifa_libs::math::NTT<mint_$m1>;
using ntt_$m2_t = tifa_libs::math::NTT<mint_$m2>;
using vec_t = vec<mint>;
auto conv_func(vec_t CR a, vec_t CR b) {
ntt_$m0_t ntt0;
ntt_$m1_t ntt1;
ntt_$m2_t ntt2;
return tifa_libs::math::conv_3ntt(ntt0, ntt1, ntt2, a, b);
}
mtt:
requirements:
- [mints, mintd]
include:
- src/code/conv/conv_mtt.hpp
after_include: |
using vec_t = vec<mint>;
auto conv_func(vec_t CR a, vec_t CR b) {
tifa_libs::math::FFT_R2<long double> fft;
return tifa_libs::math::conv_mtt(fft, a, b);
}
conv_nttmod:
priority: 600
default_content:
requirements: null
include: null
after_include: null
main_begin: null
member:
czt_nttmod:
requirements:
- [poly_nttmod]
include:
- src/code/conv/conv_czt.hpp
after_include: |
using vec_t = poly;
auto conv_func(vec_t CR a, vec_t CR b) {
return tifa_libs::math::conv_czt(a, b);
}
ntt:
requirements:
- [mints]
include:
- src/code/conv/conv_dft.hpp
- src/code/conv/ntt.hpp
after_include: |
using ntt_$m_t = tifa_libs::math::NTT<mint>;
using vec_t = vec<mint>;
auto conv_func(vec_t CR a, vec_t CR b) {
ntt_$m_t ntt;
return tifa_libs::math::conv_dft(ntt, a, b);
}
conv_large:
priority: 600
default_content:
requirements: null
include: null
after_include: null
main_begin: null
member:
ntt_large:
requirements:
- [mints]
include:
- src/code/conv/ntt.hpp
after_include: |
using ntt_$m_t = tifa_libs::math::NTT<mint>;
using vec_t = vec<mint>;
auto conv_func(vec_t CR a, vec_t CR b) {
ntt_$m_t ntt;
return tifa_libs::math::conv_ntt_large(ntt, a, b);
}
factorial:
priority: 700
default_content:
requirements: null
include: null
after_include: null
main_begin: null
member:
fact_helper:
requirements:
- [mints, mintd]
include:
- src/code/math/fact_helper.hpp
after_include: |
using fact_t = tifa_libs::math::fact_helper<mint>;
factl_helper:
requirements:
- [poly_anymod, poly_nttmod]
include:
- src/code/math/factl_helper.hpp
after_include: |
using fact_t = tifa_libs::math::factl_helper<poly>;