18namespace layer1_foundations {
19namespace coding_theory {
23 int *&H_subfield,
int &m,
int &n,
25 int f_construction_A,
int f_hyperoval,
26 int f_construction_B,
int verbose_level)
28 int f_v = (verbose_level >= 1);
29 int f_vv = (verbose_level >= 2);
43 int f_elements_exponential =
TRUE;
44 string symbol_for_print;
45 string symbol_for_print_subfield;
48 symbol_for_print.assign(
"\\alpha");
49 symbol_for_print_subfield.assign(
"\\omega");
53 cout <<
"twisted_tensor_product_codes" << endl;
54 cout <<
"f_construction_A=" << f_construction_A << endl;
55 cout <<
"f_hyperoval=" << f_hyperoval << endl;
56 cout <<
"f_construction_B=" << f_construction_B << endl;
62 if (f_construction_A) {
65 else if (f_construction_B) {
68 index = (Q - 1) / (q - 1);
71 cout <<
"twisted_tensor_product_codes Q != F->q" << endl;
77 cout <<
"q = " << q << endl;
78 cout <<
"Q = " << Q << endl;
79 cout <<
"index = " << index << endl;
86 cout <<
"field of order " << Q <<
" initialized" << endl;
92 cout <<
"field of order " << q <<
" initialized" << endl;
93 cout <<
"index = " << index << endl;
103 m, n, beta, r, exponents,
104 f_construction_A, f_hyperoval, f_construction_B,
105 f_elements_exponential, symbol_for_print,
108 beta_q = F->
power(beta, q);
111 cout <<
"twisted_tensor_product_codes after create_matrix_M" << endl;
112 cout <<
"m = " << m << endl;
113 cout <<
"n = " << n << endl;
114 cout <<
"Q = " << Q << endl;
115 cout <<
"q2 = " << q2 << endl;
116 cout <<
"beta = " << beta << endl;
117 cout <<
"beta_q = " << beta_q << endl;
118 cout <<
"Exponents: ";
124 cout <<
"twisted_tensor_product_codes: M:" << endl;
127 F->
latex_matrix(cout, f_elements_exponential, symbol_for_print, M, m, n);
134 for (j = 0; j < n; j++) {
135 PG_element_normalize(F, M + j, n, m);
137 cout <<
"column normalized M:" << endl;
138 print_integer_matrix_width(cout, M, m, n, n, 2);
150 H_subfield, C, C_inv, M, m, n, beta, beta_q,
151 f_elements_exponential, symbol_for_print, symbol_for_print_subfield,
152 f_construction_A, f_hyperoval, f_construction_B,
157 cout <<
"twisted_tensor_product_codes: after create_matrix_H_subfield" << endl;
158 cout <<
"H_subfield:" << endl;
160 f->
latex_matrix(cout, f_elements_exponential, symbol_for_print_subfield, H_subfield, m, n);
173 int &m,
int &n,
int &beta,
int &r,
int *exponents,
174 int f_construction_A,
int f_hyperoval,
int f_construction_B,
175 int f_elements_exponential, std::string &symbol_for_print,
179 int f_v = (verbose_level >= 1);
181 int i, j, t, q, Q, q2;
187 if (f_construction_A) {
192 q = 4; override_poly_Q =
"19"; override_poly =
"7";
222 exponents[1] = q + 1;
223 exponents[2] = 2 * q + 2;
228 exponents[5] = 2 * q;
231 exponents[7] = 2 * q + 1;
232 exponents[8] = q + 2;
243 else if (f_construction_B) {
248 q = 4; override_poly_Q =
""; override_poly =
"7"; r = 4;
260 exponents[1] = q2 + q + 1;
264 exponents[5] = q + 1;
265 exponents[6] = q2 + q;
266 exponents[7] = q2 + 1;
277 cout <<
"coding_theory_domain::create_matrix_M please specify the construction using option -A or -B" << endl;
284 for (i = 0; i < m; i++) {
285 for (j = 0; j < n; j++) {
289 for (t = 0; t < Q; t++) {
290 for (i = 0; i < m; i++) {
291 M[i * n + t] = F->
power(t, exponents[i]);
294 if (f_construction_A) {
297 M[1 * n + Q + 1] = 1;
299 else if (f_construction_B) {
304 cout <<
"M:" << endl;
308 symbol_for_print, M, m, n);
313 int *all_one, *col_sum;
317 for (i = 0; i < n; i++)
321 cout <<
"overall col_sum:" << endl;
334 int *H_subfield,
int *C,
int *C_inv,
int *M,
335 int m,
int n,
int beta,
int beta_q,
336 int f_elements_exponential, std::string &symbol_for_print,
337 std::string &symbol_for_print_subfield,
338 int f_construction_A,
int f_hyperoval,
int f_construction_B,
341 int f_v = (verbose_level >= 1);
342 int f_vv = (verbose_level >= 2);
354 Rep.
init(F, verbose_level);
358 for (i = 0; i < m; i++) {
359 for (j = 0; j < m; j++) {
365 if (f_construction_A) {
366 int nb_C_coeffs = 15;
385 for (k = 0; k < nb_C_coeffs; k++) {
386 i = C_coeffs[k * 3 + 0];
387 j = C_coeffs[k * 3 + 1];
388 aa = C_coeffs[k * 3 + 2];
392 else if (f_construction_B) {
393 int nb_C_coeffs = 20;
417 for (k = 0; k < nb_C_coeffs; k++) {
418 i = C_coeffs[k * 3 + 0];
419 j = C_coeffs[k * 3 + 1];
420 aa = C_coeffs[k * 3 + 2];
427 cout <<
"matrix C:" << endl;
430 symbol_for_print, C, m, m);
437 cout <<
"C_inv:" << endl;
445 cout <<
"C * C_inv:" << endl;
454 cout <<
"H = C * M:" << endl;
457 symbol_for_print, H, m, n);
462 rk = F.Gauss_int(M,
FALSE ,
TRUE , base_cols,
463 FALSE , NULL, m , n , 0 ,
465 cout <<
"has rank " << rk << endl;
471 cout <<
"H_subfield:" << endl;
474 symbol_for_print_subfield, H_subfield, m, n);
485 int m,
int n,
int *M,
int *MM,
int verbose_level)
487 int f_v = (verbose_level >= 1);
488 int f_vv = (verbose_level >= 2);
489 int i, j, a, z, b, c, Q, q;
494 index = (Q - 1) / (q - 1);
496 cout <<
"field reduction, Q=" << Q
497 <<
" q=" << q <<
" index=" << index << endl;
500 cout <<
"before:" << endl;
507 for (i = 0; i < m; i++) {
508 for (j = 0; j < n; j++) {
516 cout <<
"field reduction: element does not "
517 "lie in the subfield: " << a << endl;
525 if (b * index != z) {
526 cout <<
"b * index != z" << endl;
536 cout <<
"after:" << endl;
553 int *&the_set,
int &length,
556 int f_v = (verbose_level >= 1);
557 int f_hyperoval =
FALSE;
558 const char *override_poly =
"";
559 const char *override_poly_Q =
"";
564 cout <<
"make_tensor_code_9dimensional_as_point_set" << endl;
568 override_poly_Q =
""; override_poly =
""; f_hyperoval =
FALSE;
571 override_poly_Q =
""; override_poly =
""; f_hyperoval =
FALSE;
574 override_poly_Q =
"19"; override_poly =
"7"; f_hyperoval =
FALSE;
580 override_poly_Q =
"47"; override_poly =
""; f_hyperoval =
FALSE;
585 override_poly_Q =
""; override_poly =
""; f_hyperoval =
FALSE;
588 override_poly_Q =
"97"; override_poly =
"11"; f_hyperoval =
TRUE;
594 override_poly_Q =
""; override_poly =
"17"; f_hyperoval =
FALSE;
597 string poly_Q, poly_q;
599 poly_Q.assign(override_poly_Q);
600 poly_q.assign(override_poly);
603 f_hyperoval, code, length, verbose_level - 1);
609 for (t = 0; t < length; t++) {
610 for (i = 0; i < 9; i++) {
611 pt[i] = code[i * length + t];
618 cout <<
"make_tensor_code_9dimensional_as_point_set done" << endl;
619 cout <<
"created the set: ";
626 std::string &override_poly_Q, std::string &override_poly,
628 int *&code,
int &length,
640 int index, Q, i, j, t, m, n, r, beta, beta_q;
641 int f_v = (verbose_level >= 1);
642 int f_vv = (verbose_level >= 2);
646 cout <<
"make_tensor_code_9_dimensional q=" << q << endl;
679 exponents[1] = q + 1;
680 exponents[2] = 2 * q + 2;
683 exponents[5] = 2 * q;
685 exponents[7] = 2 * q + 1;
686 exponents[8] = q + 2;
697 index = (Q - 1) / (q - 1);
700 cout <<
"q = " << q <<
" override polynomial = " << override_poly << endl;
701 cout <<
"Q = " << Q << endl;
704 cout <<
"field of order " << Q <<
" initialized" << endl;
705 beta_q = F.
power(beta, q);
707 cout <<
"field of order " << q <<
" initialized" << endl;
708 cout <<
"n = " << n << endl;
709 cout <<
"index = " << index << endl;
710 cout <<
"beta = " << beta << endl;
711 cout <<
"beta_q = " << beta_q << endl;
720 rc.
init(&f, m, n, r + 1);
722 for (i = 0; i < m; i++) {
723 for (j = 0; j < n; j++) {
727 for (i = 0; i < m; i++) {
728 for (j = 0; j < m; j++) {
732 for (t = 0; t < Q; t++) {
733 for (i = 0; i < m; i++) {
734 M[i * n + t] = F.
power(t, exponents[i]);
740 M[1 * n + Q + 1] = 1;
741 int nb_C_coeffs = 15;
760 for (k = 0; k < nb_C_coeffs; k++) {
761 i = C_coeffs[k * 3 + 0];
762 j = C_coeffs[k * 3 + 1];
763 aa = C_coeffs[k * 3 + 2];
768 cout <<
"M:" << endl;
772 int *all_one, *col_sum;
776 for (i = 0; i < n; i++) {
781 cout <<
"col_sum:" << endl;
788 for (j = 0; j < n; j++) {
789 PG_element_normalize(F, M + j, n, m);
791 cout <<
"column normalized M:" << endl;
792 print_integer_matrix_width(cout, M, m, n, n, 2);
796 cout <<
"C:" << endl;
801 cout <<
"C_inv:" << endl;
809 cout <<
"C * C_inv:" << endl;
816 cout <<
"H = C * M:" << endl;
821 rk = F.Gauss_int(M,
FALSE ,
TRUE , base_cols,
822 FALSE , NULL, m , n , 0 ,
824 cout <<
"has rank " << rk << endl;
828 cout <<
"before field reduction:" << endl;
837 cout <<
"after field reduction:" << endl;
843 cout <<
"H_subfield:" << endl;
to check whether any d - 1 elements of a given set are linearly independent
void init(field_theory::finite_field *GFq, int m, int n, int d)
void make_tensor_code_9_dimensional(int q, std::string &override_poly_Q, std::string &override_poly, int f_hyperoval, int *&code, int &length, int verbose_level)
void tt_field_reduction(field_theory::finite_field &F, field_theory::finite_field &f, int m, int n, int *M, int *MM, int verbose_level)
void create_matrix_M(int *&M, field_theory::finite_field *F, field_theory::finite_field *f, int &m, int &n, int &beta, int &r, int *exponents, int f_construction_A, int f_hyperoval, int f_construction_B, int f_elements_exponential, std::string &symbol_for_print, int verbose_level)
void twisted_tensor_product_codes(int *&H_subfield, int &m, int &n, field_theory::finite_field *F, field_theory::finite_field *f, int f_construction_A, int f_hyperoval, int f_construction_B, int verbose_level)
void make_tensor_code_9dimensional_as_point_set(field_theory::finite_field *F, int *&the_set, int &length, int verbose_level)
void create_matrix_H_subfield(field_theory::finite_field *F, field_theory::finite_field *f, int *H_subfield, int *C, int *C_inv, int *M, int m, int n, int beta, int beta_q, int f_elements_exponential, std::string &symbol_for_print, std::string &symbol_for_print_subfield, int f_construction_A, int f_hyperoval, int f_construction_B, int verbose_level)
void PG_element_rank_modified(int *v, int stride, int len, int &a)
void retract_int_vec(finite_field &subfield, int index, int *v_in, int *v_out, int len, int verbose_level)
void init_override_polynomial(int q, std::string &poly, int f_without_tables, int verbose_level)
void latex_matrix(std::ostream &f, int f_elements_exponential, std::string &symbol_for_print, int *M, int m, int n)
linear_algebra::linear_algebra * Linear_algebra
void compute_subfields(int verbose_level)
void print_integer_matrix_zech(std::ostream &ost, int *p, int m, int n)
void invert_matrix(int *A, int *A_inv, int n, int verbose_level)
void mult_matrix_matrix(int *A, int *B, int *C, int m, int n, int o, int verbose_level)
catch all class for representation theory
int beta_trinomial(int q, int beta, int a1, int a2, int a3)
void init(field_theory::finite_field *F, int verbose_level)
#define Int_vec_print_integer_matrix_width(A, B, C, D, E, F)
#define Int_vec_print(A, B, C)
the orbiter library for the classification of combinatorial objects