16namespace layer1_foundations {
17namespace ring_theory {
23 variable_name.assign(
"X");
35 unipoly_domain::F = F;
36 variable_name.assign(
"X");
48 int f_v = (verbose_level >= 1);
51 cout <<
"unipoly_domain::init_basic" << endl;
53 unipoly_domain::F = F;
54 variable_name.assign(
"X");
63 cout <<
"unipoly_domain::init_basic done" << endl;
69 int f_v = (verbose_level >= 1);
72 unipoly_domain::F = F;
73 variable_name.assign(
"X");
78 cout <<
"unipoly_domain::unipoly_domain creating factorring modulo " << endl;
85 variable_name.assign(
"X");
87 factor_degree = ((
int *)m)[0];
88 factor_coeffs =
NEW_int(factor_degree + 1);
89 for (i = 0; i <= factor_degree; i++) {
90 factor_coeffs[i] = ((
int *)m)[1 + i];
93 if (factor_coeffs[factor_degree] != 1) {
94 cout <<
"unipoly_domain::unipoly_domain "
95 "factor polynomial is not monic" << endl;
98 for (i = 0; i < factor_degree; i++) {
101 factor_coeffs[i] = b;
104 for (i = 0; i <= factor_degree; i++) {
105 ((
int *)factor_poly)[1 + i] = ((
int *)m)[1 + i];
109 cout <<
"unipoly_domain::unipoly_domain factor_coeffs = ";
120 cout <<
"unipoly_domain::unipoly_domain creating factorring done" << endl;
136 variable_name.assign(label);
141 int f_v = (verbose_level >= 1);
145 cout <<
"unipoly_domain::init_factorring creating factorring modulo ";
147 cout <<
" of degree " << ((
int *)m)[0] << endl;
149 unipoly_domain::F = F;
150 variable_name.assign(
"X");
152 factor_degree = ((
int *)m)[0];
153 factor_coeffs =
NEW_int(factor_degree + 1);
154 for (i = 0; i <= factor_degree; i++) {
155 factor_coeffs[i] = ((
int *)m)[1 + i];
158 if (factor_coeffs[factor_degree] != 1) {
159 cout <<
"unipoly_domain::init_factorring "
160 "factor polynomial is not monic" << endl;
163 for (i = 0; i < factor_degree; i++) {
164 a = factor_coeffs[i];
166 factor_coeffs[i] = b;
169 for (i = 0; i <= factor_degree; i++) {
170 ((
int *)factor_poly)[1 + i] = ((
int *)m)[1 + i];
174 cout <<
"unipoly_domain::init_factorring factor_coeffs = ";
180 cout <<
"unipoly_domain::init_factorring done" << endl;
196 cout <<
"unipoly_domain::create_object_of_degree "
197 "a factorring" << endl;
208 int *coeff = rep + 1;
211 for (i = 0; i <= d; i++) {
222 cout <<
"unipoly_domain::create_object_of_degree_with_coefficients a factorring" << endl;
230 for (i = 0; i <= d; i++) {
239 const char *file,
int line,
int verbose_level)
241 int f_v = (verbose_level >= 1);
245 cout <<
"unipoly_domain::create_object_by_rank rk=" << rk << endl;
246 cout <<
"unipoly_domain::create_object_by_rank f_factorring=" << f_factorring << endl;
252 if (len > factor_degree) {
253 cout <<
"unipoly_domain::create_object_by_rank "
254 "len > factor_degree" << endl;
258 cout <<
"unipoly_domain::create_object_by_rank modulo - (";
267 int *coeff = rep + 1;
270 for (i = 0; i < factor_degree; i++) {
271 coeff[i] = rk % F->
q;
274 rep[0] = factor_degree - 1;
280 int *coeff = rep + 1;
284 coeff[i] = rk % F->
q;
292 cout <<
"unipoly_domain::create_object_by_rank done" << endl;
298 const char *file,
int line,
301 int f_v = (verbose_level >= 1);
308 cout <<
"unipoly_domain::create_object_from_csv_file" << endl;
311 cout <<
"unipoly_domain::create_object_from_csv_file "
312 "f_factorring" << endl;
321 int *coeff = rep + 1;
324 for (i = 0; i < len; i++) {
325 coeff[len - 1 - i] = M[i];
335 const char *file,
int line,
338 int f_v = (verbose_level >= 1);
339 int f_vv = (verbose_level >= 2);
347 cout <<
"unipoly_domain::create_object_by_rank_longinteger rank=" <<
rank << endl;
350 if (len > factor_degree) {
351 cout <<
"unipoly_domain::create_object_by_rank_longinteger len > factor_degree" << endl;
355 cout <<
"unipoly_domain::create_object_by_rank_longinteger modulo - (";
365 int *coeff = rep + 1;
375 cout <<
"unipoly_domain::create_object_by_rank_longinteger "
376 "i=" << i <<
" rk=" << rk <<
" quotient " << rk1
377 <<
" remainder " << coeff[i] << endl;
391 int f_v = (verbose_level >= 1);
394 rank.create_from_base_10_string(rk);
398 cout <<
"unipoly_domain::create_object_by_rank_string ";
408 cout <<
"unipoly_domain::create_Dickson_polynomial "
409 "a factorring" << endl;
415 int *coeff = rep + 1;
425 int *rep = (
int *) p;
432 int *rep = (
int *) p;
433 int *coeff = rep + 1;
437 coeff[i] = rk % F->
q;
447 int *rep = (
int *) p;
448 int *coeff = rep + 1;
454 rank.assign_to(rank1);
467 int *rep = (
int *) p;
469 int *coeff = rep + 1;
473 for (i = d; i >= 0; i--) {
483 int *rep = (
int *) p;
485 int *coeff = rep + 1;
490 rk.
create(0, __FILE__, __LINE__);
491 q.
create(F->
q, __FILE__, __LINE__);
492 for (i = d; i >= 0; i--) {
494 c.
create(coeff[i], __FILE__, __LINE__);
504 int *rep = (
int *) p;
506 int *coeff = rep + 1;
509 for (i = d; i >= 0; i--) {
524 int f_nothing_printed_at_all =
TRUE;
525 int *rep = (
int *) p;
527 int *coeff = rep + 1;
529 x.assign(variable_name);
537 for (i = d; i >= 0; i--) {
542 f_nothing_printed_at_all =
FALSE;
546 if (k != 1 || (i == 0 )) {
566 ost <<
"{" << i <<
"}";
570 if (f_nothing_printed_at_all) {
580 int *rep = (
int *) p;
582 int *coeff = rep + 1;
585 for (i = 0; i <= d; i++) {
594 int *rep = (
int *) p;
596 int *coeff = rep + 1;
600 for (i = 0; i <= d; i++) {
610 ost << a <<
"," << i;
618 int *rep = (
int *) p;
620 int *coeff = rep + 1;
623 for (i = 0; i <= d; i++) {
637 int f_v = (verbose_level >= 1);
640 cout <<
"unipoly_domain::assign" << endl;
644 cout <<
"unipoly_domain::assign with factorring";
645 cout <<
" modulo - (";
652 cout <<
"unipoly_domain::assign with factorring a == NULL" << endl;
656 cout <<
"unipoly_domain::assign with factorring b == NULL" << endl;
661 if (rb[0] < factor_degree - 1) {
662 cout <<
"unipoly_domain::assign rb[0] < factor_degree - 1" << endl;
663 cout <<
"rb[0] = " << rb[0] << endl;
664 cout <<
"factor_degree = " << factor_degree << endl;
670 for (i = 0; i < factor_degree; i++) {
675 cout <<
"unipoly_domain::assign after copy" << endl;
680 cout <<
"unipoly_domain::assign not a factorring" << endl;
690 cout <<
"unipoly_domain::assign m=" << m << endl;
698 for (i = 0; i <= m; i++) {
701 cout <<
"i=" << i <<
" A[i]=" << A[i]
702 <<
" B[i]=" << B[i] << endl;
706 cout <<
"unipoly_domain::assign after copy" << endl;
710 cout <<
"unipoly_domain::assign done" << endl;
716 int *rep = (
int *) p;
718 int *coeff = rep + 1;
721 for (i = d; i >= 1; i--) {
730 int *rep = (
int *) p;
732 int *coeff = rep + 1;
735 for (i = d; i >= 1; i--) {
744 int *rep = (
int *) p;
746 int *coeff = rep + 1;
749 for (i = d; i >= 1; i--) {
758 int *rep = (
int *) p;
760 cout <<
"unipoly_domain::is_one rep == NULL" << endl;
764 int *coeff = rep + 1;
767 for (i = d; i >= 1; i--) {
780 int *rep = (
int *) p;
782 cout <<
"unipoly_domain::is_zero rep == NULL" << endl;
786 int *coeff = rep + 1;
789 for (i = d; i >= 0; i--) {
801 cout <<
"unipoly_domain::negate rep == NULL" << endl;
808 for (i = 0; i <= m; i++) {
817 cout <<
"unipoly_domain::make_monic rep == NULL" << endl;
824 while (A[m] == 0 && m > 0) {
827 if (m == 0 && A[0] == 0) {
828 cout <<
"unipoly_domain::make_monic "
829 "the polynomial is zero" << endl;
835 for (i = 0; i <= m; i++) {
836 A[i] = F->
mult(A[i], cv);
844 int verbose_level = 0;
845 int f_v = (verbose_level >= 1);
862 for (i = 0; i <=
MAXIMUM(m, n); i++) {
876 cout <<
"unipoly_domain::add "
877 "x=" << x <<
" y=" << y << endl;
887 int f_v = (verbose_level >= 1);
890 cout <<
"unipoly_domain::mult" << endl;
894 cout <<
"unipoly_domain::mult before mult_mod" << endl;
898 cout <<
"unipoly_domain::mult after mult_mod" << endl;
905 cout <<
"unipoly_domain::mult done" << endl;
913 int f_v = (verbose_level >= 1);
916 cout <<
"unipoly_domain::mult_mod" << endl;
920 int *factor_polynomial_coefficients_negated;
925 factor_polynomial_coefficients_negated =
NEW_int(d + 1);
926 for (i = 0; i <= d; i++) {
927 factor_polynomial_coefficients_negated[i] = F->
negate(
s_i(m, i));
932 factor_polynomial_coefficients_negated,
935 FREE_int(factor_polynomial_coefficients_negated);
938 cout <<
"unipoly_domain::mult_mod done" << endl;
944 int factor_polynomial_degree,
945 int *factor_polynomial_coefficients_negated,
948 int f_v = (verbose_level >= 1);
949 int f_vv = (verbose_level >= 2);
962 cout <<
"unipoly_domain::mult_mod_negated" << endl;
965 cout <<
"unipoly_domain::mult_mod_negated computing ";
969 cout <<
" modulo - (";
971 factor_polynomial_coefficients_negated,
972 factor_polynomial_degree + 1);
978 cout <<
"unipoly_domain::mult_mod_negated not a factorring" << endl;
982 if (rc[0] != factor_polynomial_degree - 1) {
984 rc =
NEW_int(factor_polynomial_degree - 1 + 2);
985 rc[0] = factor_polynomial_degree - 1;
989 for (j = 0 ; j < factor_polynomial_degree; j++) {
993 for (i = m; i >= 0; i--) {
994 for (j = 0; j <= n; j++) {
995 c1 = F->
mult(A[i], B[j]);
996 C[j] = F->
add(C[j], c1);
999 cout << A[i] <<
"x^" << i <<
" * "
1000 << B[j] <<
" x^" << j <<
" = "
1001 << c1 <<
" x^" << i + j <<
" = ";
1012 carry = C[factor_polynomial_degree - 1];
1013 for (j = factor_polynomial_degree - 1; j > 0; j--) {
1019 for (j = 0; j < factor_polynomial_degree; j++) {
1021 factor_polynomial_coefficients_negated[j]);
1025 for (j = 0; j < factor_polynomial_degree; j++) {
1027 factor_polynomial_coefficients_negated[j]);
1028 C[j] = F->
add(C[j], c1);
1036 cout <<
"unipoly_domain::mult_mod_negated done" << endl;
1044 int f_v = (verbose_level >= 1);
1048 cout <<
"unipoly_domain::Frobenius_matrix_by_rows" << endl;
1050 d =
degree(factor_polynomial);
1054 cout <<
"unipoly_domain::Frobenius_matrix_by_rows done" << endl;
1063 int f_v = (verbose_level >= 1);
1064 int f_vv = (verbose_level >= 2);
1068 cout <<
"unipoly_domain::Frobenius_matrix" << endl;
1071 cout <<
"unipoly_domain::Frobenius_matrix "
1072 "q=" << F->
q << endl;
1075 if (!f_factorring) {
1076 cout <<
"unipoly_domain::Frobenius_matrix "
1077 "not a factorring" << endl;
1083 int factor_polynomial_degree;
1085 factor_polynomial_degree =
degree(factor_polynomial);
1087 cout <<
"unipoly_domain::Frobenius_matrix "
1088 "degree=" << factor_polynomial_degree << endl;
1089 cout <<
"unipoly_domain::Frobenius_matrix m = ";
1094 Frob =
NEW_int(factor_polynomial_degree * factor_polynomial_degree);
1096 factor_polynomial_degree * factor_polynomial_degree);
1106 assign(factor_polynomial, m_mod, 0 );
1109 cout <<
"unipoly_domain::Frobenius_matrix m_mod = ";
1115 cout <<
"unipoly_domain::Frobenius_matrix before power_int" << endl;
1119 cout <<
"unipoly_domain::Frobenius_matrix after power_int" << endl;
1120 cout <<
"unipoly_domain::Frobenius_matrix a = x^q = ";
1125 cout <<
"unipoly_domain::Frobenius_matrix before division_with_remainder" << endl;
1131 cout <<
"unipoly_domain::Frobenius_matrix after division_with_remainder" << endl;
1135 cout <<
"unipoly_domain::Frobenius_matrix "
1136 "a(X) = X^q mod m(X) = ";
1140 for (j = 1; j < factor_polynomial_degree; j++) {
1142 cout <<
"unipoly_domain::Frobenius_matrix j = " << j << endl;
1151 factor_polynomial_degree, ((
int *)m_mod) + 1, 0);
1160 cout <<
"unipoly_domain::Frobenius_matrix X^{" << j <<
"*q}=";
1165 int *rb = (
int *) b;
1169 for (i = 0; i <= d1; i++) {
1170 Frob[i * factor_polynomial_degree + j] = B[i];
1174 cout <<
"unipoly_domain::Frobenius_matrix=" << endl;
1176 factor_polynomial_degree, factor_polynomial_degree);
1186 cout <<
"unipoly_domain::Frobenius_matrix done" << endl;
1194 int f_v = (verbose_level >= 1);
1196 int factor_polynomial_degree;
1199 cout <<
"unipoly_domain::Berlekamp_matrix" << endl;
1201 factor_polynomial_degree =
degree(factor_polynomial);
1203 cout <<
"unipoly_domain::Berlekamp_matrix before Frobenius_matrix" << endl;
1207 cout <<
"unipoly_domain::Berlekamp_matrix after Frobenius_matrix" << endl;
1208 cout <<
"Frobenius matros:" << endl;
1210 factor_polynomial_degree, factor_polynomial_degree);
1214 for (i = 0; i < factor_polynomial_degree; i++) {
1215 a = B[i * factor_polynomial_degree + i];
1217 B[i * factor_polynomial_degree + i] = b;
1220 cout <<
"unipoly_domain::Berlekamp_matrix "
1221 "of degree " << factor_polynomial_degree
1224 factor_polynomial_degree, factor_polynomial_degree);
1233 int f_v = (verbose_level >= 1);
1236 cout <<
"unipoly_domain::exact_division" << endl;
1248 cout <<
"unipoly_domain::exact_division done" << endl;
1257 int f_v = (verbose_level >= 1);
1259 int *rb = (
int *) b;
1266 cout <<
"unipoly_domain::division_with_remainder" << endl;
1272 cout <<
"unipoly_domain::division_with_remainder "
1273 "not good for a factorring" << endl;
1278 cout <<
"unipoly_domain::division_with_remainder: "
1279 "division by zero" << endl;
1284 int *rq = (
int *) q;
1297 int *rq = (
int *) q;
1304 int *rr = (
int *) r;
1309 int i, j, ii, jj, pivot, pivot_inv, x, c, d;
1312 pivot_inv = F->
inverse(pivot);
1316 for (i = da, j = dq; i >= db; i--, j--) {
1318 c = F->
mult(x, pivot_inv);
1322 for (ii = i, jj = db; jj >= 0; ii--, jj--) {
1325 R[ii] = F->
add(d, R[ii]);
1328 cout <<
"unipoly::division_with_remainder: R[i] != 0" << endl;
1343 cout <<
"unipoly_domain::division_with_remainder done" << endl;
1349 int *ra = (
int *) a;
1352 int *rb = (
int *) b;
1358 for (i = 1; i <= d; i++) {
1361 bi = F->
mult(ai, bi);
1386 int f_v = (verbose_level >= 1);
1387 int f_vv = (verbose_level >= 2);
1391 cout <<
"unipoly::greatest_common_divisor m=";
1398 cout <<
"unipoly::greatest_common_divisor before compare_euclidean" << endl;
1402 cout <<
"unipoly::greatest_common_divisor compare_euclidean returns " << c << endl;
1411 cout <<
"unipoly::greatest_common_divisor of m=";
1434 cout <<
"unipoly::greatest_common_divisor M=";
1442 cout <<
"unipoly::greatest_common_divisor Q=";
1459 cout <<
"unipoly::greatest_common_divisor g=";
1470 cout <<
"unipoly::greatest_common_divisor of m=";
1479 cout <<
"unipoly::greatest_common_divisor done" << endl;
1489 int f_v = (verbose_level >= 1);
1490 int f_vv = (verbose_level >= 2);
1494 cout <<
"unipoly::extended_gcd" << endl;
1507 cout <<
"unipoly::extended_gcd done" << endl;
1518 cout <<
"unipoly::extended_gcd done" << endl;
1564 mult(Q, u2, tmp, verbose_level - 1);
1568 mult(Q, v2, tmp, verbose_level - 1);
1603 cout <<
"unipoly::extended_gcd done" << endl;
1609 int f_v = (verbose_level >= 1);
1610 int f_vv = (verbose_level >= 2);
1615 cout <<
"unipoly::is_squarefree" << endl;
1625 cout <<
"unipoly::is_squarefree before derivative" << endl;
1629 cout <<
"unipoly::is_squarefree after derivative" << endl;
1632 cout <<
"unipoly::is_squarefree derivative p' = ";
1637 cout <<
"unipoly::is_squarefree before extended_gcd" << endl;
1641 cout <<
"unipoly::is_squarefree after extended_gcd" << endl;
1644 cout <<
"unipoly::is_squarefree gcd(p, p') = ";
1657 cout <<
"unipoly::is_squarefree done" << endl;
1668 int *Normal_basis,
int *Frobenius,
1671 int f_v = (verbose_level >= 1);
1672 int f_vv = (verbose_level >= 2);
1673 int *v, *b, *A, deg;
1678 cout <<
"unipoly_domain::compute_normal_basis "
1697 cout <<
"unipoly_domain::compute_normal_basis before order_ideal_generator" << endl;
1701 verbose_level - 10);
1703 cout <<
"unipoly_domain::compute_normal_basis after order_ideal_generator" << endl;
1707 cout <<
"unipoly_domain::compute_normal_basis "
1708 "Ideal(e_" << i <<
") = (";
1710 cout <<
")" << endl;
1715 while (
degree(mue) < deg) {
1718 cout <<
"unipoly_domain::compute_normal_basis "
1719 "i = " << i <<
" / " << deg << endl;
1723 cout <<
"unipoly_domain::compute_normal_basis "
1724 "error: i == deg" << endl;
1729 cout <<
"unipoly_domain::compute_normal_basis "
1730 "before order_ideal_generator" << endl;
1734 verbose_level - 10);
1736 cout <<
"unipoly_domain::compute_normal_basis "
1737 "after order_ideal_generator" << endl;
1740 cout <<
"unipoly_domain::compute_normal_basis "
1741 "Ideal(e_" << i <<
") = ( lambda ), "
1745 cout <<
"unipoly_domain::compute_normal_basis "
1746 "Ideal(e_1,..,e_" << i - 1 <<
") = ( mue ), "
1756 cout <<
"unipoly_domain::compute_normal_basis "
1757 "computing greatest_common_divisor(mue, lambda):" << endl;
1762 cout <<
"unipoly_domain::compute_normal_basis "
1763 "greatest_common_divisor(mue, lambda) = ";
1776 cout <<
"unipoly_domain::compute_normal_basis "
1777 "Q = lambda / GCD = ";
1785 cout <<
"unipoly_domain::compute_normal_basis "
1786 "R = take_away_all_factors_from_b(mue, Q) = ";
1793 cout <<
"unipoly_domain::compute_normal_basis "
1801 cout <<
"unipoly_domain::compute_normal_basis "
1802 "before module_structure_apply" << endl;
1806 cout <<
"unipoly_domain::compute_normal_basis "
1807 "after module_structure_apply" << endl;
1816 cout <<
"unipoly_domain::compute_normal_basis "
1825 cout <<
"unipoly_domain::compute_normal_basis "
1826 "R1 = take_away_all_factors_from_b(lambda, Q) = ";
1834 cout <<
"unipoly_domain::compute_normal_basis "
1835 "greatest_common_divisor(R, R1) = ";
1843 cout <<
"unipoly_domain::compute_normal_basis "
1855 cout <<
"unipoly_domain::compute_normal_basis "
1856 "Q = lambda / R2 = ";
1862 cout <<
"unipoly_domain::compute_normal_basis "
1863 "before module_structure_apply" << endl;
1866 Frobenius, deg, Q, 0 );
1868 cout <<
"unipoly_domain::compute_normal_basis "
1869 "after module_structure_apply" << endl;
1875 for (j = 0; j < deg; j++) {
1876 v[j] = F->
add(v[j], b[j]);
1882 mult(R, R2, mue, 0 );
1885 cout <<
"unipoly_domain::compute_normal_basis "
1886 "Ideal(e_1,..,e_" << i <<
") = ( mue ), where mue = ";
1893 cout <<
"unipoly_domain::compute_normal_basis "
1900 cout <<
"unipoly_domain::compute_normal_basis "
1901 "before span_cyclic_module" << endl;
1904 v, deg, Frobenius, 0 );
1906 cout <<
"unipoly_domain::compute_normal_basis "
1907 "after span_cyclic_module" << endl;
1911 cout <<
"unipoly_domain::compute_normal_basis "
1912 "Normal_basis = " << endl;
1930 cout <<
"unipoly_domain::compute_normal_basis done" << endl;
1936 int *A,
int *Frobenius,
1942 int f_v = (verbose_level >= 1);
1943 int *my_mue, mue_deg;
1946 cout <<
"unipoly_domain::order_ideal_generator "
1947 "d=" << d <<
" idx = " << idx << endl;
1954 cout <<
"unipoly_domain::order_ideal_generator "
1955 "before F->order_ideal_generator" << endl;
1961 cout <<
"unipoly_domain::order_ideal_generator "
1962 "after F->order_ideal_generator" << endl;
1966 int *Mue = (
int *) mue;
1972 for (i = 0; i <= mue_deg; i++) {
1982 cout <<
"unipoly_domain::order_ideal_generator "
1983 "d=" << d <<
" idx = " << idx <<
" testing" << endl;
1995 cout <<
"unipoly_domain::order_ideal_generator "
1996 "before module_structure_apply" << endl;
1999 Frobenius, d, mue, 0 );
2001 cout <<
"unipoly_domain::order_ideal_generator "
2002 "after module_structure_apply" << endl;
2004 for (i = 0; i < d; i++) {
2006 cout <<
"unipoly_domain::order_ideal_generator "
2007 "d=" << d <<
" idx = " << idx <<
" test fails, v=" << endl;
2015 cout <<
"unipoly_domain::order_ideal_generator "
2016 "d=" << d <<
" idx = " << idx <<
" test passed" << endl;
2020 cout <<
"unipoly_domain::order_ideal_generator done" << endl;
2025 int *Mtx,
int n,
int verbose_level)
2028 int f_v = (verbose_level >= 1);
2033 cout <<
"unipoly_domain::matrix_apply" << endl;
2040 cout <<
"unipoly_domain::matrix_apply d >= n" << endl;
2043 for (i = 0; i <= d; i++) {
2044 v1[i] = ((
int *)p)[1 + i];
2046 for ( ; i < n; i++) {
2050 cout <<
"unipoly_domain::matrix_apply v1 = ";
2056 cout <<
"unipoly_domain::matrix_apply v2 = ";
2063 for (i = 0; i < n; i++) {
2064 ((
int *)p)[1 + i] = v2[i];
2072 cout <<
"unipoly_domain::matrix_apply done" << endl;
2081 int f_v = (verbose_level >= 1);
2083 int i, j, h, c, d, *P, *coeffs;
2086 cout <<
"unipoly_domain::substitute_matrix_in_polynomial" << endl;
2095 for (i = 0; i < k * k; i++) {
2096 M1[i] = F->
mult(c, Mtx_in[i]);
2098 for (h--; h >= 0; h--) {
2100 for (i = 0; i < k; i++) {
2101 for (j = 0; j < k; j++) {
2103 M2[i * k + j] = F->
add(c, M1[i * k + j]);
2106 M2[i * k + j] = M1[i * k + j];
2123 cout <<
"unipoly_domain::substitute_matrix_in_polynomial done" << endl;
2132 int f_v = (verbose_level >= 1);
2134 int h, c, d, *P, *coeffs;
2137 cout <<
"unipoly_domain::substitute_scalar_in_polynomial" << endl;
2144 m1 = F->
mult(c, scalar);
2145 for (h--; h >= 0; h--) {
2149 m1 = F->
mult(m2, scalar);
2156 cout <<
"unipoly_domain::substitute_scalar_in_polynomial done" << endl;
2168 int f_v = (verbose_level >= 1);
2169 int f_vv = (verbose_level >= 2);
2174 cout <<
"unipoly_domain::module_structure_apply" << endl;
2177 cout <<
"unipoly_domain::module_structure_apply "
2178 "applying p=" << endl;
2192 pp = ((
int *)p) + 1;
2195 for (j = 0; j < n; j++) {
2196 v1[j] = F->
mult(v1[j], c);
2201 cout <<
"unipoly_domain::module_structure_apply "
2202 "p is not monic, leading coefficient is "
2207 for (i = d - 1; i >= 0; i--) {
2209 cout <<
"unipoly_domain::module_structure_apply "
2210 "i = " << i << endl;
2211 cout <<
"unipoly_domain::module_structure_apply "
2220 cout <<
"unipoly_domain::module_structure_apply "
2221 "i = " << i << endl;
2222 cout <<
"unipoly_domain::module_structure_apply "
2232 cout <<
"unipoly_domain::module_structure_apply "
2234 cout <<
" c = " << c << endl;
2236 for (j = 0; j < n; j++) {
2237 v1[j] = F->
add(F->
mult(v[j], c), v2[j]);
2241 cout <<
"unipoly_domain::module_structure_apply "
2242 "i = " << i << endl;
2243 cout <<
"unipoly_domain::module_structure_apply "
2251 for (j = 0; j < n; j++) {
2259 cout <<
"unipoly_domain::module_structure_apply done" << endl;
2279 int f_v = (verbose_level >= 1);
2282 cout <<
"unipoly_domain::take_away_all_factors_from_b" << endl;
2292 assign(a, A, verbose_level);
2306 assign(A, a_without_b, 0 );
2313 cout <<
"unipoly_domain::take_away_all_factors_from_b done" << endl;
2320 int f_v = (verbose_level >= 1);
2321 int f_vv = (verbose_level >= 2);
2325 int factor_polynomial_degree;
2328 cout <<
"unipoly_domain::is_irreducible" << endl;
2330 factor_polynomial_degree =
degree(a);
2333 cout <<
"unipoly_domain::is_irreducible before is_squarefree" << endl;
2337 cout <<
"unipoly_domain::is_irreducible is not squarefree" << endl;
2342 cout <<
"unipoly_domain::is_irreducible is squarefree" << endl;
2348 cout <<
"unipoly_domain::is_irreducible before Berlekamp_matrix" << endl;
2352 cout <<
"unipoly_domain::is_irreducible after Berlekamp_matrix" << endl;
2355 cout <<
"unipoly_domain::is_irreducible Berlekamp_matrix=" << endl;
2359 base_cols =
NEW_int(factor_polynomial_degree);
2366 factor_polynomial_degree, factor_polynomial_degree,
2370 cout <<
"unipoly_domain::is_irreducible Berlekamp_matrix has rank " << r << endl;
2376 if (r == factor_polynomial_degree - 1) {
2383 cout <<
"unipoly_domain::is_irreducible done" << endl;
2389 int p,
int d,
int b,
int a)
2392 int *M = ((
int *)m) + 1;
2411 int f_v = (verbose_level >= 1);
2418 cout <<
"unipoly_domain::is_primitive" << endl;
2425 cout <<
"unipoly_domain::is_primitive "
2426 "q=" << F->
q << endl;
2433 cout <<
"primes:" << endl;
2435 cout << i <<
" : " << primes[i] << endl;
2442 cout <<
"unipoly_domain::is_primitive testing prime " << i <<
" / "
2443 <<
nb_primes <<
" which is " << primes[i] << endl;
2449 cout <<
"qm1 / " << primes[i] <<
" = "
2450 << qm1_over_p <<
" remainder " << r << endl;
2453 cout <<
"unipoly_domain::is_primitive "
2454 "the prime does not divide!" << endl;
2455 cout <<
"qm1=" << qm1 << endl;
2456 cout <<
"primes[i]=" << primes[i] << endl;
2457 cout <<
"qm1_over_p=" << qm1_over_p << endl;
2458 cout <<
"r=" << r << endl;
2468 cout <<
"unipoly_domain::is_primitive X^" << qm1_over_p <<
" mod ";
2477 cout <<
"unipoly_domain::is_primitive is one, hence m is not primitive" << endl;
2487 cout <<
"unipoly_domain::is_primitive ";
2490 cout <<
" is primitive" << endl;
2494 for (i = 0; i <= qm1.
as_int(); i++) {
2498 cout <<
"X^" << u <<
" = ";
2507 cout <<
"unipoly_domain::is_primitive done" << endl;
2514 int f,
int verbose_level)
2516 int f_v = (verbose_level >= 1);
2517 int f_vv = (verbose_level >= 2);
2527 cout <<
"unipoly::get_a_primitive_polynomial" << endl;
2528 cout <<
"Searching for a primitive polynomial of degree " << f <<
2529 " over GF(" << F->
q <<
")" << endl;
2532 q.
create(p, __FILE__, __LINE__);
2533 m1.
create(-1, __FILE__, __LINE__);
2537 cout <<
"unipoly_domain::get_a_primitive_polynomial factoring " << qm1 << endl;
2540 primes, exponents, verbose_level - 2);
2542 cout <<
"unipoly_domain::get_a_primitive_polynomial after factoring "
2543 << qm1 <<
" nb_primes=" <<
nb_primes << endl;
2544 cout <<
"primes:" << endl;
2546 cout << i <<
" : " << primes[i] << endl;
2550 cout <<
"unipoly_domain::get_a_primitive_polynomial "
2551 "before F->primitive_root" << endl;
2555 cout <<
"unipoly_domain::get_a_primitive_polynomial "
2556 "a primitive root is " << a << endl;
2559 for (b = 0; b < p; b++) {
2562 cout <<
"singer candidate ";
2568 cout <<
"IS irreducible" << endl;
2572 cout <<
"OK, we found an irreducible "
2573 "and primitive polynomial ";
2579 cout <<
"before delete_object(x)" << endl;
2583 cout <<
"before FREE_OBJECTS(primes)" << endl;
2587 cout <<
"before FREE_int(exponents)" << endl;
2594 cout <<
"is not primitive" << endl;
2600 cout <<
"is not irreducible" << endl;
2606 low.
create(F->
q, __FILE__, __LINE__);
2607 one.create(1, __FILE__, __LINE__);
2610 D.
mult(low, low, high);
2619 cout <<
"candidate " << current <<
" : ";
2625 cout <<
"is irreducible" << endl;
2628 primes, verbose_level - 1)) {
2630 cout <<
"is irreducible and primitive" << endl;
2633 cout <<
"unipoly::get_a_primitive_polynomial ";
2639 cout <<
"before delete_object(x)" << endl;
2643 cout <<
"before FREE_OBJECTS(primes)" << endl;
2647 cout <<
"before FREE_int(exponents)" << endl;
2654 cout <<
"is not primitive" << endl;
2661 cout <<
"is not irreducible" << endl;
2667 D.
add(current,
one, tmp);
2670 if (D.
compare(current, high) == 0) {
2671 cout <<
"unipoly::get_an_irreducible_polynomial "
2672 "did not find an irreducible polynomial" << endl;
2680 int f,
int verbose_level)
2682 int f_v = (verbose_level >= 1);
2683 int f_vv = (verbose_level >= 2);
2689 cout <<
"unipoly::get_an_irreducible_polynomial" << endl;
2690 cout <<
"Searching for an irreducible polynomial "
2691 "of degree " << f <<
2692 " over GF(" << F->
q <<
")" << endl;
2694 low.
create(F->
q, __FILE__, __LINE__);
2695 one.create(1, __FILE__, __LINE__);
2698 D.
mult(low, low, high);
2705 current, __FILE__, __LINE__, 0 );
2708 cout <<
"unipoly::get_an_irreducible_polynomial "
2709 "candidate " << current <<
" : ";
2715 cout <<
"unipoly::get_an_irreducible_polynomial "
2716 "candidate " << current <<
" : ";
2718 cout <<
" is irreducible" << endl;
2727 D.
add(current,
one, tmp);
2730 if (D.
compare(current, high) == 0) {
2731 cout <<
"unipoly::get_an_irreducible_polynomial "
2732 "did not find an irreducible polynomial" << endl;
2739 int n,
int verbose_level)
2742 int f_v = (verbose_level >= 1);
2743 int f_vv = (verbose_level >= 2);
2747 cout <<
"unipoly_domain::power_int, verbose_level=" << verbose_level << endl;
2750 cout <<
"unipoly_domain::power_int computing a=";
2752 cout <<
" to the power " << n << endl;
2760 assign(a, b, verbose_level);
2763 cout <<
"unipoly_domain::power_int n=" << n;
2773 cout <<
"unipoly_domain::power_int n is odd" << endl;
2774 cout <<
"unipoly_domain::power_int before mult(b,c,d)" << endl;
2776 mult(b, c, d, verbose_level - 1);
2778 cout <<
"unipoly_domain::power_int before assign(d,c)" << endl;
2789 cout <<
"unipoly_domain::power_int n is even" << endl;
2793 cout <<
"unipoly_domain::power_int before mult(b,b,d)" << endl;
2795 mult(b, b, d, verbose_level - 1);
2797 cout <<
"unipoly_domain::power_int b*b=d";
2802 cout <<
"unipoly_domain::power_int before assign(d,b)" << endl;
2808 cout <<
"unipoly_domain::power_int before assign(c,a)" << endl;
2812 cout <<
"unipoly_domain::power_int before delete_object(b)" << endl;
2818 cout <<
"unipoly_domain::power_int done" << endl;
2825 int f_v = (verbose_level >= 1);
2832 cout <<
"unipoly_domain::power_longinteger" << endl;
2845 mult(b, c, d, verbose_level - 1);
2846 assign(d, c, verbose_level);
2848 mult(b, b, d, verbose_level - 1);
2857 cout <<
"unipoly_domain::power_longinteger done" << endl;
2864 int *ra = (
int *) a;
2869 for (i = 0; i <= m; i++) {
2870 A[i] = F->
power(A[i], n);
2876 int alpha,
int p,
int verbose_level)
2880 int f_v = (verbose_level >= 1);
2881 int f_vv = (verbose_level >= 2);
2882 int q, m_alpha, u0, cnt;
2886 cout <<
"unipoly_domain::minimum_polynomial" << endl;
2889 cout <<
"unipoly_domain::minimum_polynomial "
2890 "does not work for factorring" << endl;
2894 cout <<
"unipoly_domain::minimum_polynomial "
2895 "alpha = " << alpha << endl;
2898 m_alpha = F->
negate(alpha);
2900 cout <<
"unipoly_domain::minimum_polynomial "
2901 "m_alpha = " << m_alpha << endl;
2907 cout <<
"unipoly_domain::minimum_polynomial X - alpha = ";
2916 cout <<
"unipoly_domain::minimum_polynomial "
2917 "Iteration " << cnt;
2927 cout <<
"unipoly_domain::minimum_polynomial conjugate = ";
2932 if (u0 == m_alpha) {
2934 cout <<
"unipoly_domain::minimum_polynomial finished" << endl;
2938 mult(u, v, w, verbose_level - 1);
2940 cout <<
"unipoly_domain::minimum_polynomial product = ";
2949 cout <<
"unipoly_domain::minimum_polynomial "
2950 "Iteration " << cnt <<
" done";
2957 cout <<
"unipoly_domain::minimum_polynomial "
2958 "the minimum polynomial of " << alpha
2959 <<
" over GF(" << p <<
") is ";
2967 cout <<
"unipoly_domain::minimum_polynomial done" << endl;
2972 int alpha,
int p,
int verbose_level)
2975 int f_v = (verbose_level >= 1);
2976 int f_vv = (verbose_level >= 2);
2979 if (!f_factorring) {
2980 cout <<
"unipoly_domain::minimum_polynomial_factorring "
2981 "must be a factorring" << endl;
2985 cout <<
"factor_degree = " << factor_degree << endl;
2993 for (i = 0; i <= factor_degree; i++) {
3005 cout <<
"unipoly_domain::minimum_polynomial_factorring "
3006 "minimum polynomial of ";
3008 cout <<
" = " << alpha << endl;
3018 cout <<
"a0 = " << a0 << endl;
3020 assign(b, coeffs[0], 0 );
3025 cout <<
"unipoly_domain::minimum_polynomial_factorring "
3028 cout <<
" the polynomial is ";
3029 for (j = i; j >= 0; j--) {
3032 cout <<
" Y^" << j <<
" + ";
3045 if (i == factor_degree) {
3046 cout <<
"unipoly_domain::minimum_polynomial_factorring "
3047 "i == factor_degree && ai != a0" << endl;
3053 for (j = i; j >= 0; j--) {
3054 coeffs[j + 1] = coeffs[j];
3058 for (j = 1; j <= i + 1; j++) {
3059 mult(coeffs[j], b, c, verbose_level - 1);
3060 add(c, coeffs[j - 1], d);
3061 assign(d, coeffs[j - 1], verbose_level);
3069 cout <<
"unipoly_domain::minimum_polynomial_factorring minimum polynomial is: ";
3070 for (j = i; j >= 0; j--) {
3073 cout <<
"Y^" << j <<
" + ";
3079 for (j = i; j >= 0; j--) {
3080 r =
rank(coeffs[j]);
3085 cout <<
"the rank of this polynomial over "
3086 "GF(" << p <<
") is " << rk << endl;
3088 for (j = 0; j <= factor_degree; j++) {
3099 int p,
int verbose_level)
3102 int f_v = (verbose_level >= 1);
3103 int f_vv = (verbose_level >= 2);
3105 if (!f_factorring) {
3106 cout <<
"unipoly_domain::minimum_polynomial_factorring_longinteger "
3107 "must be a factorring" << endl;
3111 cout <<
"factor_degree = " << factor_degree << endl;
3141 for (i = 0; i <= factor_degree; i++) {
3158 cout <<
"unipoly_domain::minimum_polynomial_factorring_longinteger "
3159 "minimum polynomial of ";
3161 cout <<
" = " << alpha << endl;
3182 cout <<
"a0 = " << a0 << endl;
3185 assign(b, coeffs[0], 0 );
3199 cout <<
"i=" << i <<
" b=";
3201 cout <<
" the polynomial is ";
3202 for (j = i; j >= 0; j--) {
3205 cout <<
" Y^" << j <<
" + ";
3227 if (i == factor_degree) {
3228 cout <<
"unipoly_domain::minimum_polynomial_factorring_longinteger "
3229 "i == factor_degree && ai != a0" << endl;
3240 for (j = i; j >= 0; j--) {
3241 coeffs[j + 1] = coeffs[j];
3245 for (j = 1; j <= i + 1; j++) {
3246 mult(coeffs[j], b, c, verbose_level - 1);
3247 add(c, coeffs[j - 1], d);
3248 assign(d, coeffs[j - 1], 0 );
3255 for (j = i; j >= 0; j--) {
3258 cout <<
"Y^" << j <<
" + ";
3266 rk.
create(0, __FILE__, __LINE__);
3267 p_object.
create(p, __FILE__, __LINE__);
3268 for (j = i; j >= 0; j--) {
3270 D.
mult(rk, p_object, rk1);
3275 cout <<
"the rank of this polynomial over "
3276 "GF(" << p <<
") is " << rk << endl;
3278 for (j = 0; j <= factor_degree; j++) {
3292 for (i = 0; i < deg; i++) {
3305 int f_v = (verbose_level >= 1);
3306 int f_vv = (verbose_level >= 2);
3311 cout <<
"unipoly_domain::minimum_polynomial_extension_field of ";
3317 for (i = 0; i < deg + 2; i++) {
3332 cout <<
"unipoly_domain::minimum_polynomial_extension_field "
3333 "we are working modulo - (";
3335 cout <<
")" << endl;
3345 cout <<
"unipoly_domain::minimum_polynomial_extension_field "
3346 "i = " << i <<
" : g = ";
3349 cout <<
"sigma=" << endl;
3354 cout <<
"unipoly_domain::minimum_polynomial_extension_field "
3355 "i = " << i <<
" before matrix_apply" << endl;
3359 cout <<
"unipoly_domain::minimum_polynomial_extension_field "
3360 "i = " << i <<
" after matrix_apply" << endl;
3364 cout <<
"unipoly_domain::minimum_polynomial_extension_field "
3365 "i = " << i <<
" : g=";
3372 cout <<
"unipoly_domain::minimum_polynomial_extension_field "
3374 <<
" before mult_mod" << endl;
3377 degree(mm), ((
int *)mm) + 1,
3380 cout <<
"unipoly_domain::minimum_polynomial_extension_field "
3382 <<
" after mult_mod" << endl;
3383 cout <<
"sigma=" << endl;
3387 for (j = i - 1; j >= 1; j--) {
3389 cout <<
"unipoly_domain::minimum_polynomial_extension_field "
3390 "i = " << i <<
" j = "
3394 cout <<
"unipoly_domain::minimum_polynomial_extension_field "
3395 "i = " << i <<
" j = "
3396 << j <<
" before mult_mod" << endl;
3400 cout <<
"unipoly_domain::minimum_polynomial_extension_field "
3401 "i = " << i <<
" j = "
3402 << j <<
" after mult_mod" << endl;
3403 cout <<
"sigma=" << endl;
3407 cout <<
"unipoly_domain::minimum_polynomial_extension_field "
3408 "i = " << i <<
" j = "
3409 << j <<
" before add" << endl;
3411 add(sigma[j], h, h2);
3413 cout <<
"unipoly_domain::minimum_polynomial_extension_field "
3414 "i = " << i <<
" j = "
3415 << j <<
" after add" << endl;
3418 cout <<
"unipoly_domain::minimum_polynomial_extension_field "
3419 "i = " << i <<
" j = "
3420 << j <<
" before assign" << endl;
3421 cout <<
"sigma=" << endl;
3424 assign(h2, sigma[j], 0 );
3426 cout <<
"unipoly_domain::minimum_polynomial_extension_field "
3427 "i = " << i <<
" j = "
3428 << j <<
" after assign" << endl;
3432 cout <<
"unipoly_domain::minimum_polynomial_extension_field "
3433 "i = " << i <<
" j = "
3434 << j <<
" iteration finished" << endl;
3437 for (k = i; k >= 0; k--) {
3438 if (
degree(sigma[k]) > 0) {
3448 for (j = i; j >= 0; j--) {
3449 ((
int *) minpol)[1 + j] = ((
int *)sigma[i - j])[1 + 0];
3451 for (j = 0; j <= i; j += 2) {
3452 ((
int *) minpol)[1 + j] = F->
negate(
3453 ((
int *) minpol)[1 + j]);
3457 cout <<
"unipoly_domain::minimum_polynomial_extension_field "
3465 cout <<
"unipoly_domain::minimum_polynomial_extension_field "
3474 for (i = 0; i < deg + 2; i++) {
3479 cout <<
"unipoly_domain::minimum_polynomial_extension_field done" << endl;
3487 int f_v = (verbose_level >= 1);
3488 int f_vv = (verbose_level >= 2);
3493 cout <<
"unipoly_domain::characteristic_polynomial" << endl;
3496 cout <<
"unipoly_domain::characteristic_polynomial M=" << endl;
3501 for (i = 0; i < k; i++) {
3502 for (j = 0; j < k; j++) {
3506 ((
int *)M[i * k + j])[1 + 0] = a;
3507 ((
int *)M[i * k + j])[1 + 1] =
m_one;
3511 ((
int *)M[i * k + j])[1 + 0] = a;
3518 cout <<
"unipoly_domain::characteristic_polynomial M - X Id=" << endl;
3523 cout <<
"unipoly_domain::characteristic_polynomial before determinant" << endl;
3527 cout <<
"unipoly_domain::characteristic_polynomial after determinant" << endl;
3531 cout <<
"unipoly_domain::characteristic_polynomial before delete_object(M[i * k + j]);" << endl;
3533 for (i = 0; i < k; i++) {
3534 for (j = 0; j < k; j++) {
3536 cout <<
"unipoly_domain::characteristic_polynomial i=" << i <<
" j=" << j << endl;
3542 cout <<
"unipoly_domain::characteristic_polynomial before FREE_OBJECTS(M);" << endl;
3546 cout <<
"unipoly_domain::characteristic_polynomial done" << endl;
3555 for (i = 0; i < k; i++) {
3556 for (j = 0; j < k; j++) {
3572 int f_v = (verbose_level >= 1);
3577 cout <<
"unipoly_domain::determinant k=" << k << endl;
3583 cout <<
"unipoly_domain::determinant done" << endl;
3593 for (i = 0; i < k; i++) {
3604 cout <<
"unipoly_domain::determinant "
3605 "deletion of row " << i <<
" leads to determinant ";
3610 mult(p1, M[i * k + 0], p2, verbose_level - 1);
3620 for (j = 0; j < (k - 1) * (k - 1); j++) {
3630 cout <<
"unipoly_domain::determinant done" << endl;
3635 int k,
int delete_row,
int delete_column,
3639 int f_v = (verbose_level >= 1);
3644 cout <<
"unipoly_domain::deletion_matrix" << endl;
3648 for (i = 0; i < k1 * k1; i++) {
3652 for (i = 0, ii = 0; i < k; i++) {
3653 if (i == delete_row) {
3656 for (j = 0, jj = 0; j < k; j++) {
3657 if (j == delete_column) {
3661 assign(M[i * k + j], N[ii * k1 + jj], 0 );
3668 cout <<
"unipoly_domain::deletion_matrix done" << endl;
3676 int *ra = (
int *) a;
3685 for (i = 0; i <= m; i++) {
3698 int *ra = (
int *) a;
3704 for (i = 0; i <= m; i++) {
void print(std::ostream &ost, std::vector< int > &v)
linear_algebra::linear_algebra * Linear_algebra
int Gauss_int(int *A, int f_special, int f_complete, int *base_cols, int f_P, int *P, int m, int n, int Pn, int verbose_level)
void order_ideal_generator(int d, int idx, int *mue, int &mue_deg, int *A, int *Frobenius, int verbose_level)
void mult_matrix_matrix(int *A, int *B, int *C, int m, int n, int o, int verbose_level)
void mult_vector_from_the_right(int *A, int *v, int *Av, int m, int n)
void transpose_matrix_in_place(int *A, int m)
void span_cyclic_module(int *A, int *v, int n, int *Mtx, int verbose_level)
void Dickson_polynomial(int *map, int *coeffs)
basic number theoretic functions
int lint_logq(long int n, int q)
a collection of functions related to file io
void lint_matrix_read_csv(std::string &fname, long int *&M, int &m, int &n, int verbose_level)
data_structures::int_vec * Int_vec
domain to compute with objects of type longinteger
int compare(longinteger_object &a, longinteger_object &b)
void add(longinteger_object &a, longinteger_object &b, longinteger_object &c)
void integral_division_by_int(longinteger_object &a, int b, longinteger_object &q, int &r)
void mult(longinteger_object &a, longinteger_object &b, longinteger_object &c)
int logarithm_base_b(longinteger_object &a, int b)
void integral_division(longinteger_object &a, longinteger_object &b, longinteger_object &q, longinteger_object &r, int verbose_level)
void power_int(longinteger_object &a, int n)
void factor_into_longintegers(longinteger_object &a, int &nb_primes, longinteger_object *&primes, int *&exponents, int verbose_level)
a class to represent arbitrary precision integers
void assign_to(longinteger_object &b)
void create(long int i, const char *file, int line)
domain of polynomials in one variable over a finite field
int substitute_scalar_in_polynomial(unipoly_object &p, int scalar, int verbose_level)
void power_coefficients(unipoly_object &a, int n)
void add(unipoly_object a, unipoly_object b, unipoly_object &c)
void delete_object(unipoly_object &p)
int minimum_polynomial_factorring(int alpha, int p, int verbose_level)
void deletion_matrix(unipoly_object *M, int k, int delete_row, int delete_column, unipoly_object *&N, int verbose_level)
void make_monic(unipoly_object &a)
void create_object_of_degree_with_coefficients(unipoly_object &p, int d, int *coeff)
int is_zero(unipoly_object p)
void power_int(unipoly_object &a, int n, int verbose_level)
void get_a_primitive_polynomial(unipoly_object &m, int f, int verbose_level)
void substitute_matrix_in_polynomial(unipoly_object &p, int *Mtx_in, int *Mtx_out, int k, int verbose_level)
void print_object_tight(unipoly_object p, std::ostream &ost)
int is_squarefree(unipoly_object p, int verbose_level)
void derivative(unipoly_object a, unipoly_object &b)
field_theory::finite_field * get_F()
void center_lift_coordinates(unipoly_object a, int q)
void print_object_dense(unipoly_object p, std::ostream &ost)
void init_variable_name(std::string &label)
int is_primitive(unipoly_object &m, longinteger_object &qm1, int nb_primes, longinteger_object *primes, int verbose_level)
void Frobenius_matrix_by_rows(int *&Frob, unipoly_object factor_polynomial, int verbose_level)
void m_one(unipoly_object p)
void mult_mod(unipoly_object a, unipoly_object b, unipoly_object &c, unipoly_object m, int verbose_level)
void one(unipoly_object p)
void module_structure_apply(int *v, int *Mtx, int n, unipoly_object p, int verbose_level)
void exact_division(unipoly_object a, unipoly_object b, unipoly_object &q, int verbose_level)
void mult(unipoly_object a, unipoly_object b, unipoly_object &c, int verbose_level)
void compute_normal_basis(int d, int *Normal_basis, int *Frobenius, int verbose_level)
void mult_mod_negated(unipoly_object a, unipoly_object b, unipoly_object &c, int factor_polynomial_degree, int *factor_polynomial_coefficients_negated, int verbose_level)
void order_ideal_generator(int d, int idx, unipoly_object &mue, int *A, int *Frobenius, int verbose_level)
int & s_i(unipoly_object p, int i)
void reduce_modulo_p(unipoly_object a, int p)
void extended_gcd(unipoly_object m, unipoly_object n, unipoly_object &u, unipoly_object &v, unipoly_object &g, int verbose_level)
void minimum_polynomial_extension_field(unipoly_object &g, unipoly_object m, unipoly_object &minpol, int d, int *Frobenius, int verbose_level)
void print_matrix(unipoly_object *M, int k)
void get_an_irreducible_polynomial(unipoly_object &m, int f, int verbose_level)
void create_object_of_degree(unipoly_object &p, int d)
void print_vector_of_polynomials(unipoly_object *sigma, int deg)
void greatest_common_divisor(unipoly_object m, unipoly_object n, unipoly_object &g, int verbose_level)
void division_with_remainder(unipoly_object a, unipoly_object b, unipoly_object &q, unipoly_object &r, int verbose_level)
int is_irreducible(unipoly_object a, int verbose_level)
void determinant(unipoly_object *M, int k, unipoly_object &p, int verbose_level)
int degree(unipoly_object p)
int compare_euclidean(unipoly_object m, unipoly_object n)
void singer_candidate(unipoly_object &m, int p, int d, int b, int a)
void power_longinteger(unipoly_object &a, longinteger_object &n, int verbose_level)
void Frobenius_matrix(int *&Frob, unipoly_object factor_polynomial, int verbose_level)
void create_object_by_rank_longinteger(unipoly_object &p, longinteger_object &rank, const char *file, int line, int verbose_level)
int rank(unipoly_object p)
int is_one(unipoly_object p)
void create_object_by_rank(unipoly_object &p, long int rk, const char *file, int line, int verbose_level)
void create_Dickson_polynomial(unipoly_object &p, int *map)
void zero(unipoly_object p)
void unrank_longinteger(unipoly_object p, longinteger_object &rank)
void create_object_by_rank_string(unipoly_object &p, std::string &rk, int verbose_level)
void matrix_apply(unipoly_object &p, int *Mtx, int n, int verbose_level)
void negate(unipoly_object a)
void rank_longinteger(unipoly_object p, longinteger_object &rank)
void characteristic_polynomial(int *Mtx, int k, unipoly_object &char_poly, int verbose_level)
void minimum_polynomial_factorring_longinteger(longinteger_object &alpha, longinteger_object &rk_minpoly, int p, int verbose_level)
void init_basic(field_theory::finite_field *F, int verbose_level)
void create_object_of_degree_no_test(unipoly_object &p, int d)
void mult_easy(unipoly_object a, unipoly_object b, unipoly_object &c)
void print_object_sparse(unipoly_object p, std::ostream &ost)
void create_object_from_csv_file(unipoly_object &p, std::string &fname, const char *file, int line, int verbose_level)
void assign(unipoly_object a, unipoly_object &b, int verbose_level)
void minimum_polynomial(unipoly_object &a, int alpha, int p, int verbose_level)
void Berlekamp_matrix(int *&B, unipoly_object factor_polynomial, int verbose_level)
void unrank(unipoly_object p, int rk)
void take_away_all_factors_from_b(unipoly_object a, unipoly_object b, unipoly_object &a_without_b, int verbose_level)
void print_object(unipoly_object p, std::ostream &ost)
void init_factorring(field_theory::finite_field *F, unipoly_object m, int verbose_level)
#define NEW_int_with_tracking(n, file, line)
#define Int_vec_print_integer_matrix(A, B, C, D)
#define Int_vec_zero(A, B)
#define Int_matrix_print(A, B, C)
#define NEW_OBJECTS(type, n)
#define Int_vec_copy(A, B, C)
#define Int_vec_print(A, B, C)
orbiter_kernel_system::orbiter_session * Orbiter
global Orbiter session
the orbiter library for the classification of combinatorial objects