16namespace layer1_foundations {
17namespace ring_theory {
41 for (i = 0; i <= mn; i++) {
44 for (i = m; i >= 0; i--) {
45 for (j = n; j >= 0; j--) {
48 y = F->
mult(A[i], B[j]);
67 for (i = m; i >= 0; i--) {
80 for (i = m; i >= 0; i--) {
91 std::ostream &ost,
int verbose_level)
93 int f_v = (verbose_level >= 1);
96 cout <<
"unipoly_domain::mult_easy_with_report" << endl;
104 cout <<
"unipoly_domain::mult_easy_with_report rk_a=" << rk_a << endl;
105 cout <<
"unipoly_domain::mult_easy_with_report rk_b=" << rk_b << endl;
108 __FILE__, __LINE__, verbose_level);
110 __FILE__, __LINE__, 0 );
113 cout <<
"unipoly_domain::mult_easy_with_report after create_object_by_rank" << endl;
125 cout <<
"unipoly_domain::mult_easy_with_report before NEW_int, mn=" << mn << endl;
137 cout <<
"unipoly_domain::mult_easy_with_report before rc[0] = mn;" << endl;
140 for (i = 0; i <= mn; i++) {
144 ost <<
"\\begin{verbatim}" << endl;
145 ost << setw(m + 1) << rk_a <<
" x " << setw(n + 1) << rk_b <<
" = " << endl;
147 cout <<
"unipoly_domain::mult_easy_with_report before print_coeffs_top_down_assuming_one_character_per_digit" << endl;
155 for (j = n; j >= 0; j--) {
157 cout <<
"unipoly_domain::mult_easy_with_report j=" << j << endl;
171 cout <<
"unipoly_domain::mult_easy_with_report multiplying" << endl;
173 for (i = m; i >= 0; i--) {
175 cout <<
"unipoly_domain::mult_easy_with_report i=" << i << endl;
177 for (j = n; j >= 0; j--) {
179 cout <<
"unipoly_domain::mult_easy_with_report j=" << j << endl;
183 y = F->
mult(A[i], B[j]);
198 cout <<
"unipoly_domain::mult_easy_with_report rk_c=" << rk_c << endl;
201 ost <<
"=" << setw(mn + 1) << rk_c << endl;
203 ost <<
"\\end{verbatim}" << endl;
209 cout <<
"unipoly_domain::mult_easy_with_report done" << endl;
215 std::string &input_fname,
long int rk_b,
216 long int &rk_q,
long int &rk_r, std::ostream &ost,
int verbose_level)
221 int f_v = (verbose_level >= 1);
225 cout <<
"unipoly_domain::division_with_remainder_from_file_with_report" << endl;
240 __FILE__, __LINE__, 0 );
242 __FILE__, __LINE__, 0 );
244 __FILE__, __LINE__, 0 );
253 ost <<
"\\begin{verbatim}" << endl;
255 ost << input_fname <<
" / " << setw(db + 1) << rk_b <<
" = " << endl;
262 for (i = db - 1; i >= 0; i--) {
271 ost <<
"= " << setw(i + 1) << rk_r << endl;
273 ost <<
"\\end{verbatim}" << endl;
276 cout <<
"unipoly_domain::division_with_remainder_from_file_with_report done" << endl;
283 std::string &input_fname,
long int rk_b,
int k,
284 long int *&rk_q,
long int *&rk_r,
int &n,
int &N, std::ostream &ost,
int verbose_level)
286 int f_v = (verbose_level >= 1);
290 cout <<
"unipoly_domain::division_with_remainder_from_file_all_k_bit_error_patterns" << endl;
306 __FILE__, __LINE__, 0 );
308 __FILE__, __LINE__, 0 );
310 __FILE__, __LINE__, 0 );
332 ost <<
"\\begin{verbatim}" << endl;
337 for (h = 0; h < N; h++) {
347 __FILE__, __LINE__, 0 );
349 __FILE__, __LINE__, 0 );
351 __FILE__, __LINE__, 0 );
356 for (j = 0; j < k; j++) {
370 cout << setw(5) << h;
383 for (i = db - 1; i >= 0; i--) {
391 ost << setw(5) << rk_r[h];
397 ost <<
"\\end{verbatim}" << endl;
401 cout <<
"unipoly_domain::division_with_remainder_from_file_all_k_bit_error_patterns done" << endl;
408 long int &rk_q,
long int &rk_r, std::ostream &ost,
int verbose_level)
413 int f_v = (verbose_level >= 1);
417 cout <<
"unipoly_domain::division_with_remainder_numerically_with_report" << endl;
427 __FILE__, __LINE__, 0 );
429 __FILE__, __LINE__, 0 );
431 __FILE__, __LINE__, 0 );
433 __FILE__, __LINE__, 0 );
441 ost <<
"\\begin{verbatim}" << endl;
443 ost << setw(da + 1) << rk_a <<
" / " << setw(db + 1) << rk_b <<
" = " << endl;
452 for (i = db - 1; i >= 0; i--) {
461 ost <<
"= " << setw(i + 1) << rk_r << endl;
463 ost <<
"\\end{verbatim}" << endl;
473 int f_v = (verbose_level >= 1);
477 cout <<
"unipoly_domain::division_with_remainder_with_report" << endl;
493 cout <<
"unipoly_domain::division_with_remainder_with_report "
494 "not good for a factorring" << endl;
499 cout <<
"unipoly_domain::division_with_remainder_with_report: "
500 "division by zero" << endl;
505 cout <<
"unipoly_domain::division_with_remainder_with_report db > da" << endl;
531 int i, j, ii, jj, pivot, pivot_inv, x, c, d;
544 ost <<
" = " << endl << endl;
550 for (i = da, j = dq; i >= db; i--, j--) {
558 c = F->
mult(x, pivot_inv);
562 for (ii = i, jj = db; jj >= 0; ii--, jj--) {
565 R[ii] = F->
add(d, R[ii]);
568 cout <<
"unipoly::division_with_remainder_with_report: R[i] != 0" << endl;
595 for (i = da, j = dq; i >= db; i--, j--) {
625 c = F->
mult(x, pivot_inv);
629 for (ii = i, jj = db; jj >= 0; ii--, jj--) {
632 R[ii] = F->
add(d, R[ii]);
635 cout <<
"unipoly::division_with_remainder_with_report: R[i] != 0" << endl;
647 while (i > 0 && R[i] == 0) {
663 cout <<
"unipoly_domain::division_with_remainder_with_report done" << endl;
a collection of combinatorial functions
void unrank_k_subset(int rk, int *set, int n, int k)
long int int_n_choose_k(int n, int k)
catch all class for algorithms
void print_repeated_character(std::ostream &ost, char c, int n)
void delete_object(unipoly_object &p)
void mult_easy_with_report(long int rk_a, long int rk_b, long int &rk_c, std::ostream &ost, int verbose_level)
void division_with_remainder_from_file_all_k_bit_error_patterns(std::string &input_fname, long int rk_b, int k, long int *&rk_q, long int *&rk_r, int &n, int &N, std::ostream &ost, int verbose_level)
void division_with_remainder_from_file_with_report(std::string &input_fname, long int rk_b, long int &rk_q, long int &rk_r, std::ostream &ost, int verbose_level)
void division_with_remainder_with_report(unipoly_object &a, unipoly_object &b, unipoly_object &q, unipoly_object &r, int f_report, std::ostream &ost, int verbose_level)
int degree(unipoly_object p)
int rank(unipoly_object p)
void create_object_by_rank(unipoly_object &p, long int rk, const char *file, int line, int verbose_level)
void division_with_remainder_numerically_with_report(long int rk_a, long int rk_b, long int &rk_q, long int &rk_r, std::ostream &ost, int verbose_level)
void print_coeffs_top_down_assuming_one_character_per_digit(unipoly_object a, std::ostream &ost)
void mult_easy(unipoly_object a, unipoly_object b, unipoly_object &c)
void create_object_from_csv_file(unipoly_object &p, std::string &fname, const char *file, int line, int verbose_level)
void print_coeffs_top_down_assuming_one_character_per_digit_with_degree_given(unipoly_object a, int m, std::ostream &ost)
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)
the orbiter library for the classification of combinatorial objects