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
33#ifndef FIELD_CONCEPTS_TRAITS_HPP
34#define FIELD_CONCEPTS_TRAITS_HPP
41
42
43
44
45
46
51
52
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
156
157
158
159
160
161
162
163
164
169template <SignedIntType T>
173
174
175
176
177
178
179
180
181
186
187
188
189
190
191
192
193
194
200
201
202
203
204
205
206
207
208
209
210
211
212
213template <
typename T,
typename...
Types>
217
218
219
220
221
222
223#define MOD std::array
230template <FiniteFieldType B,
MOD modulus,
LutMode mode>
234template <FiniteFieldType MAIN, FiniteFieldType... OTHERS>
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262template <
typename A,
typename B>
268
269
270
271
272
273
274
275
276template <FiniteFieldType T>
301
302
303
304
305
306
307
308
309
310
311template <FiniteFieldType SUPERFIELD, FiniteFieldType SUBFIELD>
349template <FiniteFieldType SUP_MAIN, FiniteFieldType... SUP_OTHERS, FiniteFieldType SUB_MAIN,
350 FiniteFieldType... SUB_OTHERS>
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
405
406
407
408
409
410
411
412
413template <
typename S,
typename E>
419
420
421
422template <
typename... Types>
428
429
430
431
432template <
typename T,
typename List>
435template <
typename T,
typename... Types>
438template <
typename T,
typename List>
442
443
444
445
446template <
typename List1,
typename List2>
449template <
typename... Types1,
typename... Types2>
452 template <
typename T>
455 template <
typename... Lists>
458 template <
typename... Types>
463 template <
typename... Types1_,
typename... Types2_,
typename... Rest>
465 using type =
typename concat<
type_list<Types1_..., Types2_...>, Rest...>::type;
472template <
typename List1,
typename List2>
476
477
478
479
480template <
typename List1,
typename List2>
483template <
typename... Types1,
typename... Types2>
486 template <
typename T>
489 template <
typename... Lists>
492 template <
typename... Types>
497 template <
typename... Types1_,
typename... Types2_,
typename... Rest>
499 using type =
typename concat<
type_list<Types1_..., Types2_...>, Rest...>::type;
506template <
typename List1,
typename List2>
510
511
512
513template <
typename List>
521template <
typename T1,
typename T2,
typename... Rest>
530template <
typename List>
534
535
536
537
538
539
540
541
552template <FiniteFieldType B,
MOD modulus,
LutMode mode>
563template <
typename... Types>
576template <
typename T1,
typename T2,
typename... Rest>
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622template <
typename F,
typename G>
624 static_assert(F::get_characteristic() == G::get_characteristic(),
"Fields must have the same characteristic");
633 template <
typename T>
634 struct is_iso : std::false_type {};
647template <
typename F,
typename G>
651
652
653
654
655
656
657
658
666template <FiniteFieldType MAIN, FiniteFieldType... OTHERS>
674template <
typename T,
typename...
Types>
678
679
680
681
682
683
684
685template <
typename... Types>
687 if constexpr (
sizeof...(Types) <= 1) {
690 return []<
typename First,
typename... Rest>(std::type_identity<First>, std::type_identity<Rest>...) {
691 return details::is_distinct_from_all<First, Rest...> && pairwise_distinct<Rest...>();
692 }(std::type_identity<Types>{}...);
697
698
699
700
Extension field ๐ฝ_{q^m} โ
B[x]/(f(x)), constructed from a base field and an irreducible monic modulus...
Prime field ๐ฝ_p โ
โค/pโค
Single logical field unifying several pairwise-isomorphic representations.
Field of rational numbers โ = { p/q : p, q โ โค, q โ 0 } with selectable precision.
Tag base for the CRTP-protection idiom.
Mixin that deletes the copy operations and defaults the move operations.
NonCopyable(const NonCopyable &)=delete
NonCopyable & operator=(NonCopyable &&)=default
NonCopyable(NonCopyable &&)=default
constexpr NonCopyable()=default
NonCopyable & operator=(const NonCopyable &)=delete
T is identical to at least one of Types....
Admissible component type for CECCO::Vector, CECCO::Polynomial, CECCO::Matrix.
Inverse of SubfieldOf: ExtensionOf<S, E> iff SubfieldOf<E, S>.
Concept for field types: full algebraic interface.
Refines FieldType for finite fields ๐ฝ_{p^m}.
A and B are finite fields of the same size (and thus isomorphic).
Types whose operator== reflects mathematical equality.
Standard signed integers or InfInt for arbitrary precision.
SUBFIELD โ SUPERFIELD as constructed in this library (Iso paths included).
#define MOD
Alias for std::array, used to spell modulus polynomials in CECCO::Ext.
Contains implementation details not to be exposed to the user. Functions and classes here may change ...
constexpr bool contains_v
typename intersect_type_lists< List1, List2 >::type intersect_type_lists_t
typename largest_common_subfield< F, G >::type largest_common_subfield_t
constexpr bool is_subfield_of_v
constexpr bool is_distinct_from_all
True iff T is not the same as any of Types....
typename largest_field_in_list< List >::type largest_field_in_list_t
constexpr size_t degree_over_prime_v
typename collect_subfields< F >::type collect_subfields_t
constexpr bool pairwise_distinct()
True iff all types in the pack are pairwise distinct.
typename union_type_lists< List1, List2 >::type union_type_lists_t
Provides a framework for error correcting codes.
LutMode
LUT generation mode for field operations.
@ CompileTime
Generate LUTs at compile-time using constexpr (default).
@ RunTime
Generate LUTs at runtime using lazy initialization.
type_list< Fp< p > > type
All subfields of F (including F itself), as a type_list.
Check if a type exists in a type_list.
Total extension degree of T over its prime field.
Intersection of two type_lists.
Construction-based subfield test: SUBFIELD reachable by descending SUPERFIELD's tower.
Specialization of iso_info for Iso<MAIN, OTHERS...>.
static constexpr bool is_iso
Detect whether T is an Iso and expose its components.
static constexpr bool is_iso
Largest field that appears as a subfield of both F and G.
Find the largest field (by get_size()) in a type_list.
Compile-time type list utility for subfield calculations.
static constexpr size_t size
typename collect_subfields< T >::type type
Union of two type_lists (removes duplicates).