Orbiter 2022
Combinatorial Objects
isomorph_files.cpp
Go to the documentation of this file.
1// isomorph_files.cpp
2//
3// Anton Betten
4// started 2007
5//
6// moved here from global.cpp: Nov 1, 2009
7// renamed isomorph_files.cpp from global_solution.cpp
8//
9//
10//
11//
12
14#include "discreta/discreta.h"
17
18using namespace std;
19
20
21namespace orbiter {
22namespace layer4_classification {
23
24#define MY_BUFSIZE 1000000
25
26void isomorph::init_solutions(int **Solutions, int *Nb_sol,
27 int verbose_level)
28// Solutions[nb_starter], Nb_sol[nb_starter]
29{
30 int f_v = (verbose_level >= 1);
31 //int f_vv = (verbose_level >= 2);
32 int i;
34
35 if (f_v) {
36 cout << "isomorph::init_solutions "
37 "nb_starter = " << nb_starter << endl;
38 }
41 N = 0;
42 for (i = 0; i < nb_starter; i++) {
43 solution_first[i] = 0;
44 solution_len[i] = Nb_sol[i];
45 N += solution_len[i];
46 }
47 if (f_v) {
48 cout << "isomorph::init_solutions N = " << N << endl;
49 }
50 solution_first[0] = 0;
51 for (i = 0; i < nb_starter; i++) {
53 }
54 if (solution_first[nb_starter] != N) {
55 cout << "isomorph::init_solutions "
56 "solution_first[nb_starter] != N" << endl;
57 exit(1);
58 }
59
60 init_starter_number(verbose_level);
61 if (f_v) {
62 cout << "isomorph::init_solutions "
63 "after init_starter_number" << endl;
64 }
65
67 if (f_v) {
68 cout << "isomorph::init_solutions "
69 "after write_solution_first_and_len" << endl;
70 }
71
72
73 setup_and_create_solution_database(0/*verbose_level - 1*/);
74
75 int h;
76 int no = 0;
77 int print_mod = 1000;
78
83
84 if (f_v) {
85 cout << "isomorph::init_solutions "
86 "before add_solutions_to_database" << endl;
87 }
88
89 for (h = 0; h < nb_starter; h++) {
90 if (solution_len[h]) {
91 add_solutions_to_database(Solutions[h],
92 h, solution_len[h], N, print_mod, no,
93 verbose_level);
94 }
95 }
96
97 write_hash_and_datref_file(verbose_level);
98 if (f_v) {
99 cout << "isomorph::init_solutions "
100 "written hash and datref file" << endl;
101 cout << "isomorph::init_solutions "
102 "sorting hash_vs_id_hash" << endl;
103 }
104 {
106
107 C.init(hash_vs_id_hash, N, TRUE, 0);
108 cout << "isomorph::init_solutions "
109 "Classification of hash values:" << endl;
110 C.print(FALSE /*f_backwards*/);
111 }
113 if (f_v) {
114 cout << "isomorph::init_solutions "
115 "after sorting hash_vs_id_hash" << endl;
116 }
117
118 close_solution_database(0 /*verbose_level - 1*/);
119
120
121
122 if (f_v) {
123 cout << "isomorph::init_solutions done" << endl;
124 }
125}
126
128 int nb_files, long int *list_of_cases, std::string *fname,
129 int verbose_level)
130// Called from isomorph_read_solution_files_from_clique_finder
131{
132 int f_v = (verbose_level >= 1);
133 int f_vv = (verbose_level >= 2);
134 int i, h;
136
137 if (f_v) {
138 cout << "isomorph::count_solutions_from_clique_finder_case_by_case "
139 "nb_starter = " << nb_starter << " nb_files=" << nb_files << endl;
140 }
143
145 N = 0;
146 for (i = 0; i < nb_files; i++) {
147 int nb_solutions;
148
150 nb_solutions,
151 verbose_level - 2);
152
153 if (f_vv) {
154 cout << "isomorph::count_solutions_from_clique_finder_"
155 "case_by_case file " << i << " / " << nb_files << " = "
156 << fname[i] << " read, nb_solutions="
157 << nb_solutions << endl;
158 }
159
160 h = list_of_cases[i];
161 solution_len[h] = nb_solutions;
162
163 N += nb_solutions;
164 }
165 if (f_v) {
166 cout << "isomorph::count_solutions_from_clique_finder_"
167 "case_by_case done counting solutions, "
168 "total number of solutions = " << N << endl;
169 cout << "h : solution_len[h]" << endl;
170 for (h = 0; h < nb_starter; h++) {
171 cout << h << " : " << solution_len[h] << endl;
172 }
173 }
174 solution_first[0] = 0;
175 for (i = 0; i < nb_starter; i++) {
177 }
178 if (solution_first[nb_starter] != N) {
179 cout << "isomorph::count_solutions_from_clique_finder_"
180 "case_by_case solution_first[nb_starter] != N" << endl;
181 exit(1);
182 }
183
184 init_starter_number(verbose_level);
185 if (f_v) {
186 cout << "isomorph::count_solutions_from_clique_finder_"
187 "case_by_case after init_starter_number" << endl;
188 }
189
191 if (f_v) {
192 cout << "isomorph::count_solutions_from_clique_finder_"
193 "case_by_case after write_solution_first_and_len" << endl;
194 }
195}
196
197
198
200 int nb_files, std::string *fname, int verbose_level)
201// Called from isomorph_read_solution_files_from_clique_finder
202{
203 int f_v = (verbose_level >= 1);
204 int f_vv = (verbose_level >= 2);
205 int i, h, c, n;
207
208 if (f_v) {
209 cout << "isomorph::count_solutions_from_clique_finder "
210 "nb_starter = " << nb_starter << " nb_files="
211 << nb_files << endl;
212 }
215 for (i = 0; i < nb_starter; i++) {
216 solution_first[i] = 0;
217 solution_len[i] = 0;
218 }
219 N = 0;
220 for (i = 0; i < nb_files; i++) {
221 int *nb_solutions;
222 int *case_nb;
223 int nb_cases;
224
226 nb_solutions, case_nb, nb_cases,
227 verbose_level - 2);
228
229 if (f_vv) {
230 cout << "isomorph::count_solutions_from_clique_finder "
231 "file " << i << " / " << nb_files << " = " << fname[i]
232 << " read, nb_cases=" << nb_cases << endl;
233 }
234
235 for (h = 0; h < nb_cases; h++) {
236 c = case_nb[h];
237 n = nb_solutions[h];
238 solution_len[c] = n;
239 N += n;
240 }
241 FREE_int(nb_solutions);
242 FREE_int(case_nb);
243 }
244 if (f_v) {
245 cout << "isomorph::count_solutions_from_clique_finder "
246 "done counting solutions, total number of "
247 "solutions = " << N << endl;
248 cout << "h : solution_len[h]" << endl;
249 for (h = 0; h < nb_starter; h++) {
250 cout << h << " : " << solution_len[h] << endl;
251 }
252 }
253 solution_first[0] = 0;
254 for (i = 0; i < nb_starter; i++) {
256 }
257 if (solution_first[nb_starter] != N) {
258 cout << "isomorph::count_solutions_from_clique_finder "
259 "solution_first[nb_starter] != N" << endl;
260 exit(1);
261 }
262
263 init_starter_number(verbose_level);
264 if (f_v) {
265 cout << "isomorph::count_solutions_from_clique_finder "
266 "after init_starter_number" << endl;
267 }
268
270 if (f_v) {
271 cout << "isomorph::count_solutions_from_clique_finder "
272 "after write_solution_first_and_len" << endl;
273 }
274}
275
276
277
279 int nb_files, long int *list_of_cases, std::string *fname,
280 int verbose_level)
281// Called from isomorph_read_solution_files_from_clique_finder
282// Called after count_solutions_from_clique_finder
283// We assume that N, the number of solutions is known
284{
285 int f_v = (verbose_level >= 1);
286 int f_vv = (verbose_level >= 2);
289
290 int i, no = 0;
291 int print_mod = 1000;
292
293
294 if (f_v) {
295 cout << "isomorph::read_solutions_from_clique_finder_"
296 "case_by_case nb_files=" << nb_files
297 << " N=" << N << endl;
298 }
299
300
301 setup_and_create_solution_database(0/*verbose_level - 1*/);
302
303 if (f_v) {
304 cout << "isomorph::read_solutions_from_clique_finder_"
305 "case_by_case after setup_and_create_solution_"
306 "database" << endl;
307 }
308
313
314 for (i = 0; i < nb_files; i++) {
315
316 if (f_vv) {
317 cout << "isomorph::read_solutions_from_clique_finder_"
318 "case_by_case, file " << i << " / " << nb_files
319 << " which is " << fname[i] << endl;
320 }
321 int nb_solutions;
322 int *Solutions;
323
324 Fio.read_solutions_from_file(fname[i],
325 nb_solutions,
326 Solutions, size /* solution_size */,
327 verbose_level - 2);
328
329 if (f_vv) {
330 cout << "isomorph::read_solutions_from_clique_finder_"
331 "case_by_case file " << fname[i] << " number of "
332 "solutions read: " << nb_solutions << endl;
333 }
334
335 add_solutions_to_database(Solutions,
336 list_of_cases[i], nb_solutions, N, print_mod, no,
337 verbose_level);
338
339
340 FREE_int(Solutions);
341 }
342
343
344 write_hash_and_datref_file(verbose_level);
345 if (f_v) {
346 cout << "isomorph::read_solutions_from_clique_finder_case_by_case "
347 "written hash and datref file" << endl;
348 cout << "isomorph::read_solutions_from_clique_finder_case_by_case "
349 "sorting hash_vs_id_hash" << endl;
350 }
351 {
353
354 C.init(hash_vs_id_hash, N, TRUE, 0);
355 cout << "isomorph::read_solutions_from_clique_finder_case_by_case "
356 "Classification of hash values:" << endl;
357 C.print(FALSE /*f_backwards*/);
358 }
360 if (f_v) {
361 cout << "isomorph::read_solutions_from_clique_finder_case_by_case "
362 "after sorting hash_vs_id_hash" << endl;
363 }
364
365 close_solution_database(0 /*verbose_level - 1*/);
366
367
368 if (f_v) {
369 cout << "isomorph::read_solutions_from_clique_finder_case_by_case "
370 "done" << endl;
371 }
372}
373
374
376 int nb_files, std::string *fname,
377 int verbose_level)
378// Called from isomorph_read_solution_files_from_clique_finder
379// Called after count_solutions_from_clique_finder
380// We assume that N, the number of solutions is known
381{
382 int f_v = (verbose_level >= 1);
383 int f_vv = (verbose_level >= 2);
384 //int f_vvv = (verbose_level >= 3);
385
386 int i, no = 0;
387 //int *data;
388 int print_mod = 1000;
391
392
393 if (f_v) {
394 cout << "isomorph::read_solutions_from_clique_finder "
395 "nb_files=" << nb_files << " N=" << N << endl;
396 }
397
398
399 setup_and_create_solution_database(0/*verbose_level - 1*/);
400
401 //data = NEW_int(size + 1);
402
403 if (f_v) {
404 cout << "isomorph::read_solutions_from_clique_finder "
405 "after setup_and_create_solution_database" << endl;
406 }
407
412
413 for (i = 0; i < nb_files; i++) {
414
415 if (f_vv) {
416 cout << "isomorph::read_solutions_from_clique_finder "
417 "file " << fname[i] << endl;
418 }
419 int *nb_solutions;
420 int *case_nb;
421 int nb_cases;
422 int **Solutions;
423 int the_case, h; //, u, v;
424 int nb_solutions_total;
425 string fname_summary;
426 //char extension[1000];
428
429 fname_summary.assign(fname[i]);
430 ST.chop_off_extension_if_present(fname_summary, ".txt");
431 fname_summary.append("_summary.csv");
432
434 nb_solutions, case_nb, nb_cases,
435 verbose_level - 2);
436
437
438 Fio.int_vecs_write_csv(case_nb, nb_solutions, nb_cases,
439 fname_summary, "Case_nb", "Nb_sol");
440
441 nb_solutions_total = 0;
442 for (h = 0; h < nb_cases; h++) {
443 nb_solutions_total += nb_solutions[h];
444 }
445
447 nb_solutions, case_nb, nb_cases,
448 Solutions, size /* solution_size */,
449 verbose_level - 2);
450
451 if (f_vv) {
452 cout << "isomorph::read_solutions_from_clique_finder "
453 "file " << fname[i] << " read solutions" << endl;
454 }
455
456 for (h = 0; h < nb_cases; h++) {
457 the_case = case_nb[h];
458
459 add_solutions_to_database(Solutions[h],
460 the_case, nb_solutions[h], nb_solutions_total,
461 print_mod, no,
462 verbose_level);
463
464 }
465
466 FREE_int(nb_solutions);
467 FREE_int(case_nb);
468 for (h = 0; h < nb_cases; h++) {
469 FREE_int(Solutions[h]);
470 }
471 FREE_pint(Solutions);
472 if (f_vv) {
473 cout << "isomorph::read_solutions_from_clique_finder "
474 "file " << fname[i] << " done" << endl;
475 }
476 }
477
478
479 write_hash_and_datref_file(verbose_level);
480 if (f_v) {
481 cout << "isomorph::read_solutions_from_clique_finder "
482 "written hash and datref file" << endl;
483 cout << "isomorph::read_solutions_from_clique_finder "
484 "sorting hash_vs_id_hash" << endl;
485 }
486 {
488
489 C.init(hash_vs_id_hash, N, TRUE, 0);
490 cout << "isomorph::read_solutions_from_clique_finder "
491 "Classification of hash values:" << endl;
492 C.print(FALSE /*f_backwards*/);
493 }
495 if (f_v) {
496 cout << "isomorph::read_solutions_from_clique_finder "
497 "after sorting hash_vs_id_hash" << endl;
498 }
499
500 close_solution_database(0 /*verbose_level - 1*/);
501
502 //FREE_int(data);
503
504 if (f_v) {
505 cout << "isomorph::read_solutions_from_clique_finder done" << endl;
506 }
507}
508
510 int the_case, int nb_solutions, int nb_solutions_total,
511 int print_mod, int &no,
512 int verbose_level)
513{
514 int f_v = (verbose_level >= 1);
515 //int f_vv = (verbose_level >= 2);
516 int f_vvv = (verbose_level >= 3);
517 int u, v;
518 long int *data;
520
521 if (f_v) {
522 cout << "isomorph::add_solutions_to_database "
523 "case " << the_case << endl;
524 }
525 data = NEW_lint(size + 1);
526 for (u = 0; u < nb_solutions; u++) {
527
528 uint_4 datref;
529 int hs, id;
530
531 data[0] = the_case;
532 for (v = 0; v < size; v++) {
533 data[1 + v] = Solutions[u * size + v];
534 }
535 id = solution_first[data[0]] + u;
536
537 hs = Data.lint_vec_hash_after_sorting(data + 1, size);
538 if (f_vvv) {
539 cout << "isomorph::add_solutions_to_database "
540 "case " << the_case << " u=" << u << " id=" << id
541 << " hs=" << hs << " no=" << no << endl;
542 }
543
544
546 u, id, no, nb_solutions_total, hs, datref,
547 print_mod, verbose_level - 2);
548 // in isomorph_database.cpp
549
550 id_to_datref[id] = datref;
551 id_to_hash[id] = hs;
552 hash_vs_id_hash[id] = hs;
553 hash_vs_id_id[id] = id;
554
555 no++;
556 }
557 FREE_lint(data);
558 if (f_v) {
559 cout << "isomorph::add_solutions_to_database "
560 "case " << the_case << " done, added "
561 << nb_solutions << " solutions; "
562 "n e w database length is " << no << endl;
563 }
564}
565
566
568 std::string *fname,
569 int f_has_final_test_function,
570 int (*final_test_function)(long int *data, int sz,
571 void *final_test_data, int verbose_level),
572 void *final_test_data,
573 int verbose_level)
574// We assume that N, the number of solutions is known
575{
576 int f_v = (verbose_level >= 1);
577 //int f_vv = (verbose_level >= 2);
578 int f_vvv = (verbose_level >= 3);
579
580 int i, nb_total = 0, j, a, nb = 0, prev = 0, id = 0, h;
581 char *p_buf;
582 long int data[1000];
583 char buf[MY_BUFSIZE];
584 int print_mod = 1000;
585 uint_4 datref;
586 int nb_fail = 0;
591
592 if (f_v) {
593 cout << "isomorph::build_up_database "
594 "nb_files=" << nb_files << " N=" << N << endl;
595 }
596
597
598 setup_and_create_solution_database(verbose_level - 1);
599
600
601 if (f_v) {
602 cout << "isomorph::build_up_database "
603 "after setup_and_create_solution_database" << endl;
604 }
605
610
611 for (i = 0; i < nb_files; i++) {
612
613 ifstream f(fname[i]);
614 if (f_v) {
615 cout << "isomorph::build_up_database "
616 "reading file " << fname[i] << " of size "
617 << Fio.file_size(fname[i]) << endl;
618 }
619
620 while (TRUE) {
621
622 if (f.eof()) {
623 break;
624 }
625
626#if 0
627 {
628 string S;
629 int l;
630 getline(f, S);
631 l = S.length();
632 if (f_vvv) {
633 cout << "isomorph::build_up_database "
634 "read line of length " << l << " : " << S << endl;
635 }
636 for (j = 0; j < l; j++) {
637 buf[j] = S[j];
638 }
639 buf[l] = 0;
640 }
641#else
642 {
643 f.getline(buf, MY_BUFSIZE, '\n');
644 }
645#endif
646 if (f_vvv) {
647 cout << "isomorph::build_up_database "
648 "read: " << buf << endl;
649 }
650
651 p_buf = buf;
652
653
654 ST.s_scan_int(&p_buf, &a);
655
656 data[0] = a; // starter number
657
658 if (data[0] != prev) {
659 prev = data[0];
660 nb = 0;
661 }
662 if (a == -1) {
663 break;
664 }
665
666 for (j = 0; j < size; j++) {
667 ST.s_scan_int(&p_buf, &a);
668 data[j + 1] = a;
669 }
670
671
672 if (f_has_final_test_function) {
673 if (!(*final_test_function)(data + 1, size,
674 final_test_data, verbose_level - 1)) {
675 if (f_vvv) {
676 cout << "isomorph::build_up_database "
677 "solution fails the final test, "
678 "skipping" << endl;
679 }
680 nb_fail++;
681 continue;
682 }
683 else {
684 cout << nb_total << " : " << data[0] << " : ";
685 Lint_vec_print(cout, data + 1, size);
686 cout << endl;
687 }
688 }
689
690 id = solution_first[data[0]] + nb;
691
692
693 h = Data.lint_vec_hash_after_sorting(data + 1, size);
694
696 nb, id, nb_total, N, h, datref, print_mod,
697 verbose_level - 3);
698
699 id_to_datref[id] = datref;
700 id_to_hash[id] = h;
701 hash_vs_id_hash[id] = h;
702 hash_vs_id_id[id] = id;
703
704 nb_total++; // number of solutions total
705 nb++; // number of solutions within the starter case
706 } // end while
707 if (f_v) {
708 cout << "isomorph::build_up_database "
709 "finished reading file " << fname[i]
710 << " nb=" << nb << " nb_total=" << nb_total << endl;
711 }
712 } // next i
713
714
715 if (f_v) {
716 cout << "isomorph::build_up_database finished "
717 "number of solutions total = " << nb_total
718 << " nb_fail = " << nb_fail << endl;
719 }
720
721
722 write_hash_and_datref_file(verbose_level);
723 if (f_v) {
724 cout << "isomorph::build_up_database "
725 "written hash and datref file" << endl;
726 cout << "isomorph::build_up_database "
727 "sorting hash_vs_id_hash" << endl;
728 }
729 {
731
732 C.init(hash_vs_id_hash, N, TRUE, 0);
733 cout << "isomorph::build_up_database "
734 "Classification of hash values:" << endl;
735 C.print(FALSE /*f_backwards*/);
736 }
738 if (f_v) {
739 cout << "isomorph::build_up_database "
740 "after sorting hash_vs_id_hash" << endl;
741 }
742
743 close_solution_database(verbose_level - 1);
744 if (f_v) {
745 cout << "isomorph::build_up_database done" << endl;
746 }
747}
748
749
751 int modulus, int level,
752 int f_collated, int base_split,
753 int f_get_statistics,
754 int f_has_final_test_function,
755 int (*final_test_function)(long int *data, int sz,
756 void *final_test_data, int verbose_level),
757 void *final_test_data,
758 int verbose_level)
759{
760 int f_v = (verbose_level >= 1);
761 int f_vv = (verbose_level >= 2);
762 string *fname;
763 int i;
764 char file_name[1000];
765
766 if (f_v) {
767 cout << "isomorph::init_cases_from_file_modulus_"
768 "and_build_up_database modulus = " << modulus << endl;
769 }
770 fname = new string [modulus];
771 if (f_v) {
772 cout << "creating file names" << endl;
773 }
774 for (i = 0; i < modulus; i++) {
775 if (f_collated) {
776 sprintf(file_name, "collated_%s_%d_%d_%d_%d.txt",
777 prefix.c_str(), level, base_split, i, modulus);
778 }
779 else {
780 sprintf(file_name, "extend_%s_%d_%d_%d.txt",
781 prefix.c_str(), level, i, modulus);
782 }
783 //sprintf(file_name, "extend_BLT_41_lvl_%d_%d_42_%d_1024.txt",
784 //level, level, i);
785 fname[i] = NEW_char(strlen(file_name) + 1);
786 fname[i].assign(file_name);
787 }
788 if (f_vv) {
789 for (i = 0; i < modulus; i++) {
790 cout << i << " : " << fname[i] << endl;
791 }
792 }
793 count_solutions(modulus,
794 fname,
795 f_get_statistics,
796 f_has_final_test_function,
797 final_test_function,
798 final_test_data,
799 verbose_level);
800
801 //registry_dump_sorted();
802 //registry_dump_sorted_by_size();
803
804 // now we know N, the number of solutions
805
806 build_up_database(modulus, fname,
807 f_has_final_test_function,
808 final_test_function,
809 final_test_data,
810 verbose_level);
811
812 if (f_v) {
813 cout << "deleting file names" << endl;
814 }
815 delete [] fname;
816}
817
819 int nb_Mod, int *Mod_r, int *Mod_split, int *Mod_base_split,
820 int level, int f_get_statistics,
821 int f_has_final_test_function,
822 int (*final_test_function)(long int *data, int sz,
823 void *final_test_data, int verbose_level),
824 void *final_test_data,
825 int verbose_level)
826{
827 int f_v = (verbose_level >= 1);
828 int f_vv = (verbose_level >= 2);
829 string *fname;
830 int i, r, s, bs, nb_files, j, k, h, u;
831 char file_name[1000];
832
833 if (f_v) {
834 cout << "isomorph::init_cases_from_file_mixed_"
835 "modulus_and_build_up_database" << endl;
836 cout << "r : split : base_split" << endl;
837 for (i = 0; i < nb_Mod; i++) {
838 cout << Mod_r[i] << " : " << Mod_split[i] << " : "
839 << Mod_base_split[i] << endl;
840 }
841 cout << "computing the number of files" << endl;
842 }
843 nb_files = 0;
844 for (i = 0; i < nb_Mod; i++) {
845 r = Mod_r[i];
846 s = Mod_split[i];
847 bs = Mod_base_split[i];
848 nb_files += bs / s;
849 }
850 if (f_v) {
851 cout << "number of files is " << nb_files << endl;
852 }
853
854 fname = new string [nb_files];
855 if (f_v) {
856 cout << "creating file names" << endl;
857 }
858 j = 0;
859 for (i = 0; i < nb_Mod; i++) {
860 r = Mod_r[i];
861 s = Mod_split[i];
862 bs = Mod_base_split[i];
863 k = bs / s;
864 for (h = 0; h < k; h++) {
865 u = h * s + r;
866 sprintf(file_name, "extend_%s_%d_%d_%d.txt",
867 prefix.c_str(), level, u, bs);
868 //sprintf(file_name, "extend_BLT_41_lvl_%d_%d_42_%d_1024.txt",
869 // level, level, i);
870 fname[j].assign(file_name);
871 j++;
872 }
873 }
874 if (j != nb_files) {
875 cout << "isomorph::init_cases_from_file_mixed_modulus_"
876 "and_build_up_database j != nb_files" << endl;
877 exit(1);
878 }
879 if (f_vv) {
880 for (i = 0; i < nb_files; i++) {
881 cout << i << " : " << fname[i] << endl;
882 }
883 }
884
885 count_solutions(nb_files,
886 fname,
887 f_get_statistics,
888 f_has_final_test_function,
889 final_test_function,
890 final_test_data,
891 verbose_level);
892
893 // now we know N, the number of solutions
894
895
896 build_up_database(nb_files, fname,
897 f_has_final_test_function,
898 final_test_function,
899 final_test_data,
900 verbose_level);
901
902 if (f_v) {
903 cout << "deleting file names" << endl;
904 }
905 delete [] fname;
906}
907
908void isomorph::count_solutions(int nb_files, std::string *fname,
909 int f_get_statistics,
910 int f_has_final_test_function,
911 int (*final_test_function)(long int *data, int sz,
912 void *final_test_data, int verbose_level),
913 void *final_test_data,
914 int verbose_level)
915{
916 int f_v = (verbose_level >= 1);
917 int i;
918 int total_days, total_hours, total_minutes;
919
920 if (nb_starter == 0) {
921 cout << "isomorph::count_solutions "
922 "nb_starter == 0" << endl;
923 exit(1);
924 }
925 if (f_v) {
926 cout << "isomorph::count_solutions "
927 "nb_starter = " << nb_starter << endl;
928 }
931 for (i = 0; i < nb_starter; i++) {
932 solution_first[i] = 0;
933 solution_len[i] = 0;
934 }
939
940 for (i = 0; i < nb_starter; i++) {
941 stats_nb_backtrack[i] = -1;
943 stats_graph_size[i] = -1;
944 stats_time[i] = -1;
945 }
946
947 count_solutions2(nb_files, fname,
948 total_days, total_hours, total_minutes,
949 f_has_final_test_function,
950 final_test_function,
951 final_test_data,
952 verbose_level);
953 if (f_v) {
954 cout << "isomorph::count_solutions "
955 "after count_solutions2" << endl;
956 cout << "case_len: ";
958 cout << endl;
959 }
960 cout << "total computing time for the search : ";
961 cout << total_days << "-" << total_hours << ":"
962 << total_minutes << ":" << 0;
963 cout << endl;
964
965 cout << "case : nb of solutions" << endl;
966 solution_first[0] = 0;
967 for (i = 0; i < nb_starter; i++) {
969 if (solution_len[i]) {
970 cout << i << " : " << solution_len[i] << endl;
971 }
972 }
974 if (f_v) {
975 cout << "isomorph::count_solutions N=" << N << endl;
976 }
977
978 init_starter_number(verbose_level);
979 if (f_v) {
980 cout << "isomorph::count_solutions "
981 "after init_starter_number" << endl;
982 }
983
985 if (f_v) {
986 cout << "isomorph::count_solutions "
987 "after write_solution_first_and_len" << endl;
988 }
989
990 if (f_get_statistics) {
991 get_statistics(nb_files, fname, verbose_level);
993 evaluate_statistics(verbose_level);
994 }
995}
996
997void isomorph::get_statistics(int nb_files,
998 std::string *fname, int verbose_level)
999{
1000 int i, the_case, nb_sol, nb_backtrack, nb_backtrack_decision;
1001 int nb_points, dt[5], dt_total;
1002 int f_v = (verbose_level >= 1);
1003 //int f_vv = (verbose_level >= 2);
1004 //int f_vvv = (verbose_level >= 3);
1005 string fname_summary;
1007
1008 if (f_v) {
1009 cout << "get_statistics: reading "
1010 << nb_files << " files" << endl;
1011 }
1012#if 0
1013 for (i = 0; i < nb_files; i++) {
1014 cout << fname[i] << endl;
1015 }
1016#endif
1017
1018
1019 for (i = 0; i < nb_files; i++) {
1020
1021
1022 fname_summary.assign(fname[i]);
1023
1024 // ToDo:
1025#if 0
1026 if (strcmp(fname_summary + strlen(fname_summary) - 4, ".txt")) {
1027 cout << "get_statistics: file name does not end in .txt" << endl;
1028 return;
1029 }
1030 strcpy(fname_summary + strlen(fname_summary) - 4, ".summary");
1031#endif
1032
1033 ifstream fp(fname_summary);
1034
1035 if (f_v) {
1036 cout << "file " << i << " / " << nb_files
1037 << ", reading file " << fname_summary
1038 << " of size " << Fio.file_size(fname[i]) << endl;
1039 }
1040 if (Fio.file_size(fname_summary) <= 0) {
1041 cout << "problems reading file " << fname_summary << endl;
1042 return;
1043 }
1044 while (TRUE) {
1045 fp >> the_case;
1046 if (the_case == -1)
1047 break;
1048 fp >> nb_sol;
1049 fp >> nb_backtrack;
1050 fp >> nb_backtrack_decision;
1051 fp >> nb_points;
1052 fp >> dt[0];
1053 fp >> dt[1];
1054 fp >> dt[2];
1055 fp >> dt[3];
1056 fp >> dt[4];
1057 fp >> dt_total;
1058 stats_nb_backtrack[the_case] = nb_backtrack;
1059 stats_nb_backtrack_decision[the_case] = nb_backtrack_decision;
1060 stats_graph_size[the_case] = nb_points;
1061 stats_time[the_case] = dt_total;
1062 }
1063 } // next i
1064
1065}
1066
1068{
1070
1071 {
1072 ofstream f(fname_statistics);
1073 int i;
1074
1075 f << nb_starter << endl;
1076 for (i = 0; i < nb_starter; i++) {
1077 f << setw(7) << i << " "
1078 << setw(4) << stats_nb_backtrack[i]
1079 << setw(4) << stats_nb_backtrack_decision[i]
1080 << setw(4) << stats_graph_size[i]
1081 << setw(4) << stats_time[i] << endl;
1082 }
1083 f << "-1" << endl;
1084 }
1085 cout << "written file " << fname_statistics << " of size "
1086 << Fio.file_size(fname_statistics) << endl;
1087}
1088
1089void isomorph::evaluate_statistics(int verbose_level)
1090{
1091 int f_v = (verbose_level >= 1);
1092 int i;
1093 int nb_backtrack_max;
1094 int nb_backtrack_min;
1095 int graph_size_max;
1096 int graph_size_min;
1097 int time_max;
1098 int time_min;
1099 ring_theory::longinteger_object a, b, c, a1, b1, c1, d, n, q1, q2, q3, r1, r2, r3;
1101
1102 nb_backtrack_max = nb_backtrack_min = stats_nb_backtrack[0];
1103 graph_size_max = graph_size_min = stats_graph_size[0];
1104 time_max = time_min = stats_time[0];
1105
1106 a.create(0, __FILE__, __LINE__);
1107 b.create(0, __FILE__, __LINE__);
1108 c.create(0, __FILE__, __LINE__);
1109 for (i = 0; i < nb_starter; i++) {
1110 nb_backtrack_max =
1111 MAXIMUM(nb_backtrack_max, stats_nb_backtrack[i]);
1112 nb_backtrack_min =
1113 MINIMUM(nb_backtrack_min, stats_nb_backtrack[i]);
1114 graph_size_max =
1115 MAXIMUM(graph_size_max, stats_graph_size[i]);
1116 graph_size_min =
1117 MINIMUM(graph_size_min, stats_graph_size[i]);
1118 time_max =
1119 MAXIMUM(time_max, stats_time[i]);
1120 time_min =
1121 MINIMUM(time_min, stats_time[i]);
1122 a1.create(stats_nb_backtrack[i], __FILE__, __LINE__);
1123 b1.create(stats_graph_size[i], __FILE__, __LINE__);
1124 c1.create(stats_time[i], __FILE__, __LINE__);
1125 D.add(a, a1, d);
1126 d.assign_to(a);
1127 D.add(b, b1, d);
1128 d.assign_to(b);
1129 D.add(c, c1, d);
1130 d.assign_to(c);
1131 }
1132 if (f_v) {
1133 cout << "evaluate_statistics" << endl;
1134 cout << "nb_backtrack_max=" << nb_backtrack_max << endl;
1135 cout << "nb_backtrack_min=" << nb_backtrack_min << endl;
1136 cout << "graph_size_max=" << graph_size_max << endl;
1137 cout << "graph_size_min=" << graph_size_min << endl;
1138 cout << "time_max=" << time_max << endl;
1139 cout << "time_min=" << time_min << endl;
1140 cout << "sum nb_backtrack = " << a << endl;
1141 cout << "sum graph_size = " << b << endl;
1142 cout << "sum time = " << c << endl;
1143 n.create(nb_starter, __FILE__, __LINE__);
1144 D.integral_division(a, n, q1, r1, 0);
1145 D.integral_division(b, n, q2, r2, 0);
1146 D.integral_division(c, n, q3, r3, 0);
1147 cout << "average nb_backtrack = " << q1 << endl;
1148 cout << "average graph_size = " << q2 << endl;
1149 cout << "average time = " << q3 << endl;
1150 }
1151}
1152
1153
1154
1155
1156void isomorph::count_solutions2(int nb_files, std::string *fname,
1157 int &total_days, int &total_hours, int &total_minutes,
1158 int f_has_final_test_function,
1159 int (*final_test_function)(long int *data, int sz,
1160 void *final_test_data, int verbose_level),
1161 void *final_test_data,
1162 int verbose_level)
1163// also fills the array case_len[] with the
1164// number of solutions per starter
1165{
1166 int f_v = (verbose_level >= 1);
1167 int f_vv = (verbose_level >= 2);
1168 int f_vvv = (verbose_level >= 3);
1169 int i, no, l, j, a, nb, prev;
1170 char *p_buf;
1171 char buf[MY_BUFSIZE];
1172 long int data[1000];
1173 int *nb_sol_per_file;
1175 char str[1000];
1176 int nb_fail = 0;
1179
1180 if (f_v) {
1181 cout << "count_solutions2: reading " << nb_files << " files" << endl;
1182 cout << "verbose_level = " << verbose_level << endl;
1183 if (f_vv) {
1184 for (i = 0; i < nb_files; i++) {
1185 cout << fname[i] << endl;
1186 }
1187 }
1188 }
1189 total_days = 0;
1190 total_hours = 0;
1191 total_minutes = 0;
1192
1193 nb_sol_per_file = NEW_int(nb_files);
1194
1195 for (i = 0; i < nb_files; i++) {
1196
1197 nb_sol_per_file[i] = 0;
1198
1199 ifstream f(fname[i]);
1200 cout << "reading file " << fname[i] << " of size "
1201 << Fio.file_size(fname[i]) << endl;
1202 if (Fio.file_size(fname[i]) <= 0) {
1203 cout << "problems reading file " << fname[i] << endl;
1204 exit(1);
1205 }
1206 no = 0;
1207 nb = 0;
1208 prev = -1;
1209 while (TRUE) {
1210
1211 if (f.eof()) {
1212 break;
1213 }
1214 {
1215 string S;
1216 getline(f, S);
1217 l = S.length();
1218 //cout << "read line of length " << l << " : " << S << endl;
1219 for (j = 0; j < l; j++) {
1220 buf[j] = S[j];
1221 }
1222 buf[l] = 0;
1223 }
1224 if (FALSE) {
1225 cout << "line " << no << " read: " << buf << endl;
1226 }
1227
1228 p_buf = buf;
1229
1230
1231 ST.s_scan_int(&p_buf, &a);
1232
1233 data[0] = a; // case number
1234
1235
1236 if (data[0] == -1) {
1237 solution_len[prev] = nb;
1238 if (f_vvv) {
1239 cout << "isomorph::count_solutions2 "
1240 "solution_len[" << prev << "]=" << nb << endl;
1241 }
1242 break;
1243 }
1244
1245
1246 for (j = 0; j < size; j++) {
1247 ST.s_scan_int(&p_buf, &a);
1248 data[j + 1] = a;
1249 }
1250
1251
1252 if (f_has_final_test_function) {
1253 if (!(*final_test_function)(data + 1, size,
1254 final_test_data, verbose_level - 1)) {
1255 if (f_vvv) {
1256 cout << "isomorph::count_solutions2 "
1257 "solution fails the final test, "
1258 "skipping" << endl;
1259 }
1260 nb_fail++;
1261 continue;
1262 }
1263 }
1264
1265
1266 if (data[0] != prev) {
1267 if (prev != -1) {
1268 solution_len[prev] = nb;
1269 if (f_vvv) {
1270 cout << "isomorph::count_solutions "
1271 "solution_len[" << prev << "]="
1272 << nb << endl;
1273 }
1274 }
1275 prev = data[0];
1276 nb = 0;
1277 }
1278 nb_sol_per_file[i]++;
1279 no++;
1280 nb++;
1281 } // while
1282
1283 cout << "file " << fname[i] << " has " << nb_sol_per_file[i]
1284 << " lines and " << nb << " solutions and " << nb_fail
1285 << " false positives" << endl;
1286
1287 ST.s_scan_token_arbitrary(&p_buf, str);
1288 cout << "file " << fname[i] << " time " << str << endl;
1289
1290 } // next i
1291
1292 FREE_int(nb_sol_per_file);
1293 if (f_v) {
1294 cout << "isomorph::count_solutions2 done" << endl;
1295 }
1296}
1297
1298
1299
1301{
1302 ofstream f(fname_case_len);
1303 int i;
1304
1305 f << N << " " << nb_starter << endl;
1306 for (i = 0; i < nb_starter; i++) {
1307 f << setw(4) << i << " " << setw(4) << solution_first[i]
1308 << " " << setw(4) << solution_len[i] << endl;
1309 }
1310 f << "-1" << endl;
1311}
1312
1314{
1317
1318 cout << "isomorph::read_solution_first_and_len "
1319 "reading from file "
1320 << fname_case_len << " of size "
1321 << Fio.file_size(fname_case_len) << endl;
1322
1323 ifstream f(fname_case_len);
1324 int i, a;
1325
1326 f >> N >> nb_starter;
1329 for (i = 0; i < nb_starter; i++) {
1330 f >> a;
1331 f >> solution_first[i];
1332 f >> solution_len[i];
1333 }
1337 f >> a;
1338 if (a != -1) {
1339 cout << "problem in read_solution_first_and_len" << endl;
1340 exit(1);
1341 }
1342 cout << "isomorph::read_solution_first_and_len:" << endl;
1344 cout << endl;
1345 cout << "isomorph::read_solution_first_and_len done" << endl;
1346}
1347
1349{
1350 int f_v = (verbose_level >= 1);
1352
1353
1354 if (f_v) {
1355 cout << "isomorph::write_starter_nb_orbits" << endl;
1356 }
1357
1359 fname_orbits_of_stabilizer_csv, "Stab_orbits");
1360
1361 cout << "isomorph::write_starter_nb_orbits Written file "
1362 << fname_orbits_of_stabilizer_csv << " of size "
1364
1365 if (f_v) {
1366 cout << "isomorph::write_starter_nb_orbits done" << endl;
1367 }
1368}
1369
1371{
1372 int f_v = (verbose_level >= 1);
1374
1375
1376 if (f_v) {
1377 cout << "isomorph::read_starter_nb_orbits" << endl;
1378 }
1379 int *M;
1380 int m, n, i;
1381
1382 cout << "isomorph::read_starter_nb_orbits Reading file "
1383 << fname_orbits_of_stabilizer_csv << " of size "
1385
1387 M, m, n, verbose_level);
1388
1389 if (m != nb_starter) {
1390 cout << "isomorph::read_starter_nb_orbits "
1391 "m != nb_starter" << endl;
1392 exit(1);
1393 }
1394 if (n != 1) {
1395 cout << "isomorph::read_starter_nb_orbits "
1396 "n != 1" << endl;
1397 exit(1);
1398 }
1399
1402 flag_orbit_fst[0] = 0;
1403 for (i = 0; i < m; i++) {
1404 flag_orbit_len[i] = M[i];
1405 flag_orbit_fst[i + 1] =
1407 }
1408
1409 FREE_int(M);
1410
1411 if (f_v) {
1412 cout << "isomorph::read_starter_nb_orbits done" << endl;
1413 }
1414}
1415
1416
1418// Writes the file 'fname_hash_and_datref'
1419// containing id_to_hash[] and id_to_datref[]
1420{
1421 int f_v = (verbose_level >= 1);
1423
1424 if (f_v) {
1425 cout << "isomorph::write_hash_and_datref_file" << endl;
1426 }
1427 {
1428 ofstream f(fname_hash_and_datref);
1429 int i;
1430
1431 f << N << endl;
1432 for (i = 0; i < N; i++) {
1433 f << setw(3) << i << " "
1434 << setw(3) << id_to_hash[i] << " "
1435 << setw(3) << id_to_datref[i] << endl;
1436 }
1437 f << -1 << endl;
1438 }
1439 if (f_v) {
1440 cout << "isomorph::write_hash_and_datref_file finished" << endl;
1441 cout << "isomorph::write_hash_and_datref_file written file "
1442 << fname_hash_and_datref << " of size "
1443 << Fio.file_size(fname_hash_and_datref) << endl;
1444 }
1445}
1446
1448// Reads the file 'fname_hash_and_datref'
1449// containing id_to_hash[] and id_to_datref[]
1450// Also initializes hash_vs_id_hash and hash_vs_id_id
1451// Called from init_solution
1452{
1453 int f_v = (verbose_level >= 1);
1454 int f_vv = (verbose_level >= 5);
1456
1457 if (f_v) {
1458 cout << "isomorph::read_hash_and_datref_file" << endl;
1459 }
1460 ifstream f(fname_hash_and_datref);
1461 int id, a, h, d, N1;
1462 f >> N1;
1463 if (N1 != N) {
1464 cout << "isomorph::read_hash_and_datref_file "
1465 "N1 != N" << endl;
1466 cout << "N=" << N << endl;
1467 cout << "N1=" << N1 << endl;
1468 exit(1);
1469 }
1470
1472 id_to_hash = NEW_int(N);
1475
1476 for (id = 0; id < N; id++) {
1477 f >> a >> h >> d;
1478 if (a != id) {
1479 cout << "isomorph::read_hash_and_datref_file "
1480 "a != id" << endl;
1481 exit(1);
1482 }
1483 id_to_hash[id] = h;
1484 id_to_datref[id] = d;
1485 hash_vs_id_hash[id] = h;
1486 hash_vs_id_id[id] = id;
1487 }
1488 f >> a;
1489 if (a != -1) {
1490 cout << "isomorph::read_hash_and_datref_file "
1491 "EOF marker missing" << endl;
1492 exit(1);
1493 }
1495
1496 if (f_vv) {
1497 cout << "isomorph::read_hash_and_datref_file" << endl;
1499 }
1500
1501 if (f_v) {
1502 cout << "isomorph::read_hash_and_datref_file done" << endl;
1503 }
1504}
1505
1507{
1508 int i;
1509
1510 cout << "isomorph::print_hash_vs_id" << endl;
1511 cout << "i : hash_vs_id_hash[i] : hash_vs_id_id[i]" << endl;
1512 for (i = 0; i < N; i++) {
1513 cout << i << " : " << hash_vs_id_hash[i]
1514 << " : " << hash_vs_id_id[i] << endl;
1515 }
1516}
1517
1518void isomorph::write_orbit_data(int verbose_level)
1519// Writes the file 'fname_staborbits'
1520{
1521 int f_v = (verbose_level >= 1);
1523
1524 if (f_v) {
1525 cout << "write_orbit_data" << endl;
1526 }
1527 {
1528 ofstream f(fname_staborbits);
1529 int i;
1530
1531 f << nb_orbits << " " << N << endl;
1532 for (i = 0; i < nb_orbits; i++) {
1533 f << setw(3) << i << " "
1534 << setw(3) << orbit_fst[i] << " "
1535 << setw(3) << orbit_len[i] << endl;
1536 }
1537 for (i = 0; i < N; i++) {
1538 f << setw(3) << i << " "
1539 << setw(3) << orbit_number[i] << " "
1540 << setw(3) << orbit_perm[i] << " "
1541 << setw(3) << schreier_vector[i] << " "
1542 << setw(3) << schreier_prev[i] << " "
1543 << endl;
1544 }
1545 f << "-1" << endl;
1546 }
1547 if (f_v) {
1548 cout << "write_orbit_data finished" << endl;
1549 cout << "written file " << fname_staborbits << " of size "
1550 << Fio.file_size(fname_staborbits) << endl;
1551 }
1552}
1553
1554void isomorph::read_orbit_data(int verbose_level)
1555// Reads from the file 'fname_staborbits'
1556// Reads nb_orbits, N,
1557// orbit_fst[nb_orbits + 1]
1558// orbit_len[nb_orbits]
1559// orbit_number[N]
1560// orbit_perm[N]
1561// schreier_vector[N]
1562// schreier_prev[N]
1563// and computed orbit_perm_inv[N]
1564{
1565 int f_v = (verbose_level >= 1);
1567
1568 ifstream f(fname_staborbits);
1569 int i, a;
1570
1571 if (f_v) {
1572 cout << "read_orbit_data" << endl;
1573 }
1574 f >> nb_orbits >> N;
1575 if (f_v) {
1576 cout << "nb_orbits=" << nb_orbits << endl;
1577 cout << "N=" << N << endl;
1578 }
1579
1583 orbit_perm = NEW_int(N);
1587
1588 for (i = 0; i < nb_orbits; i++) {
1589 f >> a;
1590 f >> orbit_fst[i];
1591 f >> orbit_len[i];
1592 }
1593 for (i = 0; i < N; i++) {
1594 f >> a;
1595 f >> orbit_number[i];
1596 f >> orbit_perm[i];
1597 f >> schreier_vector[i];
1598 f >> schreier_prev[i];
1599 }
1602 f >> a;
1603 if (a != -1) {
1604 cout << "problem in read_orbit_data" << endl;
1605 exit(1);
1606 }
1607 if (f_v) {
1608 cout << "read_orbit_data finished" << endl;
1609 }
1610}
1611
1613 int select_first, int select_len,
1614 int verbose_level)
1615// Calls print_set_function (if available)
1616{
1617 int f_v = (verbose_level >= 1);
1618 int h, i, j, id, first, c;
1620
1621 if (f_v) {
1622 cout << "isomorph::print_isomorphism_types" << endl;
1623 if (f_select) {
1624 cout << "printing " << select_first << " / "
1625 << select_len << endl;
1626 }
1627 }
1628 cout << "we found " << Reps->count << " isomorphism types" << endl;
1629 cout << "i : orbit_no : id of orbit representative (solution) : "
1630 "prefix case number" << endl;
1631 for (i = 0; i < Reps->count; i++) {
1632 j = Reps->rep[i];
1633 first = orbit_fst[j];
1634 c = starter_number[first];
1635 id = orbit_perm[first];
1636 cout << "isomorphism type " << i << " : " << j << " : "
1637 << id << " : " << c;
1638 if (Reps->stab[i]) {
1639 Reps->stab[i]->group_order(go);
1640 cout << " stabilizer order " << go << endl;
1641 }
1642 else {
1643 cout << endl;
1644 }
1645 }
1646
1647 long int data[1000];
1648
1649 setup_and_open_solution_database(verbose_level - 1);
1650
1651 if (!f_select) {
1652 select_first = 0;
1653 select_len = Reps->count;
1654 }
1655 for (h = 0; h < select_len; h++) {
1656
1657 i = select_first + h;
1658 j = Reps->rep[i];
1659 id = orbit_perm[orbit_fst[j]];
1660 load_solution(id, data);
1661 cout << "isomorphism type " << i << " : " << j << " : "
1662 << id << " : ";
1663 Lint_vec_print(cout, data, size);
1664 cout << endl;
1665#if 0
1666 for (j = 0; j < size; j++) {
1667 O->unrank_point(O->v2, 1, data[j]);
1668 int_vec_print(cout, O->v2, algebraic_dimension);
1669 if (j < size - 1) {
1670 cout << ", ";
1671 }
1672 cout << endl;
1673 }
1674#endif
1675 groups::sims *Stab;
1676
1677 Stab = Reps->stab[i];
1678
1679 if (f_v) {
1680 cout << "isomorph::print_isomorphism_types computing "
1681 "induced action on the set (in data)" << endl;
1682 }
1683 induced_action_on_set(Stab, data, verbose_level);
1684
1685 if (f_v) {
1687
1688 AA->group_order(go);
1689 cout << "action " << AA->label << " computed, "
1690 "group order is " << go << endl;
1691 }
1692
1693 groups::schreier Orb;
1695
1696 AA->compute_all_point_orbits(Orb, Stab->gens, verbose_level - 2);
1697 cout << "Computed all orbits on the set, found "
1698 << Orb.nb_orbits << " orbits" << endl;
1699 cout << "orbit lengths: ";
1700 Int_vec_print(cout, Orb.orbit_len, Orb.nb_orbits);
1701 cout << endl;
1702
1703 if (print_set_function) {
1704 if (f_v) {
1705 cout << "isomorph::print_isomorphism_types "
1706 "calling print_set_function, "
1707 "iso_cnt=" << i + 1 << endl;
1708 }
1709 (*print_set_function)(this, i + 1, Stab,
1710 Orb, data, print_set_data, verbose_level);
1711 if (f_v) {
1712 cout << "isomorph::print_isomorphism_types "
1713 "after print_set_function, "
1714 "iso_cnt=" << i + 1 << endl;
1715 }
1716 }
1717 }
1718 close_solution_database(verbose_level - 1);
1719}
1720
1722 ostream &file, actions::action *A,
1723 groups::sims *Stab, int size, long int *set, int verbose_level)
1724// Used in isomorph_BLT
1725{
1726 int f_v = (verbose_level >= 1);
1727 actions::action *AAA;
1728 //sims K;
1730 int i;
1731 int *Elt1;
1732
1734
1735 if (f_v) {
1736 cout << "isomorph::induced_action_on_set_and_kernel "
1737 "calling induced_action_by_restriction" << endl;
1738 cout << "set: ";
1739 Lint_vec_print(cout, set, size);
1740 cout << endl;
1741 }
1742
1743 int f_induce_action = TRUE;
1744
1746 Stab,
1747 size, set,
1748 f_induce_action,
1749 verbose_level - 1);
1750
1751 if (f_v) {
1752 cout << "isomorph::induced_action_on_set_and_kernel: "
1753 "after induced_action_by_restriction" << endl;
1754 }
1755
1756 AAA->group_order(go);
1757
1758 file << endl << "\\bigskip" << endl
1759 << "The induced group has order "
1760 << go << " and is generated by:" << endl << endl;
1761 AAA->group_order(go);
1762 for (i = 0; i < Stab->gens.len; i++) {
1763 int f_do_it_anyway_even_for_big_degree= TRUE;
1764 int f_print_cycles_of_length_one = TRUE;
1765
1766 file << "$g_{" << setw(2) << i + 1 << "} = $";
1768 Stab->gens.ith(i), file, 1,
1769 f_do_it_anyway_even_for_big_degree,
1770 f_print_cycles_of_length_one,
1771 0 /* verbose_level */);
1772 file << "\\\\" << endl;
1773 }
1774 if (go.compare_with_int(10) < 0) {
1775 file << "group order is small, so we list "
1776 "all elements\\\\" << endl;
1777 for (i = 0; i < go.as_lint(); i++) {
1778 int f_do_it_anyway_even_for_big_degree = TRUE;
1779 int f_print_cycles_of_length_one = TRUE;
1780
1781 file << "$a_{" << setw(2) << i + 1 << "} = $";
1782 Stab->element_unrank_lint(i, Elt1);
1784 f_do_it_anyway_even_for_big_degree,
1785 f_print_cycles_of_length_one,
1786 0 /* verbose_level */);
1787 file << "\\\\" << endl;
1788 }
1789 file << "and now the elements themselves:" << endl;
1790 for (i = 0; i < go.as_lint(); i++) {
1791
1792 Stab->element_unrank_lint(i, Elt1);
1793
1794 int *fp, n;
1795
1796 fp = NEW_int(A->degree);
1797 n = A->find_fixed_points(Elt1, fp, 0);
1798 //cout << "with " << n << " fixed points" << endl;
1799 FREE_int(fp);
1800
1801
1802 file << "$a_{" << setw(2) << i + 1 << "} = $" << endl;
1803 file << "$";
1804 AAA->element_print_latex(Elt1, file);
1805 file << "$ with " << n << " fixed points\\\\" << endl;
1806 }
1807 }
1808
1809 if (AAA->Kernel) {
1810 if (f_v) {
1811 cout << "isomorph::induced_action_on_set_and_kernel: "
1812 "printing kernel generators" << endl;
1813 }
1814 AAA->Kernel->group_order(ko);
1815 file << "Kernel has order " << ko
1816 << " and is generated by:\\\\" << endl;
1817 for (i = 0; i < AAA->Kernel->gens.len; i++) {
1818 file << "$$ b_{" << setw(2) << i + 1 << "} = " << endl;
1819 A->element_print_latex(AAA->Kernel->gens.ith(i), file);
1820 file << "$$" << endl;
1821 //file << "$b_{" << setw(2) << i + 1 << "} = $" << endl;
1822 //A->element_print_as_permutation_with_offset(K.gens.ith(i), file, 1);
1823 file << "\\\\" << endl;
1824 }
1825
1826 if (!ko.is_one()) {
1827 groups::schreier Orb;
1829 AAA->Kernel->gens, verbose_level - 2);
1830 int *val, *mult, len;
1831
1832 file << "The kernel has $" << Orb.nb_orbits
1833 << "$ orbits on the quadric.\\\\" << endl;
1835 val, mult, len);
1836 file << "The orbit length are $[";
1837 for (i = len - 1; i >= 0; i--) {
1838 file << val[i];
1839 if (mult[i] > 1) {
1840 file << "^{" << mult[i] << "}";
1841 }
1842 if (i)
1843 file << ", ";
1844 }
1845 file << "]$\\\\" << endl;
1846
1847#if 0
1848 int min_length, min_idx;
1849
1850 min_idx = -1;
1851 for (i = 0; i < Orb.nb_orbits; i++) {
1852 if (Orb.orbit_len[i] == 1)
1853 continue;
1854 if (min_idx == -1) {
1855 min_idx = i;
1856 min_length = Orb.orbit_len[i];
1857 continue;
1858 }
1859 if (Orb.orbit_len[i] < min_length) {
1860 min_idx = i;
1861 min_length = Orb.orbit_len[i];
1862 }
1863 }
1864 if (min_idx >= 0) {
1865 induced_action_on_orbit(file, AAA.Kernel->A,
1866 AAA.Kernel, Orb, min_idx, verbose_level);
1867 }
1868#endif
1869
1870 FREE_int(val);
1871 FREE_int(mult);
1872 }
1873 } // if (AAA.Kernel)
1874
1875
1876 file << "\\bigskip" << endl << endl;
1877 FREE_int(Elt1);
1878 FREE_OBJECT(AAA);
1879
1880}
1881
1882
1883void isomorph::handle_event_files(int nb_event_files,
1884 const char **event_file_name, int verbose_level)
1885{
1886 int i;
1887
1888 Reps->count = 0;
1889 for (i = 0; i < nb_event_files; i++) {
1890 read_event_file(event_file_name[i], verbose_level);
1891 }
1892 cout << "after reading " << nb_event_files
1893 << " event files, isomorph_cnt = "
1894 << Reps->count << endl;
1895
1896}
1897
1898void isomorph::read_event_file(const char *event_file_name,
1899 int verbose_level)
1900{
1901 int i;
1902 int nb_completed_cases, *completed_cases;
1903
1904 completed_cases = NEW_int(10000);
1905 event_file_completed_cases(event_file_name,
1906 nb_completed_cases, completed_cases, verbose_level);
1907 cout << "file " << event_file_name << " holds "
1908 << nb_completed_cases << " completed cases: ";
1909 Int_vec_print(cout, completed_cases, nb_completed_cases);
1910 cout << endl;
1911 for (i = 0; i < nb_completed_cases; i++) {
1912 event_file_read_case(event_file_name,
1913 completed_cases[i], verbose_level);
1914 }
1916 completed_cases[nb_completed_cases - 1] + 1);
1917}
1918
1919#define MY_BUFSIZE 1000000
1920
1922 ifstream &f, int verbose_level)
1923{
1924 char buf[MY_BUFSIZE];
1925 char token[1000];
1926 int l, j, case_no;
1927 char *p_buf;
1929
1930 cout << "isomorph::skip_through_event_file" << endl;
1931
1932 while (TRUE) {
1933
1934 if (f.eof()) {
1935 break;
1936 }
1937 {
1938 string S;
1939 getline(f, S);
1940 l = S.length();
1941 for (j = 0; j < l; j++) {
1942 buf[j] = S[j];
1943 }
1944 buf[l] = 0;
1945 }
1946 if (strncmp(buf, "-1", 2) == 0) {
1947 return;
1948 }
1949 *fp_event_out << buf << endl;
1950
1951 p_buf = buf;
1952 if (strncmp(buf, "BEGIN", 5) == 0) {
1953 ST.s_scan_token(&p_buf, token);
1954 ST.s_scan_token(&p_buf, token);
1955 ST.s_scan_token(&p_buf, token);
1956 ST.s_scan_int(&p_buf, &case_no);
1957 cout << "located isomorphism type "
1958 << case_no << " in event file" << endl;
1959 cout << "buf=" << buf << endl;
1960 for (orbit_no = 0; orbit_no < nb_orbits; orbit_no++) {
1961 if (Reps->fusion[orbit_no] == -2) {
1962 break;
1963 }
1964 }
1965 cout << "it belongs to orbit_no " << orbit_no << endl;
1966 *fp_event_out << "O " << orbit_no << endl;
1968 skip_through_event_file1(f, case_no,
1969 orbit_no, verbose_level);
1970 Reps->count++;
1971 }
1972
1973 }
1974 cout << "isomorph::skip_through_event_file done" << endl;
1975}
1976
1978 int case_no, int orbit_no, int verbose_level)
1979{
1980 int l, j, from_orbit, to_orbit, rank_subset;
1981 char *p_buf;
1982 char token[1000];
1983 char buf[MY_BUFSIZE];
1985
1986
1987 while (TRUE) {
1988
1989 if (f.eof()) {
1990 break;
1991 }
1992 {
1993 string S;
1994 getline(f, S);
1995 l = S.length();
1996 for (j = 0; j < l; j++) {
1997 buf[j] = S[j];
1998 }
1999 buf[l] = 0;
2000 }
2001
2002 p_buf = buf;
2003 if (strncmp(buf, "END", 3) == 0) {
2004 cout << "isomorphism type " << case_no
2005 << " has been read from event file" << endl;
2008 *fp_event_out << buf << endl;
2009 return;
2010 }
2011 ST.s_scan_token(&p_buf, token);
2012 if (strcmp(token, "F") == 0) {
2013 ST.s_scan_int(&p_buf, &from_orbit);
2014 ST.s_scan_int(&p_buf, &rank_subset);
2015 ST.s_scan_int(&p_buf, &to_orbit);
2016
2017 if (from_orbit != orbit_no) {
2018 cout << "skip_through_event_file1 "
2019 "from_orbit != orbit_no (read F)" << endl;
2020 cout << "from_orbit=" << from_orbit << endl;
2021 cout << "orbit_no=" << orbit_no << endl;
2022 exit(1);
2023 }
2024
2025 Reps->rep[case_no] = from_orbit;
2026 Reps->fusion[from_orbit] = from_orbit;
2027 Reps->fusion[to_orbit] = from_orbit;
2028 *fp_event_out << buf << endl;
2029 }
2030 else if (strcmp(token, "A") == 0) {
2031 ST.s_scan_int(&p_buf, &from_orbit);
2032 ST.s_scan_int(&p_buf, &rank_subset);
2033 ST.s_scan_token(&p_buf, token); // group order
2034
2035 if (from_orbit != orbit_no) {
2036 cout << "skip_through_event_file1 "
2037 "from_orbit != orbit_no (read A)" << endl;
2038 cout << "from_orbit=" << from_orbit << endl;
2039 cout << "orbit_no=" << orbit_no << endl;
2040 exit(1);
2041 }
2042
2043 Reps->rep[case_no] = from_orbit;
2044 Reps->fusion[from_orbit] = from_orbit;
2045 *fp_event_out << buf << endl;
2046 }
2047 else if (strcmp(token, "AF") == 0) {
2048 ST.s_scan_int(&p_buf, &from_orbit);
2049 ST.s_scan_int(&p_buf, &rank_subset);
2050 ST.s_scan_int(&p_buf, &to_orbit);
2051 ST.s_scan_token(&p_buf, token); // group order
2052
2053 if (from_orbit != orbit_no) {
2054 cout << "skip_through_event_file1 "
2055 "from_orbit != orbit_no (read AF)" << endl;
2056 cout << "from_orbit=" << from_orbit << endl;
2057 cout << "orbit_no=" << orbit_no << endl;
2058 exit(1);
2059 }
2060
2061 Reps->rep[case_no] = from_orbit;
2062 Reps->fusion[from_orbit] = from_orbit;
2063 *fp_event_out << buf << endl;
2064 }
2065 else if (strcmp(token, "O") == 0) {
2066 // do not print buf
2067 }
2068 else {
2069 *fp_event_out << buf << endl;
2070 }
2071
2072 }
2073}
2074
2075
2077 const char *event_file_name,
2078 int &nb_completed_cases, int *completed_cases,
2079 int verbose_level)
2080{
2081 int l, j, a;
2082 char *p_buf;
2083 char token[1000];
2084 ifstream f(event_file_name);
2085 char buf[MY_BUFSIZE];
2087
2088 nb_completed_cases = 0;
2089 while (TRUE) {
2090
2091 if (f.eof()) {
2092 break;
2093 }
2094 {
2095 string S;
2096 getline(f, S);
2097 l = S.length();
2098 for (j = 0; j < l; j++) {
2099 buf[j] = S[j];
2100 }
2101 buf[l] = 0;
2102 }
2103
2104 p_buf = buf;
2105 if (strncmp(buf, "END", 3) == 0) {
2106 ST.s_scan_token(&p_buf, token);
2107 ST.s_scan_token(&p_buf, token);
2108 ST.s_scan_token(&p_buf, token);
2109 ST.s_scan_int(&p_buf, &a);
2110 cout << "isomorphism type " << a
2111 << " has been completed" << endl;
2112 completed_cases[nb_completed_cases++] = a;
2113 }
2114
2115 }
2116}
2117
2119 const char *event_file_name, int case_no,
2120 int verbose_level)
2121{
2122 int l, j, a;
2123 char *p_buf;
2124 char token[1000];
2125 char buf[MY_BUFSIZE];
2126 ifstream f(event_file_name);
2128
2129 while (TRUE) {
2130
2131 if (f.eof()) {
2132 break;
2133 }
2134 {
2135 string S;
2136 getline(f, S);
2137 l = S.length();
2138 for (j = 0; j < l; j++) {
2139 buf[j] = S[j];
2140 }
2141 buf[l] = 0;
2142 }
2143
2144 p_buf = buf;
2145 if (strncmp(buf, "BEGIN", 5) == 0) {
2146 ST.s_scan_token(&p_buf, token);
2147 ST.s_scan_token(&p_buf, token);
2148 ST.s_scan_token(&p_buf, token);
2149 ST.s_scan_int(&p_buf, &a);
2150 if (a == case_no) {
2151 cout << "located isomorphism type " << a
2152 << " in event file" << endl;
2153 event_file_read_case1(f, case_no, verbose_level);
2154 return;
2155 }
2156 }
2157
2158 }
2159 cout << "did not find case " << case_no << " in event file "
2160 << event_file_name << endl;
2161 exit(1);
2162}
2163
2165 int case_no, int verbose_level)
2166{
2167 int l, j, from_orbit, to_orbit, rank_subset;
2168 char *p_buf;
2169 char token[1000];
2170 char buf[MY_BUFSIZE];
2172
2173
2174 while (TRUE) {
2175
2176 if (f.eof()) {
2177 break;
2178 }
2179 {
2180 string S;
2181 getline(f, S);
2182 l = S.length();
2183 for (j = 0; j < l; j++) {
2184 buf[j] = S[j];
2185 }
2186 buf[l] = 0;
2187 }
2188
2189 p_buf = buf;
2190 if (strncmp(buf, "END", 3) == 0) {
2191 cout << "isomorphism type " << case_no
2192 << " has been read from event file" << endl;
2195 return;
2196 }
2197 ST.s_scan_token(&p_buf, token);
2198 if (strcmp(token, "F") == 0) {
2199 ST.s_scan_int(&p_buf, &from_orbit);
2200 ST.s_scan_int(&p_buf, &rank_subset);
2201 ST.s_scan_int(&p_buf, &to_orbit);
2202
2203 Reps->rep[case_no] = from_orbit;
2204 Reps->fusion[from_orbit] = from_orbit;
2205 Reps->fusion[to_orbit] = from_orbit;
2206 }
2207 else if (strcmp(token, "A") == 0) {
2208 ST.s_scan_int(&p_buf, &from_orbit);
2209 ST.s_scan_int(&p_buf, &rank_subset);
2210 ST.s_scan_token(&p_buf, token); // group order
2211
2212 Reps->rep[case_no] = from_orbit;
2213 Reps->fusion[from_orbit] = from_orbit;
2214 }
2215 else if (strcmp(token, "AF") == 0) {
2216 ST.s_scan_int(&p_buf, &from_orbit);
2217 ST.s_scan_int(&p_buf, &rank_subset);
2218 ST.s_scan_int(&p_buf, &to_orbit);
2219 ST.s_scan_token(&p_buf, token); // group order
2220
2221 Reps->rep[case_no] = from_orbit;
2222 Reps->fusion[from_orbit] = from_orbit;
2223 }
2224
2225 }
2226}
2227
2228#define MY_BUFSIZE 1000000
2229
2231 ifstream *play_back_file,
2232 int &f_eof, int verbose_level)
2233{
2234 int f_v = (verbose_level >= 3);
2235 char *p_buf;
2236 char token[1000];
2237 char buf[MY_BUFSIZE];
2238 int rank;
2241
2242 f_eof = FALSE;
2243 if (play_back_file->eof()) {
2244 cout << "end of file reached" << endl;
2245 f_eof = TRUE;
2246 return FALSE;
2247 }
2248 play_back_file->getline(buf, MY_BUFSIZE, '\n');
2249 if (strlen(buf) == 0) {
2250 cout << "isomorph::next_subset_play_back "
2251 "reached an empty line" << endl;
2252 exit(1);
2253 }
2254 if (strncmp(buf, "BEGIN", 5) == 0) {
2255 cout << "BEGIN reached" << endl;
2256 play_back_file->getline(buf, MY_BUFSIZE, '\n');
2257 if (strlen(buf) == 0) {
2258 cout << "empty line reached" << endl;
2259 exit(1);
2260 }
2261 }
2262 if (strncmp(buf, "-1", 2) == 0) {
2263 cout << "end of file marker -1 reached" << endl;
2264 f_eof = TRUE;
2265 return FALSE;
2266 }
2267 if (strncmp(buf, "END-EOF", 7) == 0) {
2268 cout << "END-EOF reached" << endl;
2269 f_eof = TRUE;
2270 return FALSE;
2271 }
2272 if (strncmp(buf, "END", 3) == 0) {
2273 cout << "END reached" << endl;
2274 return FALSE;
2275 }
2276 if (f_v) {
2277 cout << "parsing: " << buf << endl;
2278 }
2279 p_buf = buf;
2280 ST.s_scan_token(&p_buf, token);
2281 ST.s_scan_int(&p_buf, &rank);
2282 ST.s_scan_int(&p_buf, &rank);
2283 if (f_v) {
2284 cout << "rank = " << rank << endl;
2285 cout << "subset_rank = " << subset_rank << endl;
2286 }
2287 if (rank == subset_rank) {
2288 if (f_v) {
2289 cout << "rank is equal to subset_rank, "
2290 "so we proceed" << endl;
2291 }
2292 }
2293 else {
2294
2295#if 0
2296 if (rank < subset_rank) {
2297 cout << "rank is less than subset_rank, "
2298 "something is wrong" << endl;
2299 exit(1);
2300 }
2301#endif
2302 Combi.unrank_k_subset(rank, subset, size, level);
2304 if (f_v) {
2305 cout << "moved to set " << subset_rank << endl;
2306 }
2307 }
2308 return TRUE;
2309}
2310
2312 std::string &prefix_classify, int verbose_level)
2313{
2314 int f_v = (verbose_level >= 1);
2315 int i;
2316
2317 if (f_v) {
2318 cout << "isomorph::read_everything_including_classification" << endl;
2319 }
2320
2321
2322 if (f_v) {
2323 cout << "isomorph::read_everything_including_classification before read_data_files_for_starter" << endl;
2324 }
2326 prefix_classify, verbose_level - 1);
2327 if (f_v) {
2328 cout << "isomorph::read_everything_including_classification after read_data_files_for_starter" << endl;
2329 }
2330
2331 if (f_v) {
2332 cout << "isomorph::read_everything_including_classification before init_solution" << endl;
2333 }
2334 init_solution(verbose_level - 1);
2335 if (f_v) {
2336 cout << "isomorph::read_everything_including_classification after init_solution" << endl;
2337 }
2338
2339 if (f_v) {
2340 cout << "isomorph::read_everything_including_classification before load_table_of_solutions" << endl;
2341 }
2342 load_table_of_solutions(verbose_level - 1);
2343 if (f_v) {
2344 cout << "isomorph::read_everything_including_classification after load_table_of_solutions" << endl;
2345 }
2346
2347 if (f_v) {
2348 cout << "isomorph::read_everything_including_classification before read_orbit_data" << endl;
2349 }
2350 read_orbit_data(verbose_level - 1);
2351 if (f_v) {
2352 cout << "isomorph::read_everything_including_classification after read_orbit_data" << endl;
2353 }
2354
2355 depth_completed = level /*- 2*/;
2356
2357 if (f_v) {
2358 cout << "isomorph::read_everything_including_classification before gen->recreate_schreier_vectors_up_to_level" << endl;
2359 }
2361 verbose_level);
2362 if (f_v) {
2363 cout << "isomorph::read_everything_including_classification after gen->recreate_schreier_vectors_up_to_level" << endl;
2364 }
2365
2366
2367 if (f_v) {
2368 for (i = 0; i <= level + 1; i++) {
2369 cout << "gen->first_node_at_level[" << i
2370 << "]=" << gen->first_node_at_level(i) << endl;
2371 }
2372 cout << "depth_completed=" << depth_completed << endl;
2373 }
2374
2375
2376 if (f_v) {
2377 cout << "isomorph::read_everything_including_classification before iso_test_init" << endl;
2378 }
2379 iso_test_init(verbose_level - 1);
2380 if (f_v) {
2381 cout << "isomorph::read_everything_including_classification after iso_test_init" << endl;
2382 }
2383
2384 //int f_implicit_fusion = FALSE;
2385
2386 //gen->f_allowed_to_show_group_elements = FALSE;
2387
2388 if (f_v) {
2389 cout << "isomorph::read_everything_including_classification before read_starter_nb_orbits" << endl;
2390 }
2391 read_starter_nb_orbits(verbose_level); // added Oct 30, 2014
2392 if (f_v) {
2393 cout << "isomorph::read_everything_including_classification after read_starter_nb_orbits" << endl;
2394 }
2395
2396 if (f_v) {
2397 cout << "isomorph::read_everything_including_classification before Reps->load" << endl;
2398 }
2399 Reps->load(verbose_level - 1);
2400 if (f_v) {
2401 cout << "isomorph::read_everything_including_classification after Reps->load" << endl;
2402 }
2403
2404 if (f_v) {
2405 cout << "isomorph::read_everything_including_"
2406 "classification done" << endl;
2407 }
2408}
2409
2410}}
2411
2412
a catch-all container class for everything related to data structures
void distribution(int *v, int len_v, int *&val, int *&mult, int &len)
Definition: int_vec.cpp:387
a collection of functions related to sorted vectors
void int_vec_print_classified(std::ostream &ost, int *vec, int len)
Definition: sorting.cpp:1593
void int_vec_heapsort_with_log(int *v, int *w, int len)
Definition: sorting.cpp:1967
functions related to strings and character arrays
void chop_off_extension_if_present(std::string &p, const char *ext)
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
void int_vec_write_csv(int *v, int len, std::string &fname, const char *label)
Definition: file_io.cpp:1175
void int_vecs_write_csv(int *v1, int *v2, int len, std::string &fname, const char *label1, const char *label2)
Definition: file_io.cpp:1207
void int_matrix_read_csv(std::string &fname, int *&M, int &m, int &n, int verbose_level)
Definition: file_io.cpp:1477
void count_number_of_solutions_in_file_by_case(std::string &fname, int *&nb_solutions, int *&case_nb, int &nb_cases, int verbose_level)
Definition: file_io.cpp:731
void read_solutions_from_file(std::string &fname, int &nb_solutions, int *&Solutions, int solution_size, int verbose_level)
Definition: file_io.cpp:907
void count_number_of_solutions_in_file(std::string &fname, int &nb_solutions, int verbose_level)
Definition: file_io.cpp:671
void read_solutions_from_file_by_case(std::string &fname, int *nb_solutions, int *case_nb, int nb_cases, int **&Solutions, int solution_size, int verbose_level)
Definition: file_io.cpp:1037
domain to compute with objects of type longinteger
Definition: ring_theory.h:240
void add(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
Definition: ring_theory.h:366
void create(long int i, const char *file, int line)
DISCRETA vector class for vectors of DISCRETA objects.
Definition: discreta.h:797
a permutation group in a fixed action.
Definition: actions.h:99
void element_print_latex(void *elt, std::ostream &ost)
Definition: action_cb.cpp:364
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
void compute_all_point_orbits(groups::schreier &S, data_structures_groups::vector_ge &gens, int verbose_level)
Definition: action.cpp:995
void group_order(ring_theory::longinteger_object &go)
Definition: action.cpp:2223
action * create_induced_action_by_restriction(groups::sims *S, int size, long int *set, int f_induce, int verbose_level)
int find_fixed_points(void *elt, int *fixed_points, int verbose_level)
Definition: action.cpp:579
Schreier trees for orbits of groups on points.
Definition: groups.h:839
a permutation group represented via a stabilizer chain
Definition: groups.h:1273
void group_order(ring_theory::longinteger_object &go)
Definition: sims.cpp:951
data_structures_groups::vector_ge gens
Definition: groups.h:1280
void element_unrank_lint(long int rk, int *Elt, int verbose_level)
Definition: sims.cpp:1326
void init_cases_from_file_modulus_and_build_up_database(int modulus, int level, int f_collated, int base_split, int f_get_statistics, int f_has_final_test_function, int(*final_test_function)(long int *data, int sz, void *final_test_data, int verbose_level), void *final_test_data, int verbose_level)
void add_solution_to_database(long int *data, int nb, int id, int no, int nb_solutions, int h, uint_4 &datref, int print_mod, int verbose_level)
void write_hash_and_datref_file(int verbose_level)
void read_solutions_from_clique_finder(int nb_files, std::string *fname, int verbose_level)
void init_starter_number(int verbose_level)
Definition: isomorph.cpp:462
void add_solutions_to_database(int *Solutions, int the_case, int nb_solutions, int nb_solutions_total, int print_mod, int &no, int verbose_level)
void setup_and_open_solution_database(int verbose_level)
void count_solutions_from_clique_finder_case_by_case(int nb_files, long int *list_of_cases, std::string *fname, int verbose_level)
void build_up_database(int nb_files, std::string *fname, int f_has_final_test_function, int(*final_test_function)(long int *data, int sz, void *final_test_data, int verbose_level), void *final_test_data, int verbose_level)
void induced_action_on_set_and_kernel(std::ostream &file, actions::action *A, groups::sims *Stab, int size, long int *set, int verbose_level)
void event_file_read_case(const char *event_file_name, int case_no, int verbose_level)
void skip_through_event_file(std::ifstream &f, int verbose_level)
void read_starter_nb_orbits(int verbose_level)
void read_data_files_for_starter(int level, std::string &prefix, int verbose_level)
Definition: isomorph.cpp:1514
void read_everything_including_classification(std::string &prefix_classify, int verbose_level)
void load_solution(int id, long int *data)
void init_solution(int verbose_level)
Definition: isomorph.cpp:418
void induced_action_on_set(groups::sims *S, long int *set, int verbose_level)
void read_event_file(const char *event_file_name, int verbose_level)
void read_hash_and_datref_file(int verbose_level)
void event_file_completed_cases(const char *event_file_name, int &nb_completed_cases, int *completed_cases, int verbose_level)
poset_classification::poset_classification * gen
Definition: isomorph.h:122
void print_isomorphism_types(int f_select, int select_first, int select_len, int verbose_level)
void(* print_set_function)(isomorph *Iso, int iso_cnt, groups::sims *Stab, groups::schreier &Orb, long int *data, void *print_set_data, int verbose_level)
Definition: isomorph.h:299
void write_starter_nb_orbits(int verbose_level)
void setup_and_create_solution_database(int verbose_level)
void handle_event_files(int nb_event_files, const char **event_file_name, int verbose_level)
void count_solutions2(int nb_files, std::string *fname, int &total_days, int &total_hours, int &total_minutes, int f_has_final_test_function, int(*final_test_function)(long int *data, int sz, void *final_test_data, int verbose_level), void *final_test_data, int verbose_level)
void init_solutions(int **Solutions, int *Nb_sol, int verbose_level)
void load_table_of_solutions(int verbose_level)
Definition: isomorph.cpp:433
void init_cases_from_file_mixed_modulus_and_build_up_database(int nb_Mod, int *Mod_r, int *Mod_split, int *Mod_base_split, int level, int f_get_statistics, int f_has_final_test_function, int(*final_test_function)(long int *data, int sz, void *final_test_data, int verbose_level), void *final_test_data, int verbose_level)
void event_file_read_case1(std::ifstream &f, int case_no, int verbose_level)
void get_statistics(int nb_files, std::string *fname, int verbose_level)
void count_solutions_from_clique_finder(int nb_files, std::string *fname, int verbose_level)
void read_solutions_from_clique_finder_case_by_case(int nb_files, long int *list_of_cases, std::string *fname, int verbose_level)
void skip_through_event_file1(std::ifstream &f, int case_no, int orbit_no, int verbose_level)
int next_subset_play_back(int &subset_rank, std::ifstream *play_back_file, int &f_eof, int verbose_level)
void count_solutions(int nb_files, std::string *fname, int f_get_statistics, int f_has_final_test_function, int(*final_test_function)(long int *data, int sz, void *final_test_data, int verbose_level), void *final_test_data, int verbose_level)
#define MINIMUM(x, y)
Definition: foundations.h:216
#define FREE_int(p)
Definition: foundations.h:640
#define Int_vec_zero(A, B)
Definition: foundations.h:713
#define NEW_char(n)
Definition: foundations.h:632
#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
unsigned int uint_4
Definition: foundations.h:184
#define FREE_lint(p)
Definition: foundations.h:642
#define NEW_lint(n)
Definition: foundations.h:628
#define FREE_pint(p)
Definition: foundations.h:641
#define Int_vec_print(A, B, C)
Definition: foundations.h:685
#define MAXIMUM(x, y)
Definition: foundations.h:217
#define MY_BUFSIZE
orbiter_kernel_system::orbiter_session * Orbiter
global Orbiter session
the orbiter library for the classification of combinatorial objects