17namespace layer4_classification {
18namespace poset_classification {
21void poset_classification::Plesken_matrix_up(
int depth,
22 int *&P,
int &N,
int verbose_level)
24 int f_v = (verbose_level >= 1);
33 cout <<
"poset_classification::Plesken_matrix_up" << endl;
39 for (i = 0; i <= depth; i++) {
41 Fst[i + 1] = Fst[i] + Nb[i];
45 for (i = 0; i <= depth; i++) {
46 for (j = 0; j <= depth; j++) {
48 for (a = 0; a < N1; a++) {
49 for (b = 0; b < N2; b++) {
50 cnt = Pij[a * N2 + b];
51 P[(Fst[i] + a) * N + Fst[j] + b] = cnt;
58 cout <<
"poset_classification::Plesken_matrix_up done" << endl;
62void poset_classification::Plesken_matrix_down(
int depth,
63 int *&P,
int &N,
int verbose_level)
65 int f_v = (verbose_level >= 1);
74 cout <<
"poset_classification::Plesken_matrix_down" << endl;
80 for (i = 0; i <= depth; i++) {
82 Fst[i + 1] = Fst[i] + Nb[i];
86 for (i = 0; i <= depth; i++) {
87 for (j = 0; j <= depth; j++) {
89 Pij, N1, N2, verbose_level - 1);
90 for (a = 0; a < N1; a++) {
91 for (b = 0; b < N2; b++) {
92 cnt = Pij[a * N2 + b];
93 P[(Fst[i] + a) * N + Fst[j] + b] = cnt;
100 cout <<
"poset_classification::Plesken_matrix_down done" << endl;
104void poset_classification::Plesken_submatrix_up(
int i,
int j,
105 int *&Pij,
int &N1,
int &N2,
int verbose_level)
107 int f_v = (verbose_level >= 1);
111 cout <<
"poset_classification::Plesken_submatrix_up "
112 "i=" << i <<
" j=" << j << endl;
117 for (a = 0; a < N1; a++) {
118 for (b = 0; b < N2; b++) {
120 i, a, j, b, verbose_level - 1);
124 cout <<
"poset_classification::Plesken_submatrix_up done" << endl;
128void poset_classification::Plesken_submatrix_down(
int i,
int j,
129 int *&Pij,
int &N1,
int &N2,
int verbose_level)
131 int f_v = (verbose_level >= 1);
135 cout <<
"poset_classification::Plesken_submatrix_down "
136 "i=" << i <<
" j=" << j << endl;
141 for (a = 0; a < N1; a++) {
142 for (b = 0; b < N2; b++) {
144 i, a, j, b, verbose_level - 1);
148 cout <<
"poset_classification::Plesken_submatrix_down done" << endl;
152int poset_classification::count_incidences_up(
int lvl1,
int po1,
153 int lvl2,
int po2,
int verbose_level)
155 int f_v = (verbose_level >= 1);
156 int f_vv = (verbose_level >= 2);
164 cout <<
"poset_classification::count_incidences_up "
165 "lvl1=" << lvl1 <<
" po1=" << po1
166 <<
" lvl2=" << lvl2 <<
" po2=" << po2 << endl;
186 for (i = 0; i < ol; i++) {
194 cout <<
"set2 " << i <<
" / " << ol <<
"=";
200 set, lvl1, set2, lvl2, verbose_level - 2);
205 cout <<
"f_contained=" << f_contained << endl;
219 cout <<
"poset_classification::count_incidences_up "
220 "lvl1=" << lvl1 <<
" po1=" << po1
221 <<
" lvl2=" << lvl2 <<
" po2=" << po2
222 <<
" cnt=" << cnt << endl;
227int poset_classification::count_incidences_down(
228 int lvl1,
int po1,
int lvl2,
int po2,
int verbose_level)
230 int f_v = (verbose_level >= 1);
231 int f_vv = (verbose_level >= 2);
239 cout <<
"poset_classification::count_incidences_down "
240 "lvl1=" << lvl1 <<
" po1=" << po1
241 <<
" lvl2=" << lvl2 <<
" po2=" << po2 << endl;
260 for (i = 0; i < ol; i++) {
268 cout <<
"set1 " << i <<
" / " << ol <<
"=";
275 set1, lvl1, set, lvl2, verbose_level - 2);
280 cout <<
"f_contained=" << f_contained << endl;
293 cout <<
"poset_classification::count_incidences_down "
294 "lvl1=" << lvl1 <<
" po1=" << po1
295 <<
" lvl2=" << lvl2 <<
" po2=" << po2
296 <<
" cnt=" << cnt << endl;
301void poset_classification::Asup_to_Ainf(
int t,
int k,
302 int *M_sup,
int *M_inf,
int verbose_level)
304 int f_v = (verbose_level >= 1);
316 cout <<
"poset_classification::Asup_to_Ainf" << endl;
322 cout <<
"poset_classification::Asup_to_Ainf go=" << go << endl;
329 cout <<
"poset_classification::Asup_to_Ainf "
330 "computing orbit lengths t-orbits" << endl;
332 for (i = 0; i < Nt; i++) {
337 cout <<
"i : go_t[i] : ol_t[i]" << endl;
338 for (i = 0; i < Nt; i++) {
339 cout << i <<
" : " << go_t[i] <<
" : " << ol_t[i] << endl;
343 cout <<
"poset_classification::Asup_to_Ainf "
344 "computing orbit lengths k-orbits" << endl;
346 for (i = 0; i < Nk; i++) {
351 cout <<
"i : go_k[i] : ol_k[i]" << endl;
352 for (i = 0; i < Nk; i++) {
353 cout << i <<
" : " << go_k[i] <<
" : " << ol_k[i] << endl;
357 cout <<
"poset_classification::Asup_to_Ainf computing Ainf" << endl;
359 for (i = 0; i < Nt; i++) {
360 for (j = 0; j < Nk; j++) {
361 a = M_sup[i * Nk + j];
362 aa.
create(a, __FILE__, __LINE__);
363 D.
mult(ol_t[i], aa, bb);
366 cout <<
"poset_classification::Asup_to_Ainf "
367 "stabilizer order does not "
368 "divide group order" << endl;
369 cout <<
"i=" << i <<
" j=" << j
370 <<
" M_sup[i,j] = " << a
371 <<
" ol_t[i]=" << ol_t[i]
372 <<
" ol_k[j]=" << ol_k[j] << endl;
376 M_inf[i * Nk + j] = c;
380 cout <<
"poset_classification::Asup_to_Ainf computing Ainf done" << endl;
387 cout <<
"poset_classification::Asup_to_Ainf done" << endl;
391void poset_classification::test_for_multi_edge_in_classification_graph(
392 int depth,
int verbose_level)
394 int f_v = (verbose_level >= 1);
398 cout <<
"poset_classification::test_for_multi_edge_in_classification_graph "
399 "depth=" << depth << endl;
401 for (i = 0; i <= depth; i++) {
405 cout <<
"poset_classification::test_for_multi_edge_in_classification_graph "
406 "level=" << i <<
" with " << l <<
" nodes" << endl;
408 for (j = 0; j < l; j++) {
423 cout <<
"multiedge detected ! level "
424 << i <<
" with " << l <<
" nodes, fusion ("
425 << j <<
"/" << h1 <<
") -> ("
437 if (E2->data1 == E1->data1 && E2->data2 == E1->data2) {
438 cout <<
"multiedge detected!" << endl;
439 cout <<
"fusion (" << f + j <<
"/" << h1
442 cout <<
"fusion (" << f + j <<
"/" << h2
452 cout <<
"poset_classification::test_for_multi_edge_in_classification_graph "
453 "level=" << i <<
" with " << l <<
" nodes done" << endl;
457 cout <<
"poset_classification::test_for_multi_edge_in_classification_graph "
463 int level,
long int *&M,
int &nb_rows,
int &nb_cols,
int verbose_level)
466 int f_v = (verbose_level >= 1);
468 int f1, f2, i, j, k, I, J, len;
472 cout <<
"poset_classification::Kramer_Mesner_matrix_neighboring "
473 "level=" << level << endl;
483 for (i = 0; i < nb_rows * nb_cols; i++) {
489 cout <<
"poset_classification::Kramer_Mesner_matrix_neighboring "
490 "the size of the matrix is " << nb_rows <<
" x " << nb_cols << endl;
493 for (i = 0; i < nb_rows; i++) {
495 cout <<
"poset_classification::Kramer_Mesner_matrix_neighboring "
496 "i=" << i <<
" / " << nb_rows << endl;
502 cout <<
"poset_classification::Kramer_Mesner_matrix_neighboring "
503 "i=" << i <<
" / " << nb_rows <<
" extension "
508 cout <<
"poset_classification::Kramer_Mesner_matrix_neighboring "
509 "i=" << i <<
" / " << nb_rows <<
" extension "
511 <<
" type extension node" << endl;
516 M[i * nb_cols + j] += len;
520 cout <<
"poset_classification::Kramer_Mesner_matrix_neighboring "
521 "i=" << i <<
" / " << nb_rows <<
" extension "
523 <<
" type fusion" << endl;
535 cout <<
"poset_classification::Kramer_Mesner_matrix_neighboring "
536 "O1->get_E(ext1)->type != EXTENSION_TYPE_EXTENSION "
537 "something is wrong" << endl;
545 gen->S[level] = O->E[k].pt;
547 for (ii = 0; ii < level + 1; ii++) {
548 gen->set[level + 1][ii] = gen->S[ii];
551 gen->A->element_one(gen->transporter->ith(level + 1), 0);
560 cout <<
"after apply_isomorphism J=" << J << endl;
573 gen->A->element_retrieve(O->E[k].data, gen->Elt1, 0);
575 gen->A2->map_a_set(gen->S, gen->S0, level + 1, gen->Elt1, 0);
579 int_vec_heapsort(gen->S0, level + 1);
584 J = gen->find_poset_orbit_node_for_set(level + 1, gen->S0, 0);
587 M[i * nb_cols + j] += len;
592 cout <<
"poset_classification::Kramer_Mesner_matrix_neighboring "
593 "level=" << level <<
" done" << endl;
598 long int *Mtr,
long int *Mrk,
long int *&Mtk,
599 int nb_r1,
int nb_c1,
int nb_r2,
int nb_c2,
int &nb_r3,
int &nb_c3,
604 int f_v = (verbose_level >= 1);
605 int i, j, h, a, b, c, s = 0;
609 cout <<
"poset_classification::Mtk_via_Mtr_Mrk t = " << t <<
", r = "
610 << r <<
", k = " << k << endl;
612 if (nb_c1 != nb_r2) {
613 cout <<
"poset_classification::Mtk_via_Mtr_Mrk nb_c1 != nb_r2" << endl;
620 for (i = 0; i < nb_r3; i++) {
621 for (j = 0; j < nb_c3; j++) {
623 for (h = 0; h < nb_c1; h++) {
624 a = Mtr[i * nb_c1 + h];
625 b = Mrk[h * nb_c2 + j];
628 Mtk[i * nb_c3 + j] = c;
648 cout <<
"poset_classification::Mtk_via_Mtr_Mrk neither subset lattice nor subspace lattice" << endl;
652 cout <<
"poset_classification::Mtk_via_Mtr_Mrk dividing by " << s << endl;
656 for (i = 0; i < nb_r3; i++) {
657 for (j = 0; j < nb_c3; j++) {
658 Mtk[i * nb_c3 + j] /= s;
662 cout <<
"poset_classification::Mtk_via_Mtr_Mrk matrix M_{" << t <<
"," << k
663 <<
"} of format " << nb_r3 <<
" x " << nb_c3 <<
" computed" << endl;
668 int *Nb_rows,
int *Nb_cols,
670 long int *&Mtk,
int &nb_r,
int &nb_c,
673 int f_v = (verbose_level >= 1);
677 cout <<
"poset_classification::Mtk_from_MM t = " << t <<
", k = " << k << endl;
680 cout <<
"poset_classification::Mtk_from_MM k == t" << endl;
693 for (i = 0; i < Tr; i++) {
694 for (j = 0; j < Tc; j++) {
695 T[i * Tc + j] = pM[t][i * Tc + j];
699 cout <<
"poset_classification::Mtk_from_MM Tr=" << Tr <<
" Tc=" << Tc << endl;
703 for (i = t + 2; i <= k; i++) {
705 cout <<
"poset_classification::Mtk_from_MM i = " << i <<
" calling Mtk_via_Mtr_Mrk" << endl;
709 Tr, Tc, Nb_rows[i - 1], Nb_cols[i - 1], T2r, T2c,
729 cout <<
"poset_classification::Mtk_from_MM nb_r=" << nb_r <<
" nb_c=" << nb_c << endl;
733 cout <<
"poset_classification::Mtk_from_MM t = " << t <<
", k = " << k <<
" done" << endl;
field_theory::finite_field * F
a collection of combinatorial functions
void binomial(ring_theory::longinteger_object &a, int n, int k, int verbose_level)
void q_binomial(ring_theory::longinteger_object &a, int n, int k, int q, int verbose_level)
domain to compute with objects of type longinteger
void integral_division_exact(longinteger_object &a, longinteger_object &b, longinteger_object &a_over_b)
void mult(longinteger_object &a, longinteger_object &b, longinteger_object &c)
void integral_division(longinteger_object &a, longinteger_object &b, longinteger_object &q, longinteger_object &r, int verbose_level)
a class to represent arbitrary precision integers
void create(long int i, const char *file, int line)
represents a flag in the poset classification algorithm; related to poset_orbit_node
int first_node_at_level(int i)
int poset_structure_is_contained(long int *set1, int sz1, long int *set2, int sz2, int verbose_level)
void orbit_element_unrank(int depth, int orbit_idx, long int rank, long int *set, int verbose_level)
void Kramer_Mesner_matrix_neighboring(int level, long int *&M, int &nb_rows, int &nb_cols, int verbose_level)
poset_orbit_node * get_node_ij(int level, int node)
int count_incidences_up(int lvl1, int po1, int lvl2, int po2, int verbose_level)
int nb_orbits_at_level(int level)
poset_orbit_node * get_node(int node_idx)
int orbit_length_as_int(int orbit_at_level, int level)
void get_stabilizer_order(int level, int orbit_at_level, ring_theory::longinteger_object &go)
void Mtk_via_Mtr_Mrk(int t, int r, int k, long int *Mtr, long int *Mrk, long int *&Mtk, int nb_r1, int nb_c1, int nb_r2, int nb_c2, int &nb_r3, int &nb_c3, int verbose_level)
int count_incidences_down(int lvl1, int po1, int lvl2, int po2, int verbose_level)
void Plesken_submatrix_up(int i, int j, int *&Pij, int &N1, int &N2, int verbose_level)
void Plesken_submatrix_down(int i, int j, int *&Pij, int &N1, int &N2, int verbose_level)
void Mtk_from_MM(long int **pM, int *Nb_rows, int *Nb_cols, int t, int k, long int *&Mtk, int &nb_r, int &nb_c, int verbose_level)
int first_node_at_level(int i)
to represent one poset orbit; related to the class poset_classification
extension * get_E(int idx)
int apply_isomorphism(poset_classification *gen, int lvl, int current_node, int current_extension, int len, int f_tolerant, int verbose_level)
void store_set(poset_classification *gen, int i)
int get_nb_of_extensions()
algebra::vector_space * VS
#define Lint_vec_copy(A, B, C)
#define Lint_vec_print(A, B, C)
#define NEW_OBJECTS(type, n)
the orbiter library for the classification of combinatorial objects
#define EXTENSION_TYPE_FUSION
#define EXTENSION_TYPE_EXTENSION