Orbiter 2022
Combinatorial Objects
delandtsheer_doyen.cpp
Go to the documentation of this file.
1/*
2 * delandtsheer_doyen.cpp
3 *
4 * Created on: Nov 5, 2019
5 * Author: anton
6 */
7
8
9
10
11
12#include "orbiter.h"
13
14using namespace std;
15
16namespace orbiter {
17namespace layer5_applications {
18namespace apps_combinatorics {
19
20
21static void delandtsheer_doyen_early_test_func_callback(long int *S, int len,
22 long int *candidates, int nb_candidates,
23 long int *good_candidates, int &nb_good_candidates,
24 void *data, int verbose_level);
25
26
27
28
30{
31
32 Descr = NULL;
33
34 Xsize = 0; // = D = q1 = # of rows
35 Ysize = 0; // = C = q2 = # of cols
36
37 V = 0;
38 b = 0;
39
40
41 line = NULL; // [K];
42 row_sum = NULL;
43 col_sum = NULL;
44
45
46 M1 = NULL;
47 M2 = NULL;
48 A1 = NULL;
49 A2 = NULL;
50 SG = NULL;
51 F1 = NULL;
52 F2 = NULL;
53 A = NULL;
54 A0 = NULL;
55 P = NULL;
56
57 Poset_pairs = NULL;
58 Poset_search = NULL;
59 Pairs = NULL;
60 Gen = NULL;
61
62 pair_orbit = NULL;
63 nb_orbits = 0;
64 transporter = NULL;
65 tmp_Elt = NULL;
66 orbit_length = NULL;
67 orbit_covered = NULL;
68 orbit_covered_max = NULL;
69 // orbit_covered_max[i] = orbit_length[i] / b;
70 orbits_covered = NULL;
71
72
73 // intersection type tests:
74
77
78 // row intersection type
79 row_type_cur = NULL; // [nb_row_types + 1]
80 row_type_this_or_bigger = NULL; // [nb_row_types + 1]
81
82 // col intersection type
83 col_type_cur = NULL; // [nb_col_types + 1]
84 col_type_this_or_bigger = NULL; // [nb_col_types + 1]
85
86
87
88 // for testing the mask:
89 f_row_used = NULL; // [Xsize];
90 f_col_used = NULL; // [Ysize];
91 row_idx = NULL; // [Xsize];
92 col_idx = NULL; // [Ysize];
93 singletons = NULL; // [K];
94
95 // temporary data
96 row_col_idx = NULL; // [Xsize];
97 col_row_idx = NULL; // [Ysize];
98
99 // a file where we print the solution, it has the extension bblt
100 // for "base block line transitive" design
101 //fp_sol = NULL;
102
103 live_points = NULL;
104 nb_live_points = 0;
105
106}
107
109{
110 if (line) {
112 }
113 if (row_sum) {
115 }
116 if (col_sum) {
118 }
119 if (pair_orbit) {
121 }
122 if (transporter) {
124 }
125 if (tmp_Elt) {
127 }
128 if (orbit_length) {
130 }
131 if (orbit_covered) {
133 }
134 if (orbit_covered_max) {
136 }
137 if (orbits_covered) {
139 }
140 if (row_type_cur) {
142 }
145 }
146 if (col_type_cur) {
148 }
151 }
152 if (f_row_used) {
154 }
155 if (f_col_used) {
157 }
158 if (row_idx) {
160 }
161 if (col_idx) {
163 }
164 if (singletons) {
166 }
167 if (row_col_idx) {
169 }
170 if (col_row_idx) {
172 }
173 if (live_points) {
175 }
176}
177
179 int verbose_level)
180{
181 int f_v = (verbose_level >= 1);
182
183 if (f_v) {
184 cout << "delandtsheer_doyen::init" << endl;
185 }
186
187
189
190
191
192 if (!Descr->f_K) {
193 cout << "please use -K <K> to specify K" << endl;
194 exit(1);
195 }
196 if (!Descr->f_depth) {
197 cout << "please use -depth <depth> to specify depth" << endl;
198 exit(1);
199 }
200
201 if (Descr->f_R) {
205 }
206
207 if (Descr->f_C) {
211 }
212
213 if (Descr->q1 == 1) {
214 Xsize = Descr->d1;
215 Ysize = Descr->d2;
216 }
217 else {
218 Xsize = Descr->q1; // = D = q1 = # of rows
219 Ysize = Descr->q2; // = C = q2 = # of cols
220 }
221
222 V = Xsize * Ysize;
223
224 //cout << "depth=" << depth << endl;
225 if (f_v) {
226 cout << "delandtsheer_doyen::init" << endl;
227 cout << "V=" << V << endl;
228 cout << "K=" << Descr->K << endl;
229 cout << "Xsize=" << Xsize << endl;
230 cout << "Ysize=" << Ysize << endl;
231 cout << "V=" << V << endl;
232 }
233
234 line = NEW_lint(Descr->K);
238
239
240 if (f_v) {
241 cout << "delandtsheer_doyen::init" << endl;
242 cout << "DELANDTSHEER_DOYEN_X=" << Descr->DELANDTSHEER_DOYEN_X << endl;
243 cout << "DELANDTSHEER_DOYEN_Y=" << Descr->DELANDTSHEER_DOYEN_Y << endl;
244 }
245
248
249
252
255
256
257
258
259 if (f_v) {
260 cout << "delandtsheer_doyen::init before create_action" << endl;
261 }
262 create_action(verbose_level);
263 if (f_v) {
264 cout << "delandtsheer_doyen::init after create_action" << endl;
265 }
266
267
268 A0 = A->subaction;
269
271
272
273
274 if (Descr->q1 == 1) {
275
276 if (f_v) {
277 cout << "delandtsheer_doyen::init before create_monomial_group" << endl;
278 }
279 create_monomial_group(verbose_level);
280 if (f_v) {
281 cout << "delandtsheer_doyen::init after create_monomial_group" << endl;
282 }
283
284 }
285
286 else {
288 cout << "delandtsheer_doyen::init action A0 does not "
289 "have strong generators" << endl;
290 exit(1);
291 }
292
293 SG = A0->Strong_gens;
294 SG->group_order(go);
295
296 if (f_v) {
297 cout << "delandtsheer_doyen::init The group " << A->label << " has order " << go
298 << " and permutation degree " << A->degree << endl;
299 }
300 }
301
302
303
304 if (f_v) {
305 show_generators(verbose_level);
306 }
307
308
309 groups::strong_generators *Strong_gens;
310
311 if (Descr->f_subgroup) {
312
313
314 if (f_v) {
315 cout << "delandtsheer_doyen::init before scan_subgroup_generators" << endl;
316 }
317 Strong_gens = scan_subgroup_generators(verbose_level);
318 if (f_v) {
319 cout << "delandtsheer_doyen::init after scan_subgroup_generators" << endl;
320 }
321
322
323 if (f_v) {
324 cout << "delandtsheer_doyen::init before compute_orbits_on_pairs" << endl;
325 }
326 compute_orbits_on_pairs(Strong_gens, verbose_level);
327 if (f_v) {
328 cout << "delandtsheer_doyen::init after compute_orbits_on_pairs" << endl;
329 }
330
331
332 }
333 else {
334 cout << "We don't have -subgroup, so orbits on pairs "
335 "are not computed" << endl;
336 //exit(1);
337 }
338
339
341 SG = Strong_gens;
342 cout << "searching wrt subgroup" << endl;
343 }
344
345
346
352
353 // temporary data
356
357
358 if (Descr->f_singletons) {
359
360 if (f_v) {
361 cout << "delandtsheer_doyen::init before search_singletons" << endl;
362 }
363 search_singletons(verbose_level);
364 if (f_v) {
365 cout << "delandtsheer_doyen::init after search_singletons" << endl;
366 }
367
368
369 }
370 else {
371
372 if (f_v) {
373 cout << "delandtsheer_doyen::init before search_starter" << endl;
374 }
375 search_starter(verbose_level);
376 if (f_v) {
377 cout << "delandtsheer_doyen::init after search_starter" << endl;
378 }
379
380
381 }
382
383
384 if (f_v) {
385 cout << "delandtsheer_doyen::init done" << endl;
386 }
387}
388
389
390
392{
393 int f_v = (verbose_level >= 1);
394 int i, j, a;
395
396 if (f_v) {
397 cout << "delandtsheer_doyen::show_generators" << endl;
398 }
399
400 cout << "Generators are:" << endl;
401 for (i = 0; i < SG->gens->len; i++) {
402 cout << "generator " << i << " / "
403 << SG->gens->len << " is: " << endl;
404 A->element_print_quick(SG->gens->ith(i), cout);
405 cout << "as permutation: " << endl;
407 SG->gens->ith(i), cout,
408 0 /* offset*/,
409 TRUE /* f_do_it_anyway_even_for_big_degree*/,
410 TRUE /* f_print_cycles_of_length_one*/,
411 0 /* verbose_level*/);
412 //A->element_print_as_permutation(SG->gens->ith(i), cout);
413 cout << endl;
414 }
415 cout << "Generators are:" << endl;
416 for (i = 0; i < SG->gens->len; i++) {
418 cout << endl;
419 }
420 cout << "Generators in GAP format are:" << endl;
421 cout << "G := Group([";
422 for (i = 0; i < SG->gens->len; i++) {
424 SG->gens->ith(i), cout,
425 1 /*offset*/,
426 TRUE /* f_do_it_anyway_even_for_big_degree */,
427 FALSE /* f_print_cycles_of_length_one */,
428 0 /* verbose_level*/);
429 if (i < SG->gens->len - 1) {
430 cout << ", " << endl;
431 }
432 }
433 cout << "]);" << endl;
434 cout << "Generators in compact permutation form are:" << endl;
435 cout << SG->gens->len << " " << A->degree << endl;
436 for (i = 0; i < SG->gens->len; i++) {
437 for (j = 0; j < A->degree; j++) {
438 a = A->element_image_of(j,
439 SG->gens->ith(i), 0 /* verbose_level */);
440 cout << a << " ";
441 }
442 cout << endl;
443 }
444 cout << "-1" << endl;
445
446 if (f_v) {
447 cout << "delandtsheer_doyen::show_generators done" << endl;
448 }
449}
450
452{
453 int f_v = (verbose_level >= 1);
454
455 if (f_v) {
456 cout << "delandtsheer_doyen::search_singletons" << endl;
457 }
458
459 int target_depth;
460 target_depth = Descr->K - Descr->depth;
461 cout << "target_depth=" << target_depth << endl;
462
464 char str[1000];
465 string fname;
466 int level = Descr->depth;
467
468 fname.assign("design_");
469 fname.append(Descr->group_label);
470 fname.append("_");
471 fname.append(Descr->mask_label);
472 sprintf(str, "_%d_%d_lvl_%d",
473 Descr->q1, Descr->q2, level);
474 fname.append(str);
475
477 ODF->load(fname, verbose_level);
478 cout << "found " << ODF->nb_cases << " orbits at level " << level << endl;
479
480 int *Orbit_idx;
481 int nb_orbits_not_ruled_out;
482 int orbit_idx;
483 int nb_cases = 0;
484 int nb_cases_eliminated = 0;
485 int f_vv;
486
487 Orbit_idx = NEW_int(ODF->nb_cases);
488 nb_orbits_not_ruled_out = 0;
489
490 for (orbit_idx = 0; orbit_idx < ODF->nb_cases; orbit_idx++) {
491
492 #if 0
493 if (f_split) {
494 if ((orbit_idx % split_m) == split_r) {
495 continue;
496 }
497 }
498 #endif
499
500 if ((orbit_idx % 100)== 0) {
501 f_vv = TRUE;
502 }
503 else {
504 f_vv = FALSE;
505 }
506 if (f_vv) {
507 cout << orbit_idx << " / " << ODF->nb_cases << " : ";
508 Lint_vec_print(cout, ODF->sets[orbit_idx],
509 ODF->set_sizes[orbit_idx]);
510 cout << " : " << ODF->Ago_ascii[orbit_idx] << " : "
511 << ODF->Aut_ascii[orbit_idx] << endl;
512 }
513
514 long int *line0;
515
516 line0 = ODF->sets[orbit_idx];
517 if (ODF->set_sizes[orbit_idx] != level) {
518 cout << "ODF->set_sizes[orbit_idx] != level" << endl;
519 exit(1);
520 }
521
522 create_graph(line0, level, 0 /*verbose_level*/);
523
524 if (f_vv) {
525 cout << "case " << orbit_idx << " / " << ODF->nb_cases
526 << " we found " << nb_live_points << " live points" << endl;
527 }
528 if (nb_live_points < target_depth) {
529 if (f_vv) {
530 cout << "eliminated!" << endl;
531 }
532 nb_cases_eliminated++;
533 }
534 else {
535 Orbit_idx[nb_orbits_not_ruled_out++] = orbit_idx;
536 nb_cases++;
537 }
538 if (f_vv) {
539 cout << "nb_cases=" << nb_cases << " vs ";
540 cout << "nb_cases_eliminated=" << nb_cases_eliminated << endl;
541 }
542 } // orbit_idx
543 cout << "nb_cases=" << nb_cases << endl;
544 cout << "nb_cases_eliminated=" << nb_cases_eliminated << endl;
545
546 int orbit_not_ruled_out;
547 int nb_sol = 0;
548
549 for (orbit_not_ruled_out = 0;
550 orbit_not_ruled_out < nb_orbits_not_ruled_out;
551 orbit_not_ruled_out++) {
552 orbit_idx = Orbit_idx[orbit_not_ruled_out];
553
554
555 if ((orbit_not_ruled_out % 100)== 0) {
556 f_vv = TRUE;
557 }
558 else {
559 f_vv = FALSE;
560 }
561
562
563 if (f_vv) {
564 cout << "orbit_not_ruled_out=" << orbit_not_ruled_out
565 << " / " << nb_orbits_not_ruled_out
566 << " is orbit_idx " << orbit_idx << endl;
567 }
568
569 long int *line0;
570
571 line0 = ODF->sets[orbit_idx];
572 if (ODF->set_sizes[orbit_idx] != level) {
573 cout << "ODF->set_sizes[orbit_idx] != level" << endl;
574 exit(1);
575 }
576
577 create_graph(line0, level, 0 /*verbose_level*/);
578
579 if (f_vv) {
580 cout << "orbit_not_ruled_out=" << orbit_not_ruled_out << " / "
581 << nb_orbits_not_ruled_out << " is orbit_idx"
582 << orbit_idx << " / " << ODF->nb_cases
583 << " we found " << nb_live_points
584 << " live points" << endl;
585 }
586 if (nb_live_points == target_depth) {
587 Lint_vec_copy(line0, line, level);
588 Lint_vec_copy(live_points, line + level, target_depth);
589 if (check_orbit_covering(line, Descr->K, 0 /* verbose_level */)) {
590 cout << "found a solution in orbit " << orbit_idx << endl;
591 nb_sol++;
592 }
593
594
595
596 }
597 else {
598 cout << "orbit_not_ruled_out=" << orbit_not_ruled_out << " / "
599 << nb_orbits_not_ruled_out << " is orbit_idx"
600 << orbit_idx << " / " << ODF->nb_cases
601 << " we found " << nb_live_points
602 << " live points, doing a search; ";
603 int *subset;
604 int nCk, l;
606
607 subset = NEW_int(target_depth);
608 nCk = Combi.int_n_choose_k(nb_live_points, target_depth);
609
610 cout << "nb_live_points = " << nb_live_points << " target_depth = " << target_depth << " nCk = " << nCk << endl;
611 for (l = 0; l < nCk; l++) {
612
613 Combi.unrank_k_subset(l, subset, nb_live_points, target_depth);
614
615 Lint_vec_copy(line0, line, level);
616
617 orbiter_kernel_system::Orbiter->Int_vec->apply_lint(subset, live_points, line + level, target_depth);
618
619 if (check_orbit_covering(line, Descr->K, 0 /* verbose_level */)) {
620 cout << "found a solution, subset " << l
621 << " / " << nCk << " in orbit "
622 << orbit_idx << endl;
623 nb_sol++;
624 }
625 } // next l
626
627 FREE_int(subset);
628 } // else
629 } // next orbit_not_ruled_out
630
631 cout << "nb_sol=" << nb_sol << endl;
632 cout << "searching singletons done" << endl;
633
634 if (f_v) {
635 cout << "delandtsheer_doyen::search_singletons done" << endl;
636 }
637}
638
639
640
642{
643 int f_v = (verbose_level >= 1);
645 int t0 = Os.os_ticks();
646
647 string label;
648
649
650 if (f_v) {
651 cout << "delandtsheer_doyen::search_starter" << endl;
652 }
653
655
656
657 if (!Descr->f_problem_label) {
658 cout << "please use -problem_label <string : problem_label>" << endl;
659 exit(1);
660 }
661
662 if (Descr->f_subgroup) {
663
664 label.assign("design_");
665 label.append(Descr->group_label);
666 label.append("_");
667 label.append(Descr->mask_label);
668 }
669 else {
670
671 label.assign("design_no_group_");
672 }
673 char str[1000];
674
675 sprintf(str, "_%d_%d", Descr->q1, Descr->q2);
676 label.append(str);
677
678
681 //Gen->depth = Descr->depth;
682 //Control_search = NEW_OBJECT(poset_classification_control);
685 verbose_level);
686
687 if (f_v) {
688 cout << "delandtsheer_doyen::search_starter before "
689 "Poset->add_testing_without_group" << endl;
690 }
692 delandtsheer_doyen_early_test_func_callback,
693 this /* void *data */,
694 verbose_level);
695
696 if (f_v) {
697 cout << "delandtsheer_doyen::search_starter "
698 "before Gen->init" << endl;
699 }
701 Descr->depth /* sz */, verbose_level);
702 if (f_v) {
703 cout << "delandtsheer_doyen::search_starter "
704 "after Gen->init" << endl;
705 }
706
707
708 int f_use_invariant_subset_if_available = TRUE;
709 int f_debug = FALSE;
710
711 //t0 = os_ticks();
712
713 if (f_v) {
714 cout << "delandtsheer_doyen::search_starter "
715 "before Gen->main" << endl;
716 cout << "A=";
717 A->print_info();
718 cout << "A0=";
719 A0->print_info();
720 }
721
722
723 //Gen->f_allowed_to_show_group_elements = TRUE;
724
725 //Control->f_max_depth = FALSE;
726 //Gen->depth = Descr->depth;
727 Gen->main(t0,
728 Descr->depth /* schreier_depth */,
729 f_use_invariant_subset_if_available,
730 f_debug,
731 verbose_level - 2);
732
733 if (f_v) {
734 cout << "delandtsheer_doyen::search_starter "
735 "after Gen->main" << endl;
736 }
737
738
739 int nb_k_orbits;
740 int sz;
741 int h, i, pi, j, pj, o;
742 int k = Descr->depth;
743 int l;
744 int *Covered_orbits;
745 int k2 = k * (k - 1) >> 1;
746
747 nb_k_orbits = Gen->nb_orbits_at_level(Descr->depth);
748 cout << "target level: " << Descr->depth << endl;
749 cout << "k2: " << k2 << endl;
750 cout << "number of k-orbits at target level: " << nb_k_orbits << endl;
751
752
753 Covered_orbits = NEW_int(nb_k_orbits * k2);
754
755 for (h = 0; h < nb_k_orbits; h++) {
756
757 Gen->get_set(k, h, line, sz);
758
759 if (FALSE) {
760 cout << h << " : ";
761 Lint_vec_print(cout, line, sz);
762 }
763
764 l = 0;
765 for (i = 0; i < k; i++) {
766 pi = line[i];
767 for (j = i + 1; j < k; j++, l++) {
768 pj = line[j];
769 o = find_pair_orbit(pi, pj, 0 /*verbose_level - 1*/);
770 if (pi == pj) {
771 cout << "delandtsheer_doyen::search_starter "
772 "pi = " << pi << " == pj = " << pj << endl;
773 exit(1);
774 }
775 Covered_orbits[h * k2 + l] = o;
776 }
777 }
778 if (FALSE) {
779 cout << " : ";
780 Int_vec_print(cout, Covered_orbits + h * k2, k2);
781 cout << endl;
782 }
783
784 }
786 string fname;
787
788 fname.assign(Descr->problem_label);
789 fname.append("_pair_covering.csv");
790 Fio.int_matrix_write_csv(fname, Covered_orbits, nb_k_orbits, k2);
791
792 cout << "Written file " << fname << " of size " << Fio.file_size(fname) << endl;
793
794
795#if 0
796
797 if (f_v) {
798 cout << "delandtsheer_doyen::search_starter "
799 "before Gen->draw_poset" << endl;
800 }
802 0 /* data1 */, TRUE /* f_embedded */, TRUE /* f_sideways */, 100 /* rad */, 0.45 /* scale */,
803 verbose_level);
804#endif
805
806 if (f_v) {
807 cout << "delandtsheer_doyen::search_starter done" << endl;
808 }
809
810}
811
812
814 groups::strong_generators *Strong_gens, int verbose_level)
815{
816 int f_v = (verbose_level >= 1);
817 int i;
819 int t0 = Os.os_ticks();
820
821 if (f_v) {
822 cout << "delandtsheer_doyen::compute_orbits_on_pairs" << endl;
823 }
825
826
829
831 Poset_pairs->init_subset_lattice(A0, A, Strong_gens,
832 verbose_level);
833
834
835 if (f_v) {
836 cout << "delandtsheer_doyen::compute_orbits_on_pairs "
837 "before Pairs->init" << endl;
838 }
840 2 /* sz */, verbose_level);
841 if (f_v) {
842 cout << "direct_product_action::compute_orbits_on_pairs "
843 "after Pairs->init" << endl;
844 }
845
846
847
848 int f_use_invariant_subset_if_available;
849 int f_debug;
850
851 f_use_invariant_subset_if_available = TRUE;
852 f_debug = FALSE;
853
854
855 if (f_v) {
856 cout << "delandtsheer_doyen::compute_orbits_on_pairs "
857 "before Pairs->main" << endl;
858 cout << "A=";
859 A->print_info();
860 cout << "A0=";
861 A0->print_info();
862 }
863
864
865 //Pairs->f_allowed_to_show_group_elements = TRUE;
866
869
870 //Pairs->depth = 2;
871 Pairs->main(t0,
872 2 /* schreier_depth */,
873 f_use_invariant_subset_if_available,
874 f_debug,
875 verbose_level - 2);
876
877 if (f_v) {
878 cout << "delandtsheer_doyen::compute_orbits_on_pairs "
879 "after Pairs->main" << endl;
880 }
881
882
884
885 if (f_v) {
886 cout << "delandtsheer_doyen::compute_orbits_on_pairs "
887 "nb_orbits = "
888 << nb_orbits << endl;
889 }
890
893
898
900
901
902
903 for (i = 0; i < nb_orbits; i++) {
905 i /* orbit_at_level*/, 2 /* level*/);
908 cout << "integrality conditions violated (2)" << endl;
909 cout << "Descr->nb_orbits_on_blocks = " << Descr->nb_orbits_on_blocks << endl;
910 cout << "pair orbit i=" << i << " / " << nb_orbits << endl;
911 cout << "orbit_length[i]=" << orbit_length[i] << endl;
912 cout << "b=" << b << endl;
913 exit(1);
914 }
915 }
916 cout << "i : orbit_length[i] : orbit_covered_max[i]" << endl;
917 for (i = 0; i < nb_orbits; i++) {
918 cout << i << " : " << orbit_length[i]
919 << " : " << orbit_covered_max[i] << endl;
920 }
921
922 compute_pair_orbit_table(verbose_level);
923 //write_pair_orbit_file(verbose_level);
924 if (f_v) {
925 cout << "delandtsheer_doyen::compute_orbits_on_pairs done" << endl;
926 }
927}
928
930{
931 int f_v = (verbose_level >= 1);
932 groups::strong_generators *Strong_gens;
933
934 if (f_v) {
935 cout << "delandtsheer_doyen::scan_subgroup_generators" << endl;
936 }
938 int *data;
939 int sz;
940 int nb_gens;
942
943 Int_vec_scan(Descr->subgroup_gens.c_str(), data, sz);
944 nb_gens = sz / A->make_element_size;
945 if (f_v) {
946 cout << "before Strong_gens->init_from_data_with_target_go_ascii" << endl;
947 }
948 cout << "nb_gens=" << nb_gens << endl;
950 data,
951 nb_gens, A0->make_element_size,
952 Descr->subgroup_order.c_str(),
953 nice_gens,
954 verbose_level + 2);
955 FREE_OBJECT(nice_gens);
956 if (f_v) {
957 cout << "delandtsheer_doyen "
958 "after Strong_gens->init_from_data_with_target_go_ascii" << endl;
959 }
960 if (f_v) {
961 cout << "delandtsheer_doyen::scan_subgroup_generators done" << endl;
962 }
963 return Strong_gens;
964}
965
967{
968 int f_v = (verbose_level >= 1);
969 int i, j, a;
970
971 if (f_v) {
972 cout << "delandtsheer_doyen::create_monomial_group" << endl;
973 }
977
980
981 if (f_v) {
982 cout << "before generators_for_the_monomial_group "
983 "action" << A1->label << endl;
984 }
986 M1, verbose_level);
987 if (f_v) {
988 cout << "after generators_for_the_monomial_group "
989 "action" << A1->label << endl;
990 }
991
992
993 if (f_v) {
994 cout << "before generators_for_the_monomial_group "
995 "action" << A2->label << endl;
996 }
998 M2, verbose_level);
999 if (f_v) {
1000 cout << "after generators_for_the_monomial_group "
1001 "action" << A2->label << endl;
1002 }
1003
1004 if (f_v) {
1005 cout << "direct_product_action::init "
1006 "before lift_generators" << endl;
1007 }
1009 SG1,
1010 SG2,
1011 A0, SG3,
1012 verbose_level);
1013 if (f_v) {
1014 cout << "direct_product_action::init "
1015 "after lift_generators" << endl;
1016 }
1017
1018 SG = SG3;
1019 SG->group_order(go);
1020
1021 cout << "The group has order " << go << endl;
1022
1023 actions::action *Ar;
1024 long int *points;
1025 int nb_points;
1026 int h;
1027
1028 nb_points = Descr->d1 * Descr->d2;
1029 points = NEW_lint(nb_points);
1030 h = 0;
1031 for (i = 0; i < Descr->d1; i++) {
1032 for (j = 0; j < Descr->d2; j++) {
1033 a = i * A2->degree + j;
1034 points[h++] = a;
1035 }
1036 } // next i
1037
1038
1039 Ar = A->restricted_action(points, nb_points,
1040 verbose_level);
1041
1042 A = Ar;
1043 if (f_v) {
1044 cout << "delandtsheer_doyen::create_monomial_group done" << endl;
1045 }
1046}
1047
1048
1050{
1051 int f_v = (verbose_level >= 1);
1052
1053 if (f_v) {
1054 cout << "delandtsheer_doyen::create_action" << endl;
1055 }
1058
1059 if (Descr->q1 == 1) {
1060
1062
1063 F1->finite_field_init(2, FALSE /* f_without_tables */, 0);
1064 F2->finite_field_init(2, FALSE /* f_without_tables */, 0);
1065
1066 if (f_v) {
1067 cout << "delandtsheer_doyen::create_action initializing projective groups:" << endl;
1068 }
1069
1071 FALSE /* f_semilinear */, TRUE /* f_basis */, TRUE /* f_init_sims */,
1072 nice_gens,
1073 verbose_level - 1);
1074 M1 = A1->G.matrix_grp;
1075 FREE_OBJECT(nice_gens);
1076
1078 FALSE /* f_semilinear */, TRUE /* f_basis */, TRUE /* f_init_sims */,
1079 nice_gens,
1080 verbose_level - 1);
1081 M2 = A1->G.matrix_grp;
1082 FREE_OBJECT(nice_gens);
1083
1084 b = 0;
1085
1086 }
1087 else {
1088
1089
1090
1091 b = (V * (V - 1)) / (Descr->K * (Descr->K - 1));
1092
1093 if (b * (Descr->K * (Descr->K - 1)) != (V * (V - 1))) {
1094 cout << "delandtsheer_doyen::create_action integrality conditions violated" << endl;
1095 exit(1);
1096 }
1097
1098 cout << "b=" << b << endl;
1099
1100
1101
1102 F1->finite_field_init(Descr->q1, FALSE /* f_without_tables */, 0);
1103 F2->finite_field_init(Descr->q2, FALSE /* f_without_tables */, 0);
1104
1105
1106
1107 if (f_v) {
1108 cout << "delandtsheer_doyen::create_action initializing affine groups:" << endl;
1109 }
1110
1112 FALSE /* f_semilinear */, A1, verbose_level);
1113
1115 FALSE /* f_semilinear */, A2, verbose_level);
1116 }
1117
1118 if (f_v) {
1119 cout << "delandtsheer_doyen::create_action before "
1120 "AG.init_direct_product_group_and_restrict" << endl;
1121 }
1122
1124
1126 verbose_level);
1127
1128 if (f_v) {
1129 cout << "delandtsheer_doyen::create_action after "
1130 "AG.init_direct_product_group_and_restrict" << endl;
1131 }
1132
1133 if (!A->f_has_subaction) {
1134 cout << "delandtsheer_doyen::create_action action "
1135 "A does not have a subaction" << endl;
1136 exit(1);
1137 }
1138 if (f_v) {
1139 cout << "delandtsheer_doyen::create_action done" << endl;
1140 }
1141}
1142
1143void delandtsheer_doyen::create_graph(long int *line0, int len, int verbose_level)
1144{
1145 int f_v = (verbose_level >= 1);
1146 int i, a, x, y, h, ph, k, pk, o;
1147
1148 if (f_v) {
1149 cout << "delandtsheer_doyen::create_graph" << endl;
1150 }
1151
1154
1155 for (i = 0; i < len; i++) {
1156 a = line0[i];
1157 x = a / Ysize;
1158 y = a % Ysize;
1159 //cout << "i=" << i << " / " << len << " a=" << a
1160 // << " x=" << x << " y=" << y << endl;
1161 row_sum[x]++;
1162 col_sum[y]++;
1163 }
1164
1165 if (!check_orbit_covering(line0,
1166 len, 0 /* verbose_level */)) {
1167 cout << "delandtsheer_doyen::create_graph line0 is not good (check_orbit_covering)" << endl;
1168 check_orbit_covering(line0, len, 2 /* verbose_level */);
1169 exit(1);
1170 }
1171
1172 nb_live_points = 0;
1173 for (x = 0; x < Xsize; x++) {
1174 if (row_sum[x]) {
1175 continue;
1176 }
1177 for (y = 0; y < Ysize; y++) {
1178 if (col_sum[y]) {
1179 continue;
1180 }
1181 a = x * Ysize + y;
1182 //cout << "testing point a=" << a << endl;
1183 for (h = 0; h < len; h++) {
1184
1185 ph = line0[h];
1186 o = find_pair_orbit(ph, a, 0 /*verbose_level - 1*/);
1187 orbit_covered[o]++;
1188 if (orbit_covered[o] > orbit_covered_max[o]) {
1189 for (k = h; k >= 0; k--) {
1190 pk = line0[k];
1191 o = find_pair_orbit(pk, a, 0 /*verbose_level - 1*/);
1192 orbit_covered[o]--;
1193 }
1194 break;
1195 }
1196 } // next h
1197 if (h == len) {
1199 }
1200 } // next y
1201 } // next x
1202 if (f_v) {
1203 cout << "found " << nb_live_points << " live points" << endl;
1204 }
1205
1206 if (f_v) {
1207 cout << "delandtsheer_doyen::create_graph done" << endl;
1208 }
1209}
1210
1211
1212int delandtsheer_doyen::find_pair_orbit(int i, int j, int verbose_level)
1213{
1214 int f_v = (verbose_level >= 1);
1215 int orbit_no;
1216
1217 if (f_v) {
1218 cout << "delandtsheer_doyen::find_pair_orbit" << endl;
1219 }
1220 if (i == j) {
1221 cout << "delandtsheer_doyen::find_pair_orbit "
1222 "i = j = " << j << endl;
1223 exit(1);
1224 }
1225 orbit_no = pair_orbit[i * V + j];
1226 if (f_v) {
1227 cout << "delandtsheer_doyen::find_pair_orbit done" << endl;
1228 }
1229 return orbit_no;
1230}
1231
1232int delandtsheer_doyen::find_pair_orbit_by_tracing(int i, int j, int verbose_level)
1233{
1234 int f_v = (verbose_level >= 1);
1235 int orbit_no;
1236 long int set[2];
1237 long int canonical_set[2];
1238
1239 if (f_v) {
1240 cout << "delandtsheer_doyen::find_pair_orbit_by_tracing" << endl;
1241 }
1242 if (i == j) {
1243 cout << "delandtsheer_doyen::find_pair_orbit_by_tracing "
1244 "i = j = " << j << endl;
1245 exit(1);
1246 }
1247 set[0] = i;
1248 set[1] = j;
1249 orbit_no = Pairs->trace_set(set, 2, 2,
1250 canonical_set, transporter,
1251 verbose_level - 1);
1252 if (f_v) {
1253 cout << "delandtsheer_doyen::find_pair_orbit_by_tracing "
1254 "done" << endl;
1255 }
1256 return orbit_no;
1257}
1258
1260{
1261 int f_v = (verbose_level >= 1);
1262 int i, j, k;
1263
1264
1265 if (f_v) {
1266 cout << "delandtsheer_doyen::compute_pair_orbit_table" << endl;
1267 }
1268 pair_orbit = NEW_int(V * V);
1270 for (i = 0; i < V; i++) {
1271 for (j = i + 1; j < V; j++) {
1272 k = find_pair_orbit_by_tracing(i, j, 0 /*verbose_level - 2*/);
1273 pair_orbit[i * V + j] = k;
1274 pair_orbit[j * V + i] = k;
1275 }
1276 if ((i % 100) == 0) {
1277 cout << "i=" << i << endl;
1278 }
1279 }
1280 if (f_v) {
1281 cout << "delandtsheer_doyen::compute_pair_orbit_table done" << endl;
1282 }
1283}
1284
1286{
1287 int f_v = (verbose_level >= 1);
1288 string fname;
1289 long int set[1000];
1290 int i, j, k, n, size, l;
1291
1292
1293 if (f_v) {
1294 cout << "delandtsheer_doyen::write_pair_orbit_file" << endl;
1295 }
1296
1297 fname.assign(Descr->group_label);
1298 fname.append(".2orbits");
1299
1300 cout << "writing pair-orbit file " << fname << endl;
1301 {
1302 ofstream f(fname);
1303 f << nb_orbits << endl;
1304 for (i = 0; i < nb_orbits; i++) {
1305 n = Pairs->first_node_at_level(2) + i;
1306 Pairs->get_set(n, set, size);
1307 if (size != 2) {
1308 cout << "delandtsheer_doyen::write_pair_orbit_file "
1309 "size != 2" << endl;
1310 exit(1);
1311 }
1312 l = Pairs->orbit_length_as_int(i, 2);
1313 f << set[0] << " " << set[1] << " " << l << endl;
1314 }
1315 for (i = 0; i < V; i++) {
1316 for (j = i + 1; j < V; j++) {
1317 k = find_pair_orbit(i, j, 0 /*verbose_level - 2*/);
1318 f << k << " ";
1319 }
1320 f << endl;
1321 if ((i % 100) == 0) {
1322 cout << "i=" << i << endl;
1323 }
1324 }
1325 }
1327
1328 cout << "written file " << fname << " of size "
1329 << Fio.file_size(fname) << endl;
1330 if (f_v) {
1331 cout << "delandtsheer_doyen::write_pair_orbit_file done" << endl;
1332 }
1333
1334}
1335
1337{
1338 int who, what;
1339
1340 ost << "mask test at level " << Descr->mask_test_level[i] << " : ";
1341 who = Descr->mask_test_who[i];
1342 what = Descr->mask_test_what[i];
1343 if (who == 1) {
1344 ost << "x ";
1345 }
1346 else if (who == 2) {
1347 ost << "y ";
1348 }
1349 else if (who == 3) {
1350 ost << "x+y ";
1351 }
1352 else if (who == 4) {
1353 ost << "s ";
1354 }
1355 if (what == 1) {
1356 ost << "= ";
1357 }
1358 else if (what == 2) {
1359 ost << ">= ";
1360 }
1361 else if (what == 3) {
1362 ost << "<= ";
1363 }
1364 ost << Descr->mask_test_value[i];
1365 ost << endl;
1366}
1367
1368void delandtsheer_doyen::early_test_func(long int *S, int len,
1369 long int *candidates, int nb_candidates,
1370 long int *good_candidates, int &nb_good_candidates,
1371 int verbose_level)
1372{
1373 int f_v = (verbose_level >= 1);
1374 int f_vv = (verbose_level >= 2);
1375 int j;
1376 int f_OK;
1377
1378 if (f_v) {
1379 cout << "delandtsheer_doyen::early_test_func checking set ";
1380 Lint_vec_print(cout, S, len);
1381 cout << endl;
1382 cout << "candidate set of size "
1383 << nb_candidates << ":" << endl;
1384 Lint_vec_print(cout, candidates, nb_candidates);
1385 cout << endl;
1386 }
1387
1388
1389 if (len == 0) {
1390 Lint_vec_copy(candidates, good_candidates, nb_candidates);
1391 nb_good_candidates = nb_candidates;
1392 }
1393 else {
1394 nb_good_candidates = 0;
1395
1396 if (f_vv) {
1397 cout << "delandtsheer_doyen::early_test_func before testing" << endl;
1398 }
1399 for (j = 0; j < nb_candidates; j++) {
1400
1401 S[len] = candidates[j];
1402
1403 f_OK = check_conditions(S, len + 1, verbose_level);
1404 if (f_vv) {
1405 cout << "delandtsheer_doyen::early_test_func "
1406 "testing " << j << " / "
1407 << nb_candidates << endl;
1408 }
1409
1410 if (f_OK) {
1411 good_candidates[nb_good_candidates++] = candidates[j];
1412 }
1413 } // next j
1414 } // else
1415}
1416
1417int delandtsheer_doyen::check_conditions(long int *S, int len, int verbose_level)
1418{
1419 //verbose_level = 4;
1420 int f_v = (verbose_level >= 1);
1421 int f_vv = (verbose_level >= 2);
1422 int f_OK = TRUE;
1423 int f_bad_orbit = FALSE;
1424 int f_bad_row = FALSE;
1425 int f_bad_col = FALSE;
1426 int f_bad_mask = FALSE;
1427 int pt, idx;
1429
1430 if (f_v) {
1431 cout << "delandtsheer_doyen::check_conditions "
1432 "checking set ";
1433 Lint_vec_print(cout, S, len);
1434 cout << endl;
1435 //cout << "offset=" << offset << endl;
1436 }
1437
1438 pt = S[len - 1];
1439 if (Sorting.lint_vec_search_linear(S, len - 1, pt, idx)) {
1440 if (f_v) {
1441 cout << "delandtsheer_doyen::check_conditions "
1442 "not OK, "
1443 "repeat entry" << endl;
1444 }
1445 return FALSE;
1446 }
1447 if (Descr->f_subgroup) {
1448 if (!check_orbit_covering(S, len, verbose_level)) {
1449 f_bad_orbit = TRUE;
1450 f_OK = FALSE;
1451 }
1452 }
1453
1454 if (f_OK && !check_row_sums(S, len, verbose_level)) {
1455 f_bad_row = TRUE;
1456 f_OK = FALSE;
1457 }
1458 if (f_OK && !check_col_sums(S, len, verbose_level)) {
1459 f_bad_col = TRUE;
1460 f_OK = FALSE;
1461 }
1462 if (f_OK && !check_mask(S, len, verbose_level)) {
1463 f_bad_mask = TRUE;
1464 f_OK = FALSE;
1465 }
1466 if (f_OK) {
1467 if (f_v) {
1468 cout << "OK" << endl;
1469 }
1470 return TRUE;
1471 }
1472 else {
1473 if (f_v) {
1474 cout << "not OK" << endl;
1475 }
1476 if (f_vv) {
1477 cout << "because of ";
1478 if (f_bad_orbit)
1479 cout << "orbit covering";
1480 else if (f_bad_row)
1481 cout << "row-test";
1482 else if (f_bad_col)
1483 cout << "col-test";
1484 else if (f_bad_mask)
1485 cout << "mask";
1486 cout << endl;
1487 }
1488 return FALSE;
1489 }
1490}
1491
1493 int len, int verbose_level)
1494{
1495 int f_v = (verbose_level >= 1);
1496 //int f_vv = (verbose_level >= 2);
1497 int i, pi, j, pj, o, f_OK = TRUE;
1498
1500
1501 for (i = 0; i < len; i++) {
1502 pi = line[i];
1503 for (j = i + 1; j < len; j++) {
1504 pj = line[j];
1505 o = find_pair_orbit(pi, pj, 0 /*verbose_level - 1*/);
1506 //o = orbits_on_pairs[pi * V + pj];
1507 if (pi == pj) {
1508 cout << "delandtsheer_doyen::check_orbit_covering "
1509 "pi = " << pi << " == pj = " << pj << endl;
1510 exit(1);
1511 }
1512 orbit_covered[o]++;
1513 if (orbit_covered[o] > orbit_covered_max[o]) {
1514 f_OK = FALSE;
1515 break;
1516 }
1517 }
1518 if (!f_OK) {
1519 break;
1520 }
1521 }
1522 if (f_v) {
1523 if (!f_OK) {
1524 cout << "orbit condition violated" << endl;
1525#if 0
1526 if (f_vv) {
1527 print_orbit_covered(cout);
1528 print_orbit_covered_max(cout);
1529 get_orbit_covering_matrix(line, len, verbose_level - 1);
1530 print_orbit_covering_matrix(len);
1531 }
1532#endif
1533 }
1534 }
1535 return f_OK;
1536}
1537
1539 int len, int verbose_level)
1540{
1541 int f_v = (verbose_level >= 1);
1542 int f_vv = (verbose_level >= 2);
1543 int i, p, x, s, f_OK = TRUE;
1544 int f_DD_problem = FALSE;
1545
1548 if (Descr->f_R) {
1549 for (i = 1; i <= Descr->nb_row_types; i++) {
1550 row_type_cur[i] = 0;
1551 }
1552 }
1553 for (i = 0; i < len; i++) {
1554 p = line[i];
1555 x = p / Ysize;
1556 //y = p % Ysize;
1558 row_sum[x]++;
1559 if (Descr->DELANDTSHEER_DOYEN_X != -1) {
1561 f_OK = FALSE;
1562 f_DD_problem = TRUE;
1563 break;
1564 }
1565 }
1566 if (Descr->f_R) {
1567 s = row_sum[x];
1568 if (s > Descr->nb_row_types) {
1569 f_OK = FALSE;
1570 break;
1571 }
1573 f_OK = FALSE;
1574 break;
1575 }
1576 if (s > 1) {
1577 row_type_cur[s - 1]--;
1578 }
1579 row_type_cur[s]++;
1580 }
1581 }
1582 if (f_v) {
1583 if (!f_OK) {
1584 cout << "delandtsheer_doyen::check_row_sums "
1585 "row condition violated" << endl;
1586 if (f_vv) {
1587 if (f_DD_problem) {
1588 cout << "delandtsheer_doyen::check_row_sums "
1589 "inner_pairs_in_rows = "
1591 << " > DELANDTSHEER_DOYEN_X = "
1593 << ", not OK" << endl;
1594 }
1595 else {
1596 cout << "delandtsheer_doyen::check_row_sums"
1597 "problem with row-type:" << endl;
1598 for (i = 1; i <= Descr->nb_row_types; i++) {
1599 cout << row_type_cur[i] << " ";
1600 }
1601 cout << endl;
1602 for (i = 1; i <= Descr->nb_row_types; i++) {
1603 cout << row_type_this_or_bigger[i] << " ";
1604 }
1605 cout << endl;
1606 }
1607 }
1608 }
1609 }
1610 return f_OK;
1611}
1612
1614 int len, int verbose_level)
1615{
1616 int f_v = (verbose_level >= 1);
1617 int f_vv = (verbose_level >= 2);
1618 int i, p, y, s, f_OK = TRUE;
1619 int f_DD_problem = FALSE;
1620
1623 if (Descr->f_C) {
1624 for (i = 1; i <= Descr->nb_col_types; i++) {
1625 col_type_cur[i] = 0;
1626 }
1627 }
1628 for (i = 0; i < len; i++) {
1629 p = line[i];
1630 //x = p / Ysize;
1631 y = p % Ysize;
1633 col_sum[y]++;
1634 if (Descr->DELANDTSHEER_DOYEN_Y != -1) {
1636 f_OK = FALSE;
1637 f_DD_problem = TRUE;
1638 break;
1639 }
1640 }
1641 if (Descr->f_C) {
1642 s = col_sum[y];
1643 if (s > Descr->nb_col_types) {
1644 f_OK = FALSE;
1645 break;
1646 }
1648 f_OK = FALSE;
1649 break;
1650 }
1651 if (s > 1) {
1652 col_type_cur[s - 1]--;
1653 }
1654 col_type_cur[s]++;
1655 }
1656 }
1657 if (f_v) {
1658 if (!f_OK) {
1659 cout << "delandtsheer_doyen::check_col_sums "
1660 "col condition violated" << endl;
1661 if (f_vv) {
1662 if (f_DD_problem) {
1663 cout << "delandtsheer_doyen::check_col_sums "
1664 "inner_pairs_in_cols = "
1666 << " > DELANDTSHEER_DOYEN_Y = "
1668 << ", not OK" << endl;
1669 }
1670 else {
1671 cout << "delandtsheer_doyen::check_col_sums "
1672 "problem with col-type:" << endl;
1673 for (i = 1; i <= Descr->nb_col_types; i++) {
1674 cout << col_type_cur[i] << " ";
1675 }
1676 cout << endl;
1677 for (i = 1; i <= Descr->nb_col_types; i++) {
1678 cout << col_type_this_or_bigger[i] << " ";
1679 }
1680 cout << endl;
1681 }
1682 }
1683 }
1684 }
1685 return f_OK;
1686}
1687
1689 int len, int verbose_level)
1690{
1691 //verbose_level = 4;
1692 int f_v = (verbose_level >= 1);
1693 int f_vv = (verbose_level >= 2);
1694 int f_OK = TRUE;
1695 int k, who;
1696 int nb_rows_used, nb_cols_used;
1697 int nb_singletons;
1698
1699
1700 if (f_vv) {
1701 cout << "delandtsheer_doyen::check_mask" << endl;
1702 }
1704 nb_rows_used, nb_cols_used,
1705 nb_singletons, verbose_level);
1706
1707 for (k = 0; k < Descr->nb_mask_tests; k++) {
1708 if (Descr->mask_test_level[k] != len) {
1709 continue;
1710 }
1711 if (Descr->mask_test_who[k] == 1) {
1712 who = inner_pairs_in_rows;
1713 }
1714 else if (Descr->mask_test_who[k] == 2) {
1715 who = inner_pairs_in_cols;
1716 }
1717 else if (Descr->mask_test_who[k] == 3) {
1719 }
1720 else if (Descr->mask_test_who[k] == 4) {
1721 who = nb_singletons;
1722 }
1723 else {
1724 cout << "delandtsheer_doyen::check_mask: "
1725 "unknown mask_test_who value "
1726 << Descr->mask_test_who[k] << " in test " << k << endl;
1727 exit(1);
1728 }
1729 if (Descr->mask_test_what[k] == 1) {
1730 // eq
1731 if (who != Descr->mask_test_value[k]) {
1732 f_OK = FALSE;
1733 break;
1734 }
1735 }
1736 else if (Descr->mask_test_what[k] == 2) {
1737 // ge
1738 if (who < Descr->mask_test_value[k]) {
1739 f_OK = FALSE;
1740 break;
1741 }
1742 }
1743 else if (Descr->mask_test_what[k] == 3) {
1744 // le
1745 if (who > Descr->mask_test_value[k]) {
1746 f_OK = FALSE;
1747 break;
1748 }
1749 }
1750 else {
1751 cout << "delandtsheer_doyen::check_mask: "
1752 "unknown mask_test_what value "
1753 << Descr->mask_test_what[k] << " in test " << k << endl;
1754 exit(1);
1755 }
1756 }
1757 if (f_v) {
1758 if (f_OK) {
1759 cout << "mask" << endl;
1760 //print_mask(cout, Xsize, Ysize, M);
1761 cout << "is OK" << endl;
1762 }
1763 else {
1764 if (f_vv) {
1765 cout << "mask test " << k << " failed:" << endl;
1766 print_mask_test_i(cout, k);
1767 //cout << "x=" << inner_pairs_in_rows
1768 //<< "y=" << inner_pairs_in_cols
1769 //<< "s=" << nb_singletons << endl;
1770 }
1771 }
1772 }
1773
1774 return f_OK;
1775}
1776
1777
1779 long int *line, int len,
1780 int &nb_rows_used, int &nb_cols_used,
1781 int &nb_singletons, int verbose_level)
1782{
1783 int i, j, h, a;
1784 int m = Xsize;
1785 int n = Ysize;
1786
1789 for (h = 0; h < len; h++) {
1790 a = line[h];
1791 i = a / Ysize;
1792 j = a % Ysize;
1793 f_row_used[i]++;
1794 row_col_idx[i] = j;
1795 f_col_used[j]++;
1796 col_row_idx[j] = i;
1797 }
1798 nb_singletons = 0;
1799 nb_rows_used = 0;
1800 for (i = 0; i < m; i++) {
1801 if (f_row_used[i] > 1) {
1802 row_idx[nb_rows_used] = i;
1803 nb_rows_used++;
1804 }
1805 else if (f_row_used[i] == 1) {
1806 j = row_col_idx[i];
1807 if (f_col_used[j] == 1) {
1808 singletons[nb_singletons++] = i * n + j;
1809 }
1810 else {
1811 row_idx[nb_rows_used] = i;
1812 nb_rows_used++;
1813 }
1814 }
1815 }
1816 nb_cols_used = 0;
1817 for (j = 0; j < n; j++) {
1818 if (f_col_used[j] > 1) {
1819 col_idx[nb_cols_used] = j;
1820 nb_cols_used++;
1821 }
1822 else if (f_col_used[j] == 1) {
1823 i = col_row_idx[j];
1824 if (f_row_used[i] > 1) {
1825 col_idx[nb_cols_used] = j;
1826 nb_cols_used++;
1827 }
1828 }
1829 }
1830}
1831
1832// #############################################################################
1833// global functions:
1834// #############################################################################
1835
1836
1837static void delandtsheer_doyen_early_test_func_callback(long int *S, int len,
1838 long int *candidates, int nb_candidates,
1839 long int *good_candidates, int &nb_good_candidates,
1840 void *data, int verbose_level)
1841{
1843 int f_v = (verbose_level >= 1);
1844
1845 if (f_v) {
1846 cout << "delandtsheer_doyen_early_test_func_callback for set ";
1847 Lint_vec_print(cout, S, len);
1848 cout << endl;
1849 }
1850 DD->early_test_func(S, len,
1851 candidates, nb_candidates,
1852 good_candidates, nb_good_candidates,
1853 verbose_level - 2);
1854 if (f_v) {
1855 cout << "delandtsheer_doyen_early_test_func_callback done" << endl;
1856 }
1857}
1858
1859
1860
1861
1862
1863
1864}}}
1865
1866
void apply_lint(int *from, long int *through, long int *to, int len)
Definition: int_vec.cpp:57
a collection of functions related to sorted vectors
int lint_vec_search_linear(long int *v, int len, long int a, int &idx)
Definition: sorting.cpp:699
void finite_field_init(int q, int f_without_tables, int verbose_level)
void int_matrix_write_csv(std::string &fname, int *M, int m, int n)
Definition: file_io.cpp:1300
global functions related to group actions
Definition: actions.h:1015
action * init_direct_product_group_and_restrict(groups::matrix_group *M1, groups::matrix_group *M2, int verbose_level)
a permutation group in a fixed action.
Definition: actions.h:99
void element_print_as_permutation_with_offset(void *elt, std::ostream &ost, int offset, int f_do_it_anyway_even_for_big_degree, int f_print_cycles_of_length_one, int verbose_level)
Definition: action_cb.cpp:463
action * restricted_action(long int *points, int nb_points, int verbose_level)
void element_print_quick(void *elt, std::ostream &ost)
Definition: action_cb.cpp:353
groups::strong_generators * Strong_gens
Definition: actions.h:130
void init_projective_group(int n, field_theory::finite_field *F, int f_semilinear, int f_basis, int f_init_sims, data_structures_groups::vector_ge *&nice_gens, int verbose_level)
void element_print_as_permutation(void *elt, std::ostream &ost)
Definition: action_cb.cpp:421
long int element_image_of(long int a, void *elt, int verbose_level)
Definition: action_cb.cpp:198
void lift_generators(strong_generators *SG1, strong_generators *SG2, actions::action *A, strong_generators *&SG3, int verbose_level)
a matrix group over a finite field in projective, vector space or affine action
Definition: groups.h:318
void init_affine_group(int n, field_theory::finite_field *F, int f_semilinear, actions::action *A, int verbose_level)
a strong generating set for a permutation group with respect to a fixed action
Definition: groups.h:1703
void generators_for_the_monomial_group(actions::action *A, matrix_group *Mtx, int verbose_level)
void init_from_data_with_target_go_ascii(actions::action *A, int *data, int nb_elements, int elt_size, const char *ascii_target_go, data_structures_groups::vector_ge *&nice_gens, int verbose_level)
data_structures_groups::vector_ge * gens
Definition: groups.h:1708
void group_order(ring_theory::longinteger_object &go)
void initialize_and_allocate_root_node(poset_classification_control *PC_control, poset_with_group_action *Poset, int depth, int verbose_level)
int trace_set(long int *set, int size, int level, long int *canonical_set, int *Elt_transporter, int verbose_level)
int main(int t0, int schreier_depth, int f_use_invariant_subset_if_available, int f_debug, int verbose_level)
void draw_poset(std::string &fname_base, int depth, int data, graphics::layered_graph_draw_options *LG_Draw_options, int verbose_level)
void init_subset_lattice(actions::action *A, actions::action *A2, groups::strong_generators *Strong_gens, int verbose_level)
void add_testing_without_group(void(*func)(long int *S, int len, long int *candidates, int nb_candidates, long int *good_candidates, int &nb_good_candidates, void *data, int verbose_level), void *data, int verbose_level)
poset_classification::poset_classification_control * Pair_search_control
poset_classification::poset_classification_control * Search_control
search for line transitive point imprimitive linear spaces as described by Delandtsheer and Doyen
poset_classification::poset_with_group_action * Poset_search
void init(delandtsheer_doyen_description *Descr, int verbose_level)
int check_col_sums(long int *line, int len, int verbose_level)
int check_row_sums(long int *line, int len, int verbose_level)
void create_graph(long int *line0, int len, int verbose_level)
void early_test_func(long int *S, int len, long int *candidates, int nb_candidates, long int *good_candidates, int &nb_good_candidates, int verbose_level)
void compute_orbits_on_pairs(groups::strong_generators *Strong_gens, int verbose_level)
groups::strong_generators * scan_subgroup_generators(int verbose_level)
void get_mask_core_and_singletons(long int *line, int len, int &nb_rows_used, int &nb_cols_used, int &nb_singletons, int verbose_level)
int check_orbit_covering(long int *line, int len, int verbose_level)
poset_classification::poset_with_group_action * Poset_pairs
#define Lint_vec_copy(A, B, C)
Definition: foundations.h:694
#define Int_vec_scan(A, B, C)
Definition: foundations.h:716
#define FREE_int(p)
Definition: foundations.h:640
#define Int_vec_zero(A, B)
Definition: foundations.h:713
#define NEW_OBJECT(type)
Definition: foundations.h:638
#define Lint_vec_print(A, B, C)
Definition: foundations.h:686
#define FREE_OBJECT(p)
Definition: foundations.h:651
#define NEW_int(n)
Definition: foundations.h:625
#define TRUE
Definition: foundations.h:231
#define FALSE
Definition: foundations.h:234
#define FREE_lint(p)
Definition: foundations.h:642
#define NEW_lint(n)
Definition: foundations.h:628
#define Int_vec_print(A, B, C)
Definition: foundations.h:685
orbiter_kernel_system::orbiter_session * Orbiter
global Orbiter session
the orbiter library for the classification of combinatorial objects