Orbiter 2022
Combinatorial Objects
packing_long_orbits.cpp
Go to the documentation of this file.
1/*
2 * packing_long_orbits.cpp
3 *
4 * Created on: Aug 13, 2019
5 * Author: betten
6 */
7
8
9
10
11#include "orbiter.h"
12
13using namespace std;
14
15namespace orbiter {
16namespace layer5_applications {
17namespace packings {
18
19
20// globals:
21static int packing_long_orbit_test_function(long int *orbit1, int len1,
22 long int *orbit2, int len2, void *data);
23
24
25
27{
28 PWF = NULL;
29 Descr = NULL;
30
31 fixpoints_idx = 0;
35 fixpoint_clique = NULL;
36
37
38 Orbit_lengths = NULL;
40 Type_idx = NULL;
41
43 set = NULL;
44
46 fixpoint_clique = NULL;
47 Filtered_orbits = NULL;
48 //fname_graph
49 //fname_solutions
50
51}
52
54{
55 if (fixpoint_clique) {
57 }
58 if (set) {
60 }
61 if (Filtered_orbits) {
63 }
64#if 0
65 if (CG) {
66 FREE_OBJECT(CG);
67 }
68#endif
69}
70
73 int verbose_level)
74{
75 int f_v = (verbose_level >= 1);
76
77 if (f_v) {
78 cout << "packing_long_orbits::init" << endl;
79 }
82
83#if 0
84 if (!Descr->f_orbit_length) {
85 cout << "packing_long_orbits::init please specify orbit length" << endl;
86 exit(1);
87 }
88#endif
89
90 if (Descr->f_mixed_orbits) {
92 if (f_v) {
93 cout << "packing_long_orbits::init Orbit_lengths=";
95 cout << endl;
96 }
97 }
98 else if (Descr->f_orbit_length) {
99
101 if (f_v) {
102 cout << "packing_long_orbits::init long_orbit_idx = " << long_orbit_idx << endl;
103 }
104 }
105 else {
106 cout << "please use either -mixed_orbits or -orbit_length" << endl;
107 exit(1);
108 }
109
110
112 if (f_v) {
113 cout << "packing_long_orbits::init fixpoint_clique_size = " << fixpoint_clique_size << endl;
114 }
115
116
118
119
121
123
125 if (f_v) {
126 cout << "packing_long_orbits::init f_list_of_cases_from_file" << endl;
127 }
128 list_of_cases_from_file(verbose_level);
129 }
130 else {
131 if (f_v) {
132 cout << "packing_long_orbits::init do_single_case" << endl;
133 }
134
135 cout << "packing_long_orbits::init do_single_case not yet implemented" << endl;
136 exit(1);
137 //do_single_case(verbose_level);
138 }
139 }
140 else {
141 if (f_v) {
142 cout << "fixpoint_clique_size is zero" << endl;
143 }
144
147
148 if (f_v) {
149 cout << "packing_long_orbits::init Filtered_orbits=" << endl;
150
153
154 cout << "H_gens in action on reduced spreads:" << endl;
156
157 //cout << "N_gens in action on reduced spreads:" << endl;
158 //PWF->PW->N_gens->print_with_given_action(cout, PWF->PW->A_on_reduced_spreads);
159
160
161 }
162
163
165
166 std::vector<std::vector<int> > Packings_classified;
167 std::vector<std::vector<int> > Packings;
168
169 std::vector<std::vector<std::vector<int> > > Packings_by_case;
170
171 if (f_v) {
172 cout << "packing_long_orbits::init before create_graph_on_remaining_long_orbits" << endl;
173 }
175 Packings_classified,
176 Packings,
177 verbose_level);
178
179 if (f_v) {
180 cout << "packing_long_orbits::init after create_graph_on_remaining_long_orbits" << endl;
181 cout << "Packings_classified.size()=" << Packings_classified.size() << endl;
182 cout << "Packings.size()=" << Packings.size() << endl;
183 }
184
185 Packings_by_case.push_back(Packings);
186
187 std::string fname_packings;
188
189 fname_packings.assign(PWF->PW->Descr->H_label);
190 fname_packings.append("_packings.csv");
191
192
193
194 if (f_v) {
195 cout << "packing_long_orbits::init before save_packings_by_case" << endl;
196 }
197 save_packings_by_case(fname_packings, Packings_by_case, verbose_level);
198 if (f_v) {
199 cout << "packing_long_orbits::init after save_packings_by_case" << endl;
200 }
201
202 }
203
204
205
206 if (f_v) {
207 cout << "packing_long_orbits::init done" << endl;
208 }
209}
210
212{
213 int f_v = (verbose_level >= 1);
214
215 if (f_v) {
216 cout << "packing_long_orbits::list_of_cases_from_file" << endl;
217 }
218
220
221 if (f_v) {
222 cout << "packing_long_orbits::list_of_cases_from_file" << endl;
223 cout << "packing_long_orbits::list_of_cases_from_file fixpoints_idx = " << fixpoints_idx << endl;
224 }
225
226 int *List_of_cases;
227 int m, n, idx;
228
230 List_of_cases, m, n, verbose_level);
231
232#if 0
233 if (n != 1) {
234 cout << "packing_long_orbits::list_of_cases_from_file n != 1" << endl;
235 exit(1);
236 }
237#endif
238
239 if (f_v) {
240 cout << "packing_long_orbits::list_of_cases_from_file m = " << m << endl;
241 }
242
243
244 int *Nb;
245 int total = 0;
246
247 Nb = NEW_int(m);
248 Int_vec_zero(Nb, m);
249
250 std::vector<std::vector<std::vector<int> > > Packings_by_case;
251
252#if 0
253 if (f_v) {
254 cout << "packing_long_orbits::list_of_cases_from_file before loop" << endl;
255 cout << "idx : List_of_cases[idx]" << endl;
256 for (idx = 0; idx < m; idx++) {
257 cout << idx << " : " << List_of_cases[idx] << endl;
258 }
259 }
260#endif
261
262
263 for (idx = 0; idx < m; idx++) {
264 fixpoints_clique_case_number = idx; //List_of_cases[idx];
265 if ((Descr->f_split && ((idx % Descr->split_m) == Descr->split_r)) || !Descr->f_split) {
266 cout << "packing_long_orbits::list_of_cases_from_file "
267 << idx << " / " << m << " is case " << fixpoints_clique_case_number << ":" << endl;
268
269 std::vector<std::vector<int> > Packings;
270 std::vector<std::vector<int> > Packings_classified;
271
272
274
276
278
279
280 if (f_v) {
281 cout << "packing_long_orbits::list_of_cases_from_file before process_single_case, "
282 "idx = " << idx << " / " << m << endl;
283 }
284
286 Packings_classified,
287 Packings,
288 verbose_level);
289
290 if (f_v) {
291 cout << "packing_long_orbits::list_of_cases_from_file after process_single_case, "
292 "idx = " << idx << " / " << m << endl;
293 }
294
295
296
297
298 if (f_v) {
299 cout << "packing_long_orbits::list_of_cases_from_file after process_single_case, "
300 "idx = " << idx << " / " << m << endl;
301 }
302
303 Nb[idx] = Packings.size();
304 Packings_by_case.push_back(Packings);
305 if (f_v) {
306 cout << "packing_long_orbits::list_of_cases_from_file after process_single_case, "
307 "idx = " << idx << " / " << m << ", we found " << Nb[idx] << " solutions" << endl;
308 }
309 }
310 }
311
312 if (f_v) {
313 cout << "packing_long_orbits::list_of_cases_from_file after loop" << endl;
314 }
315
316 for (idx = 0; idx < Packings_by_case.size(); idx++) {
317 total += Packings_by_case[idx].size();
318 }
319 if (f_v) {
320 cout << "total number of packings = " << total << endl;
321 }
322
323 std::string fname_out;
325
326 fname_out.assign(Descr->list_of_cases_from_file_fname);
327 ST.replace_extension_with(fname_out, "_count.csv");
328
329
330 Fio.int_vec_write_csv(Nb, m, fname_out, "nb packings before iso");
331
332 if (f_v) {
333 cout << "written file " << fname_out << " of size " << Fio.file_size(fname_out.c_str()) << endl;
334 }
335
336
337
338 std::string fname_packings;
339
340
341 fname_packings.assign(PWF->PW->Descr->H_label);
342 fname_packings.append("_packings.csv");
343
344
345
346 if (f_v) {
347 cout << "packing_long_orbits::list_of_cases_from_file before save_packings_by_case" << endl;
348 }
349 save_packings_by_case(fname_packings, Packings_by_case, verbose_level);
350 if (f_v) {
351 cout << "packing_long_orbits::list_of_cases_from_file after save_packings_by_case" << endl;
352 }
353
354 FREE_int(Nb);
355 FREE_int(List_of_cases);
356
357
358 if (f_v) {
359 cout << "packing_long_orbits::list_of_cases_from_file done" << endl;
360 }
361}
362
363void packing_long_orbits::save_packings_by_case(std::string &fname_packings,
364 std::vector<std::vector<std::vector<int> > > &Packings_by_case, int verbose_level)
365{
366 int f_v = (verbose_level >= 1);
367
368 int idx;
369 int total = 0;
371
372 if (f_v) {
373 cout << "packing_long_orbits::save_packings_by_case" << endl;
374 }
375 for (idx = 0; idx < Packings_by_case.size(); idx++) {
376 total += Packings_by_case[idx].size();
377 }
378
379 int *The_Packings;
380 int i, j, l, h, a, b;
381
382 The_Packings = NEW_int(total * PWF->PW->P->size_of_packing);
383 h = 0;
384 for (idx = 0; idx < Packings_by_case.size(); idx++) {
385 l = Packings_by_case[idx].size();
386 for (i = 0; i < l; i++) {
387 for (j = 0; j < PWF->PW->P->size_of_packing; j++) {
388 a = Packings_by_case[idx][i][j];
389 b = PWF->PW->good_spreads[a];
390 The_Packings[h * PWF->PW->P->size_of_packing + j] = b;
391 }
392 h++;
393 }
394 }
395 if (h != total) {
396 cout << "packing_long_orbits::list_of_cases_from_file warning: h != total" << endl;
397 //exit(1);
398 }
399
400 Fio.int_matrix_write_csv(fname_packings, The_Packings, h, PWF->PW->P->size_of_packing);
401 cout << "written file " << fname_packings << " of size " << Fio.file_size(fname_packings.c_str()) << endl;
402
403
404 FREE_int(The_Packings);
405
406 if (f_v) {
407 cout << "packing_long_orbits::save_packings_by_case done" << endl;
408 }
409}
410
412 std::vector<std::vector<int> > &Packings_classified,
413 std::vector<std::vector<int> > &Packings,
414 int verbose_level)
415{
416 int f_v = (verbose_level >= 1);
417
418 if (f_v) {
419 cout << "packing_long_orbits::process_single_case "
420 "fixpoints_clique_case_number=" << fixpoints_clique_case_number << endl;
421 }
422
424
426
427
428
429 if (f_v) {
430 cout << "packing_long_orbits::process_single_case before init_fixpoint_clique_from_orbit_numbers" << endl;
431 }
433 if (f_v) {
434 cout << "packing_long_orbits::process_single_case after init_fixpoint_clique_from_orbit_numbers" << endl;
435 }
436
437
438
439
440 if (f_v) {
441 cout << "packing_long_orbits::process_single_case before L->filter_orbits" << endl;
442 }
443 filter_orbits(verbose_level - 2);
444 if (f_v) {
445 cout << "packing_long_orbits::process_single_case after L->filter_orbits" << endl;
446 }
447
448
449
450
451 if (f_v) {
452 cout << "packing_long_orbits::process_single_case "
453 "before L->create_graph_on_remaining_long_orbits" << endl;
454 }
456 Packings_classified,
457 Packings,
458 verbose_level - 2);
459 if (f_v) {
460 cout << "packing_long_orbits::process_single_case "
461 "after L->create_graph_on_remaining_long_orbits" << endl;
462 }
463
464
465
466 if (f_v) {
467 cout << "packing_long_orbits::process_single_case " << fixpoints_clique_case_number << " done" << endl;
468 }
469
470}
471
473{
474 int f_v = (verbose_level >= 1);
475
476 if (f_v) {
477 cout << "packing_long_orbits::init_fixpoint_clique_from_orbit_numbers" << endl;
478 }
479 int i;
480 long int a, c;
481
482 for (i = 0; i < fixpoint_clique_size; i++) {
484 c = PWF->fixpoint_to_reduced_spread(a, verbose_level);
485 fixpoint_clique[i] = c;
486 }
487
488}
489
490
491
493// filters the orbits in P->reduced_spread_orbits_under_H->Orbits_classified
494// according to fixpoint_clique[].
495// fixpoint_clique[] contains indices into P->Spread_tables_reduced
496// output is in Filtered_orbits[], and consists of indices into
497// P->reduced_spread_orbits_under_H
498{
499 int f_v = (verbose_level >= 1);
500 int t, i, b;
501
502 if (f_v) {
503 cout << "packing_long_orbits::filter_orbits" << endl;
504 }
505 if (f_v) {
506 cout << "packing_long_orbits::filter_orbits fixpoint_clique=";
508 cout << endl;
509 }
510
511
513
515
516 if (Filtered_orbits) {
518 Filtered_orbits = NULL;
519 }
520
522
524 Input->underlying_set_size,
525 Input->nb_sets,
526 Input->Set_size, 0 /* verbose_level */);
527
529
530 for (t = 0; t < Input->nb_sets; t++) {
531 if (t == fixpoints_idx) {
532 continue;
533 }
534
535 int orbit_length;
536 int len1;
537
540
541 if (f_v) {
542 cout << "packing_long_orbits::filter_orbits testing orbits of length " << orbit_length
543 << ", there are " << Input->Set_size[t] << " orbits before the test" << endl;
544 }
545 for (i = 0; i < Input->Set_size[t]; i++) {
546 b = Input->element(t, i);
547
549 set, len1, 0 /* verbose_level*/);
550 if (len1 != orbit_length) {
551 cout << "packing_long_orbits::filter_orbits len1 != orbit_length" << endl;
552 exit(1);
553 }
554
555 if (FALSE) {
556 cout << "packing_long_orbits::filter_orbits t=" << t << " i=" << i << " b=" << b << " orbit=";
557 Lint_vec_print(cout, set, len1);
558 cout << endl;
559 }
562 set, orbit_length, verbose_level)) {
563
564 // add b to the list in Reduced_Orbits_by_length:
565
567 if (FALSE) {
568 cout << "accepted as vertex " << Filtered_orbits->Set_size[t] - 1 << endl;
569 }
570 }
571 else {
572 if (FALSE) {
573 cout << "rejected" << endl;
574 }
575 }
576 }
577 if (f_v) {
578 cout << "packing_long_orbits::filter_orbits testing orbits of length " << orbit_length << " done, "
579 "there are " << Input->Set_size[t] << " orbits before the test, "
580 " of which " << Filtered_orbits->Set_size[t] << " survive."
581 << endl;
582 }
583 }
584
585 if (f_v) {
586 cout << "packing_long_orbits::filter_orbits "
587 "we found the following number of live orbits:" << endl;
588 cout << "t : nb" << endl;
589 for (t = 0; t < Input->nb_sets; t++) {
590 cout << t << " : " << Filtered_orbits->Set_size[t]
591 << endl;
592 }
593 }
594 if (f_v) {
595 cout << "packing_long_orbits::filter_orbits "
596 "done" << endl;
597 }
598}
599
601 std::vector<std::vector<int> > &Packings_classified,
602 std::vector<std::vector<int> > &Packings,
603 int verbose_level)
604{
605 int f_v = (verbose_level >= 1);
606 //file_io Fio;
607
608 if (f_v) {
609 cout << "packing_long_orbits::create_graph_on_remaining_long_orbits" << endl;
610 cout << "packing_long_orbits::create_graph_on_remaining_long_orbits "
611 "long_orbit_idx = " << long_orbit_idx << endl;
612 cout << "packing_long_orbits::create_graph_on_remaining_long_orbits "
613 "Descr->orbit_length = " << Descr->orbit_length << endl;
614 }
615
617
618 if (f_v) {
619 cout << "packing_long_orbits::create_graph_on_remaining_long_orbits fname_graph = " << fname_graph << endl;
620 cout << "packing_long_orbits::create_graph_on_remaining_long_orbits fname_solutions = " << fname_solutions << endl;
621 }
622
623 //selected_fixpoints, clique_size,
624
625 if (f_v) {
626 cout << "packing_long_orbits::create_graph_on_remaining_long_orbits "
627 "creating the graph on long orbits with "
629 << " vertices" << endl;
630 }
631
632
633 //int user_data_sz;
634 //long int *user_data;
636
637
638#if 0
639 user_data_sz = fixpoint_clique_size;
640 user_data = NEW_lint(user_data_sz);
641 lint_vec_apply(fixpoint_clique,
643 user_data, fixpoint_clique_size);
644
645
646 b = PW->reduced_spread_orbits_under_H->Orbits_classified->Sets[fixpoints_idx][a];
647 PW->reduced_spread_orbits_under_H->Sch->get_orbit(b /* orbit_idx */, set, len,
648 0 /*verbose_level */);
649#endif
650
651
652
653 if (Descr->f_create_graphs) {
655 if (f_v) {
656 cout << "solution file does not exist" << endl;
657 cout << "packing_long_orbits::create_graph_on_remaining_long_orbits "
658 "before create_graph_and_save_to_file" << endl;
659 }
661 CG,
663 FALSE /* f_has_user_data */, NULL /*user_data*/, 0 /*user_data_sz*/,
664 verbose_level);
665 if (f_v) {
666 cout << "packing_long_orbits::create_graph_on_remaining_long_orbits "
667 "the graph on long orbits has been created with "
668 << CG->nb_points
669 << " vertices" << endl;
670 }
671 FREE_OBJECT(CG);
672 }
673 else {
674 cout << "Descr->f_create_graphs is FALSE, we are not creating the graph" << endl;
675 }
676
677 if (Descr->f_solve) {
678
679
680 cout << "calling solver is disabled for now" << endl;
681 exit(1);
682
683#if 0
684 if (f_v) {
685 cout << "calling solver" << endl;
686 }
687 string cmd;
688 char str[1000];
689
690 if (!Descr->f_clique_size) {
691 cout << "please specify the clique size using -clique_size <int : s>" << endl;
692 exit(1);
693 }
694
695 cmd.assign(Orbiter->orbiter_path);
696 cmd.append("/orbiter.out -v 2 -create_graph -load_from_file ");
697 cmd.append(fname_graph);
698 cmd.append(" -end -graph_theoretic_activity -find_cliques -target_size ");
699 sprintf(str, "%d", Descr->clique_size);
700 cmd.append(str);
701 cmd.append(" -end -end");
702
703
704 if (f_v) {
705 cout << "executing command: " << cmd << endl;
706 }
707 system(cmd.c_str());
708#endif
709
710 }
711
712
713
714 if (Descr->f_read_solutions) {
715 if (Fio.file_size(fname_solutions) < 0) {
716 cout << "packing_long_orbits::create_graph_on_remaining_long_orbits "
717 "solution file " << fname_solutions << " is missing" << endl;
718 exit(1);
719 }
720
721
722 //std::vector<std::vector<int> > Solutions;
723 long int *Solutions;
724 int nb_solutions;
725 int solution_size;
726
728 if (f_v) {
729 cout << "packing_long_orbits::create_graph_on_remaining_long_orbits "
730 "solution_size = " << solution_size << endl;
731 }
732
733
734#if 0
736 Solutions, solution_size,
737 verbose_level);
738#else
739 Fio.lint_matrix_read_csv(fname_solutions, Solutions, nb_solutions, solution_size, verbose_level);
740#endif
741
742 if (f_v) {
743 cout << "packing_long_orbits::create_graph_on_remaining_long_orbits "
744 "solution file contains " << nb_solutions << " solutions" << endl;
745 }
746
747 int i, a, b;
748 int nb_uniform;
749 int sol_idx;
750 int *clique;
751 long int *packing;
752 long int *Packings_table;
753
754 clique = NEW_int(solution_size);
755 packing = NEW_lint(PWF->PW->P->size_of_packing);
756 Packings_table = NEW_lint(nb_solutions * PWF->PW->P->size_of_packing);
757
758 nb_uniform = 0;
759
760
761 for (sol_idx = 0; sol_idx < nb_solutions; sol_idx++) {
762
763 if (f_v) {
764 cout << "packing_long_orbits::create_graph_on_remaining_long_orbits "
765 "reading solution " << sol_idx << " / " << nb_solutions << ":" << endl;
766 }
767
768
769 for (i = 0; i < solution_size; i++) {
770 clique[i] = Solutions[sol_idx * solution_size + i];
771 }
772
773 if (f_v) {
774 cout << "packing_long_orbits::create_graph_on_remaining_long_orbits "
775 "reading solution " << sol_idx << " / " << nb_solutions << ", clique = ";
776 Int_vec_print(cout, clique, solution_size);
777 cout << endl;
778 }
779
780 //int fixpoint_clique_size;
781 //long int *Cliques; // [nb_cliques * fixpoint_clique_size]
782
783 int type_idx;
784
786 //nb_points = Orbits_classified->Set_size[type_idx];
787
788 for (i = 0; i < fixpoint_clique_size; i++) {
789 //packing[i] = fixpoint_clique[i];
791
792 b = PWF->fixpoint_to_reduced_spread(a, 0 /* verbose_level*/);
793
794
795
796 //b = PWF->PW->reduced_spread_orbits_under_H->Orbits_classified->Sets[type_idx][a];
797 packing[i] = b;
798 }
799
800
801#if 0
802 for (i = 0; i < solution_size; i++) {
803 a = clique[i];
805 clique[i] = b;
806 }
807
808
809 if (f_v) {
810 cout << "packing_long_orbits::create_graph_on_remaining_long_orbits "
811 "reading solution " << sol_idx << " / " << nb_solutions << ", clique after unfiltering = ";
812 Orbiter->Int_vec.print(cout, clique, solution_size);
813 cout << endl;
814 }
815#endif
816
819 solution_size,
820 clique,
821 packing + fixpoint_clique_size,
822 //Filtered_orbits,
823 0 /*verbose_level*/);
824
825#if 0
826 for (i = fixpoint_clique_size; i < PWF->PW->P->size_of_packing; i++) {
827 //packing[i] = fixpoint_clique[i];
828 a = packing[i];
829 packing[i] = Filtered_orbits->Sets[long_orbit_idx][a];
830 }
831#endif
832
833
834 if (f_v) {
835 cout << "packing_long_orbits::create_graph_on_remaining_long_orbits "
836 "reading solution " << sol_idx << " / " << nb_solutions << " packing = ";
837 Lint_vec_print(cout, packing, PWF->PW->P->size_of_packing);
838 cout << endl;
839 }
840
842 cout << "packing_long_orbits::create_graph_on_remaining_long_orbits The packing is not line disjoint" << endl;
843 exit(1);
844 }
845
846 Lint_vec_copy(packing, Packings_table + sol_idx * PWF->PW->P->size_of_packing, PWF->PW->P->size_of_packing);
847
848
849#if 0
850
851 vector<int> Packing;
852 for (i = 0; i < PWF->PW->P->size_of_packing; i++) {
853 a = packing[i];
854 Packing.push_back(a);
855 }
856
857 Packings.push_back(Packing);
858#endif
859
860
861 }
862
863 //action *Ar;
864 actions::action *Ar_On_Packings;
865
866 //Ar = PWF->PW->restricted_action(Descr->orbit_length, verbose_level);
867
868 if (f_v) {
869 cout << "packing_long_orbits::create_graph_on_remaining_long_orbits "
870 "before PWF->PW->A_on_reduced_spreads->create_induced_action_on_sets" << endl;
871 cout << "PWF->PW->A_on_reduced_spreads->degree=" << PWF->PW->A_on_reduced_spreads->degree << endl;
872 cout << "Packings_table:" << endl;
873 Lint_matrix_print(Packings_table, nb_solutions, PWF->PW->P->size_of_packing);
874 }
875
876 Ar_On_Packings = PWF->PW->A_on_reduced_spreads->create_induced_action_on_sets(nb_solutions,
877 PWF->PW->P->size_of_packing, Packings_table,
878 verbose_level);
879
880 groups::schreier *Orbits;
881
883
884 if (f_v) {
885 cout << "packing_long_orbits::create_graph_on_remaining_long_orbits "
886 "before Ar_On_Packings->all_point_orbits_from_generators" << endl;
887 }
888 Ar_On_Packings->all_point_orbits_from_generators(*Orbits,
890 verbose_level);
891 if (f_v) {
892 cout << "packing_long_orbits::create_graph_on_remaining_long_orbits "
893 "after Ar_On_Packings->all_point_orbits_from_generators" << endl;
894 }
895
896 int *iso_type;
899
900 int idx, j;
901
902 for (i = 0; i < Orbits->nb_orbits; i++) {
903 idx = Orbits->orbit[Orbits->orbit_first[i]];
904
905 vector<int> Packing;
906 for (j = 0; j < PWF->PW->P->size_of_packing; j++) {
907 a = Packings_table[idx * PWF->PW->P->size_of_packing + j];
908 Packing.push_back(a);
909 }
910
911 for (j = 0; j < PWF->PW->P->size_of_packing; j++) {
912 a = Packing[j];
915 }
916 for (j = 0; j < PWF->PW->Spread_tables_reduced->nb_iso_types_of_spreads; j++) {
918 nb_uniform++;
919 break;
920 }
921 }
922
923 Packings_classified.push_back(Packing);
924 }
925
926 for (i = 0; i < Orbits->nb_orbits; i++) {
927 int h;
928 int len;
929
930 len = Orbits->orbit_len[i];
931 for (h= 0; h < len; h++) {
932 idx = Orbits->orbit[Orbits->orbit_first[i] + h];
933
934 vector<int> Packing;
935 for (j = 0; j < PWF->PW->P->size_of_packing; j++) {
936 a = Packings_table[idx * PWF->PW->P->size_of_packing + j];
937 Packing.push_back(a);
938 }
939
940 for (j = 0; j < PWF->PW->P->size_of_packing; j++) {
941 a = Packing[j];
944 }
945 for (j = 0; j < PWF->PW->Spread_tables_reduced->nb_iso_types_of_spreads; j++) {
947 nb_uniform++;
948 break;
949 }
950 }
951
952 Packings.push_back(Packing);
953 }
954 }
955
956
957
958
960
961 T.init(iso_type, Orbits->nb_orbits, PWF->PW->Spread_tables_reduced->nb_iso_types_of_spreads, verbose_level);
962 if (f_v) {
963 cout << "packing_long_orbits::create_graph_on_remaining_long_orbits We found the following type vectors:" << endl;
964 T.print();
965 }
966
967
968#if 0
969 cout << "fixpoints_clique_case_number " << fixpoints_clique_case_number
971 << " # of solutions = " << Solutions.size()
972 << ", # of orbits is " << Orbits->nb_orbits
973 << ", # uniform = " << nb_uniform << " ";
974#endif
975 cout << fixpoints_clique_case_number << " & ";
976
978 int nb_points;
979
980 nb_points = Fio.number_of_vertices_in_colored_graph(fname_graph, FALSE /* verbose_level */);
981
982 cout << nb_points << " & ";
983 cout << nb_solutions << " & ";
985
986 {
988
989 Cl.init(Orbits->orbit_len, Orbits->nb_orbits, FALSE, 0);
991 cout << " & ";
992 }
993 cout << Orbits->nb_orbits;
994 cout << " \\\\TEX" << endl;
995
996
997
998 FREE_lint(Solutions);
999 FREE_OBJECT(Orbits);
1000 FREE_OBJECT(Ar_On_Packings);
1001 //FREE_OBJECT(Ar);
1002 FREE_int(clique);
1003 FREE_lint(packing);
1004 FREE_lint(Packings_table);
1005 FREE_int(iso_type);
1006 }
1007
1008
1009
1010 //FREE_lint(user_data);
1011
1012
1013 if (f_v) {
1014 cout << "packing_long_orbits::create_graph_on_remaining_long_orbits "
1015 "done" << endl;
1016 }
1017}
1018
1020{
1021 char str[1000];
1022
1023 sprintf(str, "_fpc%d", fixpoints_clique_case_number);
1024
1025 fname_graph.assign(PWF->PW->Descr->H_label);
1026 fname_graph.append(str);
1027 fname_graph.append("_lo.graph");
1028
1029
1030 fname_solutions.assign(PWF->PW->Descr->H_label);
1031 fname_solutions.append(str);
1032 fname_solutions.append("_lo_sol.csv");
1033
1034}
1035
1038 std::string &fname,
1039 int f_has_user_data, long int *user_data, int user_data_size,
1040 int verbose_level)
1041{
1042 int f_v = (verbose_level >= 1);
1043
1044 if (f_v) {
1045 cout << "packing_long_orbits::create_graph_and_save_to_file" << endl;
1046 }
1047
1048
1049 if (Descr->f_orbit_length) {
1050
1051
1052 if (f_v) {
1053 cout << "packing_long_orbits::create_graph_and_save_to_file before create_graph_on_orbits_of_a_certain_length_override_orbits_classified" << endl;
1054 }
1055 int type_idx;
1056
1058 CG,
1059 fname,
1061 type_idx,
1062 f_has_user_data, user_data, user_data_size,
1063 packing_long_orbit_test_function,
1064 this /* void *test_function_data */,
1066 verbose_level);
1067
1068 if (f_v) {
1069 cout << "packing_long_orbits::create_graph_and_save_to_file after create_graph_on_orbits_of_a_certain_length_override_orbits_classified" << endl;
1070 }
1071 }
1072 else if (Descr->f_mixed_orbits) {
1073
1074 if (f_v) {
1075 cout << "packing_long_orbits::create_graph_and_save_to_file before create_weighted_graph_on_orbits" << endl;
1076 }
1077
1078
1080 CG,
1081 fname,
1084 Type_idx,
1085 f_has_user_data, user_data, user_data_size,
1086 packing_long_orbit_test_function,
1087 this /* void *test_function_data */,
1089 verbose_level);
1090
1091
1092 if (f_v) {
1093 int i;
1094 cout << "i : Orbit_lengths[i] : Type_idx[i]" << endl;
1095 for (i = 0; i < nb_orbit_lengths; i++) {
1096 cout << i << " : " << Orbit_lengths[i] << " : " << Type_idx[i] << endl;
1097 }
1098 }
1099
1100 if (f_v) {
1101 cout << "packing_long_orbits::create_graph_and_save_to_file after create_weighted_graph_on_orbits" << endl;
1102 }
1103
1104
1105 }
1106 else {
1107 cout << "neither -orbit_length nor -mixed_orbits has been given" << endl;
1108 exit(1);
1109 }
1110
1111 if (f_v) {
1112 cout << "packing_long_orbits::create_graph_and_save_to_file before CG->save, fname=" << fname << endl;
1113 }
1114 CG->save(fname, verbose_level);
1115 if (f_v) {
1116 cout << "packing_long_orbits::create_graph_and_save_to_file after CG->save, fname=" << fname << endl;
1117 }
1118
1119 //FREE_OBJECT(CG);
1120
1121 if (f_v) {
1122 cout << "packing_long_orbits::create_graph_and_save_to_file done" << endl;
1123 }
1124}
1125
1128 long int *user_data, int user_data_sz,
1129 int verbose_level)
1130{
1131 int f_v = (verbose_level >= 1);
1132
1133 if (f_v) {
1134 cout << "packing_long_orbits::create_graph_on_long_orbits" << endl;
1135 }
1136
1137
1139 CG,
1141 TRUE /* f_has_user_data */, user_data, user_data_sz,
1142 verbose_level);
1143
1144 if (f_v) {
1145 cout << "packing_long_orbits::create_graph_on_long_orbits done" << endl;
1146 }
1147}
1148
1149
1151{
1152 int i;
1153
1154 //Sch->print_orbit_lengths_tex(ost);
1155 ost << "Type : orbit length : number of orbits of this length\\\\" << endl;
1156 for (i = 0; i < Filtered_orbits->nb_sets; i++) {
1157 ost << i << " : " << PWF->PW->reduced_spread_orbits_under_H->Orbits_classified_length[i] << " : "
1158 << Filtered_orbits->Set_size[i] << "\\\\" << endl;
1159 }
1160}
1161
1162// #############################################################################
1163// global functions:
1164// #############################################################################
1165
1166
1167static int packing_long_orbit_test_function(long int *orbit1, int len1,
1168 long int *orbit2, int len2, void *data)
1169{
1171
1173 orbit1, len1, orbit2, len2, 0 /*verbose_level*/);
1174}
1175
1176
1177}}}
1178
void print(std::ostream &ost, std::vector< int > &v)
Definition: int_vec.cpp:413
void init_basic(int underlying_set_size, int nb_sets, long int *Sz, int verbose_level)
functions related to strings and character arrays
void replace_extension_with(char *p, const char *new_ext)
a statistical analysis of data consisting of vectors of ints
void init(int *data, int data_length, int data_set_sz, int verbose_level)
a statistical analysis of data consisting of single integers
void init(int *data, int data_length, int f_second, int verbose_level)
Definition: tally.cpp:72
int test_if_set_of_spreads_is_line_disjoint_and_complain_if_not(long int *set, int len)
void save(std::string &fname, int verbose_level)
void int_matrix_write_csv(std::string &fname, int *M, int m, int n)
Definition: file_io.cpp:1300
void int_vec_write_csv(int *v, int len, std::string &fname, const char *label)
Definition: file_io.cpp:1175
void int_matrix_read_csv(std::string &fname, int *&M, int &m, int &n, int verbose_level)
Definition: file_io.cpp:1477
void lint_matrix_read_csv(std::string &fname, long int *&M, int &m, int &n, int verbose_level)
Definition: file_io.cpp:1558
int number_of_vertices_in_colored_graph(std::string &fname, int verbose_level)
Definition: file_io.cpp:3823
void read_solutions_from_file_size_is_known(std::string &fname, std::vector< std::vector< int > > &Solutions, int solution_size, int verbose_level)
Definition: file_io.cpp:981
a permutation group in a fixed action.
Definition: actions.h:99
action * create_induced_action_on_sets(int nb_sets, int set_size, long int *sets, int verbose_level)
void all_point_orbits_from_generators(groups::schreier &Schreier, groups::strong_generators *SG, int verbose_level)
Definition: action.cpp:1254
void extract_orbits(int orbit_length, int nb_orbits, int *orbits, long int *extracted_set, int verbose_level)
void create_graph_on_orbits_of_a_certain_length_override_orbits_classified(graph_theory::colored_graph *&CG, std::string &fname, int orbit_length, int &type_idx, int f_has_user_data, long int *user_data, int user_data_size, int(*test_function)(long int *orbit1, int orbit_length1, long int *orbit2, int orbit_length2, void *data), void *test_function_data, data_structures::set_of_sets *my_orbits_classified, int verbose_level)
void create_weighted_graph_on_orbits(graph_theory::colored_graph *&CG, std::string &fname, int *Orbit_lengths, int nb_orbit_lengths, int *&Type_idx, int f_has_user_data, long int *user_data, int user_data_size, int(*test_function)(long int *orbit1, int orbit_length1, long int *orbit2, int orbit_length2, void *data), void *test_function_data, data_structures::set_of_sets *my_orbits_classified, int verbose_level)
void print_orbits_based_on_filtered_orbits(std::ostream &ost, data_structures::set_of_sets *Filtered_orbits)
data_structures::set_of_sets * Orbits_classified
Definition: groups.h:506
Schreier trees for orbits of groups on points.
Definition: groups.h:839
void get_orbit(int orbit_idx, long int *set, int &len, int verbose_level)
Definition: schreier.cpp:2598
void print_with_given_action(std::ostream &ost, actions::action *A2)
command line description of picking long orbits of packings with assumed symmetry
Definition: packings.h:245
complete a partial packing from a clique on the fixpoint graph using long orbits, utilizing clique se...
Definition: packings.h:284
void create_graph_and_save_to_file(graph_theory::colored_graph *&CG, std::string &fname, int f_has_user_data, long int *user_data, int user_data_size, int verbose_level)
void process_single_case(std::vector< std::vector< int > > &Packings_classified, std::vector< std::vector< int > > &Packings, int verbose_level)
void save_packings_by_case(std::string &fname_packings, std::vector< std::vector< std::vector< int > > > &Packings_by_case, int verbose_level)
void create_graph_on_remaining_long_orbits(std::vector< std::vector< int > > &Packings_classified, std::vector< std::vector< int > > &Packings, int verbose_level)
void init(packing_was_fixpoints *PWF, packing_long_orbits_description *Descr, int verbose_level)
groups::strong_generators * fixpoint_clique_stabilizer_gens
Definition: packings.h:304
void create_graph_on_long_orbits(graph_theory::colored_graph *&CG, long int *user_data, int user_data_sz, int verbose_level)
picking fixed points in the construction of packings in PG(3,q) with assumed symmetry
Definition: packings.h:494
geometry::spread_tables * Spread_tables_reduced
Definition: packings.h:631
groups::orbits_on_something * reduced_spread_orbits_under_H
Definition: packings.h:645
int test_if_pair_of_sets_of_reduced_spreads_are_adjacent(long int *orbit1, int len1, long int *orbit2, int len2, int verbose_level)
int find_orbits_of_length_in_reduced_spread_table(int orbit_length)
#define Lint_vec_copy(A, B, C)
Definition: foundations.h:694
#define Lint_matrix_print(A, B, C)
Definition: foundations.h:708
#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