22namespace layer4_classification {
24#define MY_BUFSIZE 1000000
30 int f_v = (verbose_level >= 1);
36 cout <<
"isomorph::init_solutions "
48 cout <<
"isomorph::init_solutions N = " <<
N << endl;
55 cout <<
"isomorph::init_solutions "
56 "solution_first[nb_starter] != N" << endl;
62 cout <<
"isomorph::init_solutions "
63 "after init_starter_number" << endl;
68 cout <<
"isomorph::init_solutions "
69 "after write_solution_first_and_len" << endl;
85 cout <<
"isomorph::init_solutions "
86 "before add_solutions_to_database" << endl;
99 cout <<
"isomorph::init_solutions "
100 "written hash and datref file" << endl;
101 cout <<
"isomorph::init_solutions "
102 "sorting hash_vs_id_hash" << endl;
108 cout <<
"isomorph::init_solutions "
109 "Classification of hash values:" << endl;
114 cout <<
"isomorph::init_solutions "
115 "after sorting hash_vs_id_hash" << endl;
123 cout <<
"isomorph::init_solutions done" << endl;
128 int nb_files,
long int *list_of_cases, std::string *fname,
132 int f_v = (verbose_level >= 1);
133 int f_vv = (verbose_level >= 2);
138 cout <<
"isomorph::count_solutions_from_clique_finder_case_by_case "
139 "nb_starter = " <<
nb_starter <<
" nb_files=" << nb_files << endl;
146 for (i = 0; i < nb_files; i++) {
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;
160 h = list_of_cases[i];
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;
179 cout <<
"isomorph::count_solutions_from_clique_finder_"
180 "case_by_case solution_first[nb_starter] != N" << endl;
186 cout <<
"isomorph::count_solutions_from_clique_finder_"
187 "case_by_case after init_starter_number" << endl;
192 cout <<
"isomorph::count_solutions_from_clique_finder_"
193 "case_by_case after write_solution_first_and_len" << endl;
200 int nb_files, std::string *fname,
int verbose_level)
203 int f_v = (verbose_level >= 1);
204 int f_vv = (verbose_level >= 2);
209 cout <<
"isomorph::count_solutions_from_clique_finder "
220 for (i = 0; i < nb_files; i++) {
226 nb_solutions, case_nb, nb_cases,
230 cout <<
"isomorph::count_solutions_from_clique_finder "
231 "file " << i <<
" / " << nb_files <<
" = " << fname[i]
232 <<
" read, nb_cases=" << nb_cases << endl;
235 for (h = 0; h < nb_cases; h++) {
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;
258 cout <<
"isomorph::count_solutions_from_clique_finder "
259 "solution_first[nb_starter] != N" << endl;
265 cout <<
"isomorph::count_solutions_from_clique_finder "
266 "after init_starter_number" << endl;
271 cout <<
"isomorph::count_solutions_from_clique_finder "
272 "after write_solution_first_and_len" << endl;
279 int nb_files,
long int *list_of_cases, std::string *fname,
285 int f_v = (verbose_level >= 1);
286 int f_vv = (verbose_level >= 2);
291 int print_mod = 1000;
295 cout <<
"isomorph::read_solutions_from_clique_finder_"
296 "case_by_case nb_files=" << nb_files
297 <<
" N=" <<
N << endl;
304 cout <<
"isomorph::read_solutions_from_clique_finder_"
305 "case_by_case after setup_and_create_solution_"
314 for (i = 0; i < nb_files; i++) {
317 cout <<
"isomorph::read_solutions_from_clique_finder_"
318 "case_by_case, file " << i <<
" / " << nb_files
319 <<
" which is " << fname[i] << endl;
330 cout <<
"isomorph::read_solutions_from_clique_finder_"
331 "case_by_case file " << fname[i] <<
" number of "
332 "solutions read: " << nb_solutions << endl;
336 list_of_cases[i], nb_solutions,
N, print_mod, no,
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;
355 cout <<
"isomorph::read_solutions_from_clique_finder_case_by_case "
356 "Classification of hash values:" << endl;
361 cout <<
"isomorph::read_solutions_from_clique_finder_case_by_case "
362 "after sorting hash_vs_id_hash" << endl;
369 cout <<
"isomorph::read_solutions_from_clique_finder_case_by_case "
376 int nb_files, std::string *fname,
382 int f_v = (verbose_level >= 1);
383 int f_vv = (verbose_level >= 2);
388 int print_mod = 1000;
394 cout <<
"isomorph::read_solutions_from_clique_finder "
395 "nb_files=" << nb_files <<
" N=" <<
N << endl;
404 cout <<
"isomorph::read_solutions_from_clique_finder "
405 "after setup_and_create_solution_database" << endl;
413 for (i = 0; i < nb_files; i++) {
416 cout <<
"isomorph::read_solutions_from_clique_finder "
417 "file " << fname[i] << endl;
424 int nb_solutions_total;
425 string fname_summary;
429 fname_summary.assign(fname[i]);
431 fname_summary.append(
"_summary.csv");
434 nb_solutions, case_nb, nb_cases,
439 fname_summary,
"Case_nb",
"Nb_sol");
441 nb_solutions_total = 0;
442 for (h = 0; h < nb_cases; h++) {
443 nb_solutions_total += nb_solutions[h];
447 nb_solutions, case_nb, nb_cases,
452 cout <<
"isomorph::read_solutions_from_clique_finder "
453 "file " << fname[i] <<
" read solutions" << endl;
456 for (h = 0; h < nb_cases; h++) {
457 the_case = case_nb[h];
460 the_case, nb_solutions[h], nb_solutions_total,
468 for (h = 0; h < nb_cases; h++) {
473 cout <<
"isomorph::read_solutions_from_clique_finder "
474 "file " << fname[i] <<
" done" << endl;
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;
490 cout <<
"isomorph::read_solutions_from_clique_finder "
491 "Classification of hash values:" << endl;
496 cout <<
"isomorph::read_solutions_from_clique_finder "
497 "after sorting hash_vs_id_hash" << endl;
505 cout <<
"isomorph::read_solutions_from_clique_finder done" << endl;
510 int the_case,
int nb_solutions,
int nb_solutions_total,
511 int print_mod,
int &no,
514 int f_v = (verbose_level >= 1);
516 int f_vvv = (verbose_level >= 3);
522 cout <<
"isomorph::add_solutions_to_database "
523 "case " << the_case << endl;
526 for (u = 0; u < nb_solutions; u++) {
533 data[1 +
v] = Solutions[u *
size +
v];
539 cout <<
"isomorph::add_solutions_to_database "
540 "case " << the_case <<
" u=" << u <<
" id=" <<
id
541 <<
" hs=" << hs <<
" no=" << no << endl;
546 u,
id, no, nb_solutions_total, hs, datref,
547 print_mod, verbose_level - 2);
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;
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,
576 int f_v = (verbose_level >= 1);
578 int f_vvv = (verbose_level >= 3);
580 int i, nb_total = 0, j, a, nb = 0, prev = 0,
id = 0, h;
584 int print_mod = 1000;
593 cout <<
"isomorph::build_up_database "
594 "nb_files=" << nb_files <<
" N=" <<
N << endl;
602 cout <<
"isomorph::build_up_database "
603 "after setup_and_create_solution_database" << endl;
611 for (i = 0; i < nb_files; i++) {
613 ifstream f(fname[i]);
615 cout <<
"isomorph::build_up_database "
616 "reading file " << fname[i] <<
" of size "
633 cout <<
"isomorph::build_up_database "
634 "read line of length " << l <<
" : " << S << endl;
636 for (j = 0; j < l; j++) {
647 cout <<
"isomorph::build_up_database "
648 "read: " << buf << endl;
658 if (data[0] != prev) {
666 for (j = 0; j <
size; j++) {
672 if (f_has_final_test_function) {
673 if (!(*final_test_function)(data + 1,
size,
674 final_test_data, verbose_level - 1)) {
676 cout <<
"isomorph::build_up_database "
677 "solution fails the final test, "
684 cout << nb_total <<
" : " << data[0] <<
" : ";
696 nb,
id, nb_total,
N, h, datref, print_mod,
708 cout <<
"isomorph::build_up_database "
709 "finished reading file " << fname[i]
710 <<
" nb=" << nb <<
" nb_total=" << nb_total << endl;
716 cout <<
"isomorph::build_up_database finished "
717 "number of solutions total = " << nb_total
718 <<
" nb_fail = " << nb_fail << endl;
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;
733 cout <<
"isomorph::build_up_database "
734 "Classification of hash values:" << endl;
739 cout <<
"isomorph::build_up_database "
740 "after sorting hash_vs_id_hash" << endl;
745 cout <<
"isomorph::build_up_database done" << endl;
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,
760 int f_v = (verbose_level >= 1);
761 int f_vv = (verbose_level >= 2);
764 char file_name[1000];
767 cout <<
"isomorph::init_cases_from_file_modulus_"
768 "and_build_up_database modulus = " << modulus << endl;
770 fname =
new string [modulus];
772 cout <<
"creating file names" << endl;
774 for (i = 0; i < modulus; i++) {
776 sprintf(file_name,
"collated_%s_%d_%d_%d_%d.txt",
780 sprintf(file_name,
"extend_%s_%d_%d_%d.txt",
785 fname[i] =
NEW_char(strlen(file_name) + 1);
786 fname[i].assign(file_name);
789 for (i = 0; i < modulus; i++) {
790 cout << i <<
" : " << fname[i] << endl;
796 f_has_final_test_function,
807 f_has_final_test_function,
813 cout <<
"deleting file names" << endl;
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,
827 int f_v = (verbose_level >= 1);
828 int f_vv = (verbose_level >= 2);
830 int i, r, s, bs, nb_files, j, k, h, u;
831 char file_name[1000];
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;
841 cout <<
"computing the number of files" << endl;
844 for (i = 0; i < nb_Mod; i++) {
847 bs = Mod_base_split[i];
851 cout <<
"number of files is " << nb_files << endl;
854 fname =
new string [nb_files];
856 cout <<
"creating file names" << endl;
859 for (i = 0; i < nb_Mod; i++) {
862 bs = Mod_base_split[i];
864 for (h = 0; h < k; h++) {
866 sprintf(file_name,
"extend_%s_%d_%d_%d.txt",
870 fname[j].assign(file_name);
875 cout <<
"isomorph::init_cases_from_file_mixed_modulus_"
876 "and_build_up_database j != nb_files" << endl;
880 for (i = 0; i < nb_files; i++) {
881 cout << i <<
" : " << fname[i] << endl;
888 f_has_final_test_function,
897 f_has_final_test_function,
903 cout <<
"deleting file names" << endl;
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,
916 int f_v = (verbose_level >= 1);
918 int total_days, total_hours, total_minutes;
921 cout <<
"isomorph::count_solutions "
922 "nb_starter == 0" << endl;
926 cout <<
"isomorph::count_solutions "
948 total_days, total_hours, total_minutes,
949 f_has_final_test_function,
954 cout <<
"isomorph::count_solutions "
955 "after count_solutions2" << endl;
956 cout <<
"case_len: ";
960 cout <<
"total computing time for the search : ";
961 cout << total_days <<
"-" << total_hours <<
":"
962 << total_minutes <<
":" << 0;
965 cout <<
"case : nb of solutions" << endl;
975 cout <<
"isomorph::count_solutions N=" <<
N << endl;
980 cout <<
"isomorph::count_solutions "
981 "after init_starter_number" << endl;
986 cout <<
"isomorph::count_solutions "
987 "after write_solution_first_and_len" << endl;
990 if (f_get_statistics) {
998 std::string *fname,
int verbose_level)
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);
1005 string fname_summary;
1009 cout <<
"get_statistics: reading "
1010 << nb_files <<
" files" << endl;
1013 for (i = 0; i < nb_files; i++) {
1014 cout << fname[i] << endl;
1019 for (i = 0; i < nb_files; i++) {
1022 fname_summary.assign(fname[i]);
1026 if (strcmp(fname_summary + strlen(fname_summary) - 4,
".txt")) {
1027 cout <<
"get_statistics: file name does not end in .txt" << endl;
1030 strcpy(fname_summary + strlen(fname_summary) - 4,
".summary");
1033 ifstream fp(fname_summary);
1036 cout <<
"file " << i <<
" / " << nb_files
1037 <<
", reading file " << fname_summary
1038 <<
" of size " << Fio.
file_size(fname[i]) << endl;
1040 if (Fio.
file_size(fname_summary) <= 0) {
1041 cout <<
"problems reading file " << fname_summary << endl;
1050 fp >> nb_backtrack_decision;
1077 f << setw(7) << i <<
" "
1091 int f_v = (verbose_level >= 1);
1093 int nb_backtrack_max;
1094 int nb_backtrack_min;
1099 ring_theory::longinteger_object a, b, c, a1, b1, c1, d, n, q1, q2, q3, r1, r2, r3;
1106 a.
create(0, __FILE__, __LINE__);
1107 b.
create(0, __FILE__, __LINE__);
1108 c.
create(0, __FILE__, __LINE__);
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;
1147 cout <<
"average nb_backtrack = " << q1 << endl;
1148 cout <<
"average graph_size = " << q2 << endl;
1149 cout <<
"average time = " << q3 << endl;
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,
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;
1172 long int data[1000];
1173 int *nb_sol_per_file;
1181 cout <<
"count_solutions2: reading " << nb_files <<
" files" << endl;
1182 cout <<
"verbose_level = " << verbose_level << endl;
1184 for (i = 0; i < nb_files; i++) {
1185 cout << fname[i] << endl;
1193 nb_sol_per_file =
NEW_int(nb_files);
1195 for (i = 0; i < nb_files; i++) {
1197 nb_sol_per_file[i] = 0;
1199 ifstream f(fname[i]);
1200 cout <<
"reading file " << fname[i] <<
" of size "
1203 cout <<
"problems reading file " << fname[i] << endl;
1219 for (j = 0; j < l; j++) {
1225 cout <<
"line " << no <<
" read: " << buf << endl;
1236 if (data[0] == -1) {
1239 cout <<
"isomorph::count_solutions2 "
1240 "solution_len[" << prev <<
"]=" << nb << endl;
1246 for (j = 0; j <
size; j++) {
1252 if (f_has_final_test_function) {
1253 if (!(*final_test_function)(data + 1,
size,
1254 final_test_data, verbose_level - 1)) {
1256 cout <<
"isomorph::count_solutions2 "
1257 "solution fails the final test, "
1266 if (data[0] != prev) {
1270 cout <<
"isomorph::count_solutions "
1271 "solution_len[" << prev <<
"]="
1278 nb_sol_per_file[i]++;
1283 cout <<
"file " << fname[i] <<
" has " << nb_sol_per_file[i]
1284 <<
" lines and " << nb <<
" solutions and " << nb_fail
1285 <<
" false positives" << endl;
1288 cout <<
"file " << fname[i] <<
" time " << str << endl;
1294 cout <<
"isomorph::count_solutions2 done" << endl;
1318 cout <<
"isomorph::read_solution_first_and_len "
1319 "reading from file "
1339 cout <<
"problem in read_solution_first_and_len" << endl;
1342 cout <<
"isomorph::read_solution_first_and_len:" << endl;
1345 cout <<
"isomorph::read_solution_first_and_len done" << endl;
1350 int f_v = (verbose_level >= 1);
1355 cout <<
"isomorph::write_starter_nb_orbits" << endl;
1361 cout <<
"isomorph::write_starter_nb_orbits Written file "
1366 cout <<
"isomorph::write_starter_nb_orbits done" << endl;
1372 int f_v = (verbose_level >= 1);
1377 cout <<
"isomorph::read_starter_nb_orbits" << endl;
1382 cout <<
"isomorph::read_starter_nb_orbits Reading file "
1387 M, m, n, verbose_level);
1390 cout <<
"isomorph::read_starter_nb_orbits "
1391 "m != nb_starter" << endl;
1395 cout <<
"isomorph::read_starter_nb_orbits "
1403 for (i = 0; i < m; i++) {
1412 cout <<
"isomorph::read_starter_nb_orbits done" << endl;
1421 int f_v = (verbose_level >= 1);
1425 cout <<
"isomorph::write_hash_and_datref_file" << endl;
1432 for (i = 0; i <
N; i++) {
1433 f << setw(3) << i <<
" "
1440 cout <<
"isomorph::write_hash_and_datref_file finished" << endl;
1441 cout <<
"isomorph::write_hash_and_datref_file written file "
1453 int f_v = (verbose_level >= 1);
1454 int f_vv = (verbose_level >= 5);
1458 cout <<
"isomorph::read_hash_and_datref_file" << endl;
1461 int id, a, h, d, N1;
1464 cout <<
"isomorph::read_hash_and_datref_file "
1466 cout <<
"N=" <<
N << endl;
1467 cout <<
"N1=" << N1 << endl;
1476 for (
id = 0;
id <
N;
id++) {
1479 cout <<
"isomorph::read_hash_and_datref_file "
1490 cout <<
"isomorph::read_hash_and_datref_file "
1491 "EOF marker missing" << endl;
1497 cout <<
"isomorph::read_hash_and_datref_file" << endl;
1502 cout <<
"isomorph::read_hash_and_datref_file done" << endl;
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++) {
1521 int f_v = (verbose_level >= 1);
1525 cout <<
"write_orbit_data" << endl;
1533 f << setw(3) << i <<
" "
1537 for (i = 0; i <
N; i++) {
1538 f << setw(3) << i <<
" "
1548 cout <<
"write_orbit_data finished" << endl;
1565 int f_v = (verbose_level >= 1);
1572 cout <<
"read_orbit_data" << endl;
1576 cout <<
"nb_orbits=" <<
nb_orbits << endl;
1577 cout <<
"N=" <<
N << endl;
1593 for (i = 0; i <
N; i++) {
1604 cout <<
"problem in read_orbit_data" << endl;
1608 cout <<
"read_orbit_data finished" << endl;
1613 int select_first,
int select_len,
1617 int f_v = (verbose_level >= 1);
1618 int h, i, j, id, first, c;
1622 cout <<
"isomorph::print_isomorphism_types" << endl;
1624 cout <<
"printing " << select_first <<
" / "
1625 << select_len << endl;
1628 cout <<
"we found " <<
Reps->
count <<
" isomorphism types" << endl;
1629 cout <<
"i : orbit_no : id of orbit representative (solution) : "
1630 "prefix case number" << endl;
1636 cout <<
"isomorphism type " << i <<
" : " << j <<
" : "
1637 <<
id <<
" : " << c;
1640 cout <<
" stabilizer order " << go << endl;
1647 long int data[1000];
1655 for (h = 0; h < select_len; h++) {
1657 i = select_first + h;
1661 cout <<
"isomorphism type " << i <<
" : " << j <<
" : "
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);
1680 cout <<
"isomorph::print_isomorphism_types computing "
1681 "induced action on the set (in data)" << endl;
1689 cout <<
"action " <<
AA->
label <<
" computed, "
1690 "group order is " << go << endl;
1697 cout <<
"Computed all orbits on the set, found "
1699 cout <<
"orbit lengths: ";
1705 cout <<
"isomorph::print_isomorphism_types "
1706 "calling print_set_function, "
1707 "iso_cnt=" << i + 1 << endl;
1709 (*print_set_function)(
this, i + 1, Stab,
1712 cout <<
"isomorph::print_isomorphism_types "
1713 "after print_set_function, "
1714 "iso_cnt=" << i + 1 << endl;
1723 groups::sims *Stab,
int size,
long int *set,
int verbose_level)
1726 int f_v = (verbose_level >= 1);
1736 cout <<
"isomorph::induced_action_on_set_and_kernel "
1737 "calling induced_action_by_restriction" << endl;
1743 int f_induce_action =
TRUE;
1752 cout <<
"isomorph::induced_action_on_set_and_kernel: "
1753 "after induced_action_by_restriction" << endl;
1758 file << endl <<
"\\bigskip" << endl
1759 <<
"The induced group has order "
1760 << go <<
" and is generated by:" << endl << endl;
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;
1766 file <<
"$g_{" << setw(2) << i + 1 <<
"} = $";
1769 f_do_it_anyway_even_for_big_degree,
1770 f_print_cycles_of_length_one,
1772 file <<
"\\\\" << endl;
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;
1781 file <<
"$a_{" << setw(2) << i + 1 <<
"} = $";
1784 f_do_it_anyway_even_for_big_degree,
1785 f_print_cycles_of_length_one,
1787 file <<
"\\\\" << endl;
1789 file <<
"and now the elements themselves:" << endl;
1790 for (i = 0; i < go.
as_lint(); i++) {
1802 file <<
"$a_{" << setw(2) << i + 1 <<
"} = $" << endl;
1805 file <<
"$ with " << n <<
" fixed points\\\\" << endl;
1811 cout <<
"isomorph::induced_action_on_set_and_kernel: "
1812 "printing kernel generators" << endl;
1815 file <<
"Kernel has order " << ko
1816 <<
" and is generated by:\\\\" << endl;
1818 file <<
"$$ b_{" << setw(2) << i + 1 <<
"} = " << endl;
1820 file <<
"$$" << endl;
1823 file <<
"\\\\" << endl;
1830 int *val, *mult, len;
1832 file <<
"The kernel has $" << Orb.
nb_orbits
1833 <<
"$ orbits on the quadric.\\\\" << endl;
1836 file <<
"The orbit length are $[";
1837 for (i = len - 1; i >= 0; i--) {
1840 file <<
"^{" << mult[i] <<
"}";
1845 file <<
"]$\\\\" << endl;
1848 int min_length, min_idx;
1854 if (min_idx == -1) {
1865 induced_action_on_orbit(file, AAA.
Kernel->
A,
1866 AAA.
Kernel, Orb, min_idx, verbose_level);
1876 file <<
"\\bigskip" << endl << endl;
1884 const char **event_file_name,
int verbose_level)
1889 for (i = 0; i < nb_event_files; i++) {
1892 cout <<
"after reading " << nb_event_files
1893 <<
" event files, isomorph_cnt = "
1902 int nb_completed_cases, *completed_cases;
1904 completed_cases =
NEW_int(10000);
1906 nb_completed_cases, completed_cases, verbose_level);
1907 cout <<
"file " << event_file_name <<
" holds "
1908 << nb_completed_cases <<
" completed cases: ";
1911 for (i = 0; i < nb_completed_cases; i++) {
1913 completed_cases[i], verbose_level);
1916 completed_cases[nb_completed_cases - 1] + 1);
1919#define MY_BUFSIZE 1000000
1922 ifstream &f,
int verbose_level)
1930 cout <<
"isomorph::skip_through_event_file" << endl;
1941 for (j = 0; j < l; j++) {
1946 if (strncmp(buf,
"-1", 2) == 0) {
1952 if (strncmp(buf,
"BEGIN", 5) == 0) {
1957 cout <<
"located isomorphism type "
1958 << case_no <<
" in event file" << endl;
1959 cout <<
"buf=" << buf << endl;
1965 cout <<
"it belongs to orbit_no " <<
orbit_no << endl;
1974 cout <<
"isomorph::skip_through_event_file done" << endl;
1978 int case_no,
int orbit_no,
int verbose_level)
1980 int l, j, from_orbit, to_orbit, rank_subset;
1996 for (j = 0; j < l; j++) {
2003 if (strncmp(buf,
"END", 3) == 0) {
2004 cout <<
"isomorphism type " << case_no
2005 <<
" has been read from event file" << endl;
2012 if (strcmp(token,
"F") == 0) {
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;
2025 Reps->
rep[case_no] = from_orbit;
2030 else if (strcmp(token,
"A") == 0) {
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;
2043 Reps->
rep[case_no] = from_orbit;
2047 else if (strcmp(token,
"AF") == 0) {
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;
2061 Reps->
rep[case_no] = from_orbit;
2065 else if (strcmp(token,
"O") == 0) {
2077 const char *event_file_name,
2078 int &nb_completed_cases,
int *completed_cases,
2084 ifstream f(event_file_name);
2088 nb_completed_cases = 0;
2098 for (j = 0; j < l; j++) {
2105 if (strncmp(buf,
"END", 3) == 0) {
2110 cout <<
"isomorphism type " << a
2111 <<
" has been completed" << endl;
2112 completed_cases[nb_completed_cases++] = a;
2119 const char *event_file_name,
int case_no,
2126 ifstream f(event_file_name);
2138 for (j = 0; j < l; j++) {
2145 if (strncmp(buf,
"BEGIN", 5) == 0) {
2151 cout <<
"located isomorphism type " << a
2152 <<
" in event file" << endl;
2159 cout <<
"did not find case " << case_no <<
" in event file "
2160 << event_file_name << endl;
2165 int case_no,
int verbose_level)
2167 int l, j, from_orbit, to_orbit, rank_subset;
2183 for (j = 0; j < l; j++) {
2190 if (strncmp(buf,
"END", 3) == 0) {
2191 cout <<
"isomorphism type " << case_no
2192 <<
" has been read from event file" << endl;
2198 if (strcmp(token,
"F") == 0) {
2203 Reps->
rep[case_no] = from_orbit;
2207 else if (strcmp(token,
"A") == 0) {
2212 Reps->
rep[case_no] = from_orbit;
2215 else if (strcmp(token,
"AF") == 0) {
2221 Reps->
rep[case_no] = from_orbit;
2228#define MY_BUFSIZE 1000000
2231 ifstream *play_back_file,
2232 int &f_eof,
int verbose_level)
2234 int f_v = (verbose_level >= 3);
2243 if (play_back_file->eof()) {
2244 cout <<
"end of file reached" << endl;
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;
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;
2262 if (strncmp(buf,
"-1", 2) == 0) {
2263 cout <<
"end of file marker -1 reached" << endl;
2267 if (strncmp(buf,
"END-EOF", 7) == 0) {
2268 cout <<
"END-EOF reached" << endl;
2272 if (strncmp(buf,
"END", 3) == 0) {
2273 cout <<
"END reached" << endl;
2277 cout <<
"parsing: " << buf << endl;
2284 cout <<
"rank = " << rank << endl;
2289 cout <<
"rank is equal to subset_rank, "
2290 "so we proceed" << endl;
2297 cout <<
"rank is less than subset_rank, "
2298 "something is wrong" << endl;
2312 std::string &prefix_classify,
int verbose_level)
2314 int f_v = (verbose_level >= 1);
2318 cout <<
"isomorph::read_everything_including_classification" << endl;
2323 cout <<
"isomorph::read_everything_including_classification before read_data_files_for_starter" << endl;
2326 prefix_classify, verbose_level - 1);
2328 cout <<
"isomorph::read_everything_including_classification after read_data_files_for_starter" << endl;
2332 cout <<
"isomorph::read_everything_including_classification before init_solution" << endl;
2336 cout <<
"isomorph::read_everything_including_classification after init_solution" << endl;
2340 cout <<
"isomorph::read_everything_including_classification before load_table_of_solutions" << endl;
2344 cout <<
"isomorph::read_everything_including_classification after load_table_of_solutions" << endl;
2348 cout <<
"isomorph::read_everything_including_classification before read_orbit_data" << endl;
2352 cout <<
"isomorph::read_everything_including_classification after read_orbit_data" << endl;
2358 cout <<
"isomorph::read_everything_including_classification before gen->recreate_schreier_vectors_up_to_level" << endl;
2363 cout <<
"isomorph::read_everything_including_classification after gen->recreate_schreier_vectors_up_to_level" << endl;
2368 for (i = 0; i <=
level + 1; i++) {
2369 cout <<
"gen->first_node_at_level[" << i
2377 cout <<
"isomorph::read_everything_including_classification before iso_test_init" << endl;
2381 cout <<
"isomorph::read_everything_including_classification after iso_test_init" << endl;
2389 cout <<
"isomorph::read_everything_including_classification before read_starter_nb_orbits" << endl;
2393 cout <<
"isomorph::read_everything_including_classification after read_starter_nb_orbits" << endl;
2397 cout <<
"isomorph::read_everything_including_classification before Reps->load" << endl;
2401 cout <<
"isomorph::read_everything_including_classification after Reps->load" << endl;
2405 cout <<
"isomorph::read_everything_including_"
2406 "classification done" << endl;
a collection of combinatorial functions
void perm_inverse(int *a, int *b, long int n)
void unrank_k_subset(int rk, int *set, int n, int k)
int rank_k_subset(int *set, int n, int k)
a catch-all container class for everything related to data structures
int lint_vec_hash_after_sorting(long int *data, int len)
void distribution(int *v, int len_v, int *&val, int *&mult, int &len)
a collection of functions related to sorted vectors
void int_vec_print_classified(std::ostream &ost, int *vec, int len)
void int_vec_heapsort_with_log(int *v, int *w, int len)
a statistical analysis of data consisting of single integers
void init(int *data, int data_length, int f_second, int verbose_level)
void print(int f_backwards)
a collection of functions related to file io
void int_vec_write_csv(int *v, int len, std::string &fname, const char *label)
void int_vecs_write_csv(int *v1, int *v2, int len, std::string &fname, const char *label1, const char *label2)
void int_matrix_read_csv(std::string &fname, int *&M, int &m, int &n, int verbose_level)
void count_number_of_solutions_in_file_by_case(std::string &fname, int *&nb_solutions, int *&case_nb, int &nb_cases, int verbose_level)
long int file_size(std::string &fname)
void read_solutions_from_file(std::string &fname, int &nb_solutions, int *&Solutions, int solution_size, int verbose_level)
void count_number_of_solutions_in_file(std::string &fname, int &nb_solutions, int verbose_level)
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)
data_structures::int_vec * Int_vec
domain to compute with objects of type longinteger
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
int compare_with_int(int a)
void assign_to(longinteger_object &b)
void create(long int i, const char *file, int line)
DISCRETA vector class for vectors of DISCRETA objects.
a permutation group in a fixed action.
void element_print_latex(void *elt, std::ostream &ost)
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)
void compute_all_point_orbits(groups::schreier &S, data_structures_groups::vector_ge &gens, int verbose_level)
void group_order(ring_theory::longinteger_object &go)
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)
Schreier trees for orbits of groups on points.
a permutation group represented via a stabilizer chain
void group_order(ring_theory::longinteger_object &go)
data_structures_groups::vector_ge gens
void element_unrank_lint(long int rk, int *Elt, int verbose_level)
void evaluate_statistics(int verbose_level)
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_orbit_data(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)
void write_orbit_data(int verbose_level)
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 read_solution_first_and_len()
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 iso_test_init(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)
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)
void induced_action_on_set(groups::sims *S, long int *set, int verbose_level)
std::string fname_staborbits
void read_event_file(const char *event_file_name, int verbose_level)
void write_solution_first_and_len()
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
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)
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)
std::string fname_hash_and_datref
std::string fname_orbits_of_stabilizer_csv
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)
std::ofstream * fp_event_out
void init_solutions(int **Solutions, int *Nb_sol, int verbose_level)
std::string fname_case_len
void load_table_of_solutions(int verbose_level)
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)
std::string fname_statistics
void close_solution_database(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)
int * stats_nb_backtrack_decision
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)
actions::action * get_A2()
int first_node_at_level(int i)
void recreate_schreier_vectors_up_to_level(int lvl, int verbose_level)
void print_fusion_statistics()
void calc_fusion_statistics()
void load(int verbose_level)
#define Int_vec_zero(A, B)
#define Lint_vec_print(A, B, C)
#define Int_vec_print(A, B, C)
orbiter_kernel_system::orbiter_session * Orbiter
global Orbiter session
the orbiter library for the classification of combinatorial objects