18namespace layer1_foundations {
19namespace ring_theory {
21static void make_linear_irreducible_polynomials(field_theory::finite_field *F,
int &nb,
22 int *&table,
int verbose_level);
46 for (i = 1; i <=
k; i++) {
59 int f_v = (verbose_level >= 1);
64 cout <<
"table_of_irreducible_polynomials::init" << endl;
70 cout <<
"table_of_irreducible_polynomials::init "
71 "k = " <<
k <<
" q = " <<
q << endl;
82 cout <<
"table_of_irreducible_polynomials::init "
83 "before make_linear_irreducible_polynomials" << endl;
85 make_linear_irreducible_polynomials(
F,
Nb_irred[1],
86 Tables[1], verbose_level - 2);
88 cout <<
"table_of_irreducible_polynomials::init "
89 "after make_linear_irreducible_polynomials" << endl;
94 for (d = 2; d <=
k; d++) {
96 cout <<
"table_of_irreducible_polynomials::init "
97 "degree " << d <<
" / " <<
k << endl;
102 cout <<
"table_of_irreducible_polynomials::init before "
103 "R.make_all_irreducible_polynomials_of_degree_d"
107 vector<vector<int>> T;
111 T, verbose_level - 2);
117 for (j = 0; j <= d; j++) {
118 Tables[d][i * (d + 1) + j] = T[i][j];
124 cout <<
"table_of_irreducible_polynomials::init after "
125 "R.make_all_irreducible_polynomials_of_degree_d"
131 cout <<
"table_of_irreducible_polynomials::init "
132 "Nb_irred[" << d <<
"]=" <<
Nb_irred[d] << endl;
137 cout <<
"table_of_irreducible_polynomials::init "
138 "k = " <<
k <<
" q = " <<
q
139 <<
" nb_irred = " <<
nb_irred << endl;
145 for (d = 1; d <=
k; d++) {
152 cout <<
"table_of_irreducible_polynomials::init "
153 "k = " <<
k <<
" q = " <<
q <<
" Degree = ";
164 for (d = 1; d <=
k; d++) {
171 poly, d, &
Tables[d][i * (d + 1)]);
174 cout <<
"table_of_irreducible_polynomials::init "
175 "polynomial " << i <<
" among "
176 "the list of polynomials of degree " << d
177 <<
" is not irreducible" << endl;
185 cout <<
"table_of_irreducible_polynomials::init done" << endl;
193 cout <<
"table_of_irreducible_polynomials::print "
194 "table of all irreducible polynomials:" << endl;
196 for (d = 1; d <=
k; d++) {
199 ost <<
"There are " << l <<
" irreducible polynomials of "
200 "degree " << d <<
":" << endl;
201 for (i = 0; i < l; i++) {
202 ost << j <<
" : " << i <<
" : ";
215 for (d = 1; d <=
k; d++) {
217 for (j = 0; j <= d; j++) {
218 ost <<
Tables[d][i * (d + 1) + j];
229 int *Select,
int verbose_level)
231 int f_v = (verbose_level >= 1);
235 cout <<
"table_of_irreducible_polynomials::select_polynomial_first" << endl;
238 for (i =
nb_irred - 1; i >= 0; i--) {
249 cout <<
"table_of_irreducible_polynomials::select_polynomial_first "
250 "returns TRUE" << endl;
256 cout <<
"table_of_irreducible_polynomials::select_polynomial_first "
257 "returns FALSE" << endl;
264 int *Select,
int verbose_level)
266 int f_v = (verbose_level >= 1);
267 int f_vv = (verbose_level >= 2);
271 cout <<
"table_of_irreducible_polynomials::select_polynomial_next" << endl;
273 k1 = Select[0] *
Degree[0];
287 cout <<
"table_of_irreducible_polynomials::select_polynomial_next "
288 "return FALSE" << endl;
293 cout <<
"k1=" << k1 << endl;
295 for (ii = i - 1; ii >= 0; ii--) {
301 cout <<
"Select[" << ii <<
"]=" << m
302 <<
", k1=" << k1 << endl;
306 cout <<
"table_of_irreducible_polynomials::select_polynomial_next "
307 "return FALSE" << endl;
312 k1 += Select[0] *
Degree[0];
316 cout <<
"table_of_irreducible_polynomials::select_polynomial_next "
317 "return FALSE" << endl;
324 int f_v = (verbose_level >= 1);
330 cout <<
"table_of_irreducible_polynomials::is_irreducible" << endl;
347 cout <<
"table_of_irreducible_polynomials::is_irreducible done" << endl;
355 int f_v = (verbose_level >= 1);
358 int i, d_poly, d, tt;
361 cout <<
"table_of_irreducible_polynomials::factorize_polynomial "
362 "k = " <<
k <<
" q = " <<
q << endl;
368 U.
assign(poly, Poly, verbose_level);
371 cout <<
"table_of_irreducible_polynomials::factorize_polynomial "
385 cout <<
"table_of_irreducible_polynomials::factorize_polynomial "
386 "trying irrducible poly " << i <<
" / " <<
nb_irred
387 <<
" of degree " << d << endl;
396 cout <<
"table_of_irreducible_polynomials::factorize_polynomial "
400 cout <<
"table_of_irreducible_polynomials::factorize_polynomial "
401 "before U.delete_object" << endl;
405 cout <<
"table_of_irreducible_polynomials::factorize_polynomial "
406 "polynomial coefficients: ";
411 cout <<
"table_of_irreducible_polynomials::factorize_polynomial "
412 "before U.create_object_of_degree_with_coefficients" << endl;
415 Tables[d] + tt * (d + 1));
418 cout <<
"table_of_irreducible_polynomials::factorize_polynomial "
419 "trial division by = ";
425 cout <<
"table_of_irreducible_polynomials::factorize_polynomial "
426 "after U.division_with_remainder" << endl;
437 cout <<
"table_of_irreducible_polynomials::factorize_polynomial "
438 "the polynomial divides" << endl;
443 cout <<
"table_of_irreducible_polynomials::factorize_polynomial "
444 "assigning Q to Poly" << endl;
446 U.
assign(Q, Poly, verbose_level);
448 cout <<
"table_of_irreducible_polynomials::factorize_polynomial "
449 "after assigning Q to Poly" << endl;
452 cout <<
"table_of_irreducible_polynomials::factorize_polynomial "
460 cout <<
"table_of_irreducible_polynomials::factorize_polynomial "
461 "the polynomial does not divide" << endl;
468 cout <<
"table_of_irreducible_polynomials::factorize_polynomial "
472 cout <<
"table_of_irreducible_polynomials::factorize_polynomial "
473 "remaining polynomial = ";
485 cout <<
"table_of_irreducible_polynomials::factorize_polynomial "
486 "k = " <<
k <<
" q = " <<
q <<
" done" << endl;
495 int *&table,
int verbose_level)
500 if (f_no_eigenvalue_one) {
503 for (i = 0; i < nb; i++) {
504 table[i * 2 + 0] = F.
negate(i + 2);
505 table[i * 2 + 1] = 1;
512 for (i = 0; i < nb; i++) {
513 table[i * 2 + 0] = F->
negate(i + 1);
514 table[i * 2 + 1] = 1;
a collection of combinatorial functions
global functions related to ring theory
void make_all_irreducible_polynomials_of_degree_d(field_theory::finite_field *F, int d, std::vector< std::vector< int > > &Table, int verbose_level)
~table_of_irreducible_polynomials()
void factorize_polynomial(unipoly_object &char_poly, int *Mult, int verbose_level)
void print(std::ostream &ost)
table_of_irreducible_polynomials()
void print_polynomials(std::ostream &ost)
field_theory::finite_field * F
int is_irreducible(unipoly_object &poly, int verbose_level)
int select_polynomial_next(int *Select, int verbose_level)
int select_polynomial_first(int *Select, int verbose_level)
void init(int k, field_theory::finite_field *F, int verbose_level)
domain of polynomials in one variable over a finite field
void delete_object(unipoly_object &p)
void create_object_of_degree_with_coefficients(unipoly_object &p, int d, int *coeff)
int is_zero(unipoly_object p)
void division_with_remainder(unipoly_object a, unipoly_object b, unipoly_object &q, unipoly_object &r, int verbose_level)
int degree(unipoly_object p)
void create_object_by_rank(unipoly_object &p, long int rk, const char *file, int line, int verbose_level)
void assign(unipoly_object a, unipoly_object &b, int verbose_level)
void print_object(unipoly_object p, std::ostream &ost)
#define Int_vec_zero(A, B)
#define Int_vec_print(A, B, C)
the orbiter library for the classification of combinatorial objects