Orbiter 2022
Combinatorial Objects
isomorph_global.cpp
Go to the documentation of this file.
1// isomorph_global.cpp
2//
3// Anton Betten
4// started Aug 1, 2012
5//
6//
7//
8//
9
11#include "discreta/discreta.h"
14
15using namespace std;
16
17namespace orbiter {
18namespace layer4_classification {
19
20
21static void callback_compute_down_orbits_worker(
22 isomorph *Iso, void *data, int verbose_level);
23
24
26{
27 A_base = NULL;
28 A = NULL;
29 gen = NULL;
30}
31
33{
34
35}
36
40 int verbose_level)
41{
42 int f_v = (verbose_level >= 1);
43
44 if (f_v) {
45 cout << "isomorph_global::init" << endl;
46 }
50
51
52 if (f_v) {
53 cout << "isomorph_global::init done" << endl;
54 }
55}
56
57
59 int size, std::string &prefix_classify,
60 std::string &prefix, int level,
61 std::string *fname, int nb_files,
62 int verbose_level)
63{
64 int f_v = (verbose_level >= 1);
65 int f_implicit_fusion = FALSE;
66
67
68 if (f_v) {
69 cout << "isomorph_global::read_statistic_files" << endl;
70 cout << "nb_files = " << nb_files << endl;
71 cout << "prefix_classify = " << prefix_classify << endl;
72 cout << "prefix = " << prefix << endl;
73 }
74
75
77
78 {
79 isomorph Iso;
80 int f_use_database_for_starter = TRUE;
82
83
84 if (f_v) {
85 cout << "size = " << size << endl;
86 }
87
88 if (f_v) {
89 cout << "isomorph_global::read_statistic_files "
90 "before Iso.init" << endl;
91 }
92 Iso.init(prefix, A_base, A, gen, size, level,
93 f_use_database_for_starter,
94 f_implicit_fusion, verbose_level);
95 // sets level and initializes file names
96
97
98
99 if (f_v) {
100 cout << "isomorph_global::read_statistic_files "
101 "before Iso.read_data_files_for_starter" << endl;
102 }
104 prefix_classify, verbose_level);
105
106
107
108
109 // Row,Case_nb,Nb_sol,Nb_backtrack,Nb_col,Dt,Dt_in_sec
110
112 int i, h, Case_nb, Nb_sol, Nb_backtrack, Nb_col, Dt, Dt_in_sec;
113 int case_nb, nb_sol, nb_backtrack, nb_col, dt, dt_in_sec;
114 int *Stats;
115
117 for (i = 0; i < nb_files; i++) {
118 cout << "reading file " << fname[i] << ":" << endl;
119 S[i].read_spreadsheet(fname[i], 0 /* verbose_level */);
120 }
121
122 cout << "Allocating array Stats for " << Iso.nb_starter
123 << " starter cases" << endl;
124
125 Stats = NEW_int(6 * Iso.nb_starter);
126 Int_vec_zero(Stats, 6 * Iso.nb_starter);
127 for (i = 0; i < Iso.nb_starter; i++) {
128 Stats[i * 6 + 0] = -1;
129 }
130
131 cout << "Reading all the statistic files" << endl;
132
133 for (h = 0; h < nb_files; h++) {
134 Case_nb = S[h].find_by_column("Case_nb");
135 Nb_sol = S[h].find_by_column("Nb_sol");
136 Nb_backtrack = S[h].find_by_column("Nb_backtrack");
137 Nb_col = S[h].find_by_column("Nb_col");
138 Dt = S[h].find_by_column("Dt");
139 Dt_in_sec = S[h].find_by_column("Dt_in_sec");
140 for (i = 1; i < S[h].nb_rows; i++) {
141 case_nb = S[h].get_int(i, Case_nb);
142 nb_sol = S[h].get_int(i, Nb_sol);
143 nb_backtrack = S[h].get_int(i, Nb_backtrack);
144 nb_col = S[h].get_int(i, Nb_col);
145 dt = S[h].get_int(i, Dt);
146 dt_in_sec = S[h].get_int(i, Dt_in_sec);
147 Stats[case_nb * 6 + 0] = 1;
148 Stats[case_nb * 6 + 1] = nb_sol;
149 Stats[case_nb * 6 + 2] = nb_backtrack;
150 Stats[case_nb * 6 + 3] = nb_col;
151 Stats[case_nb * 6 + 4] = dt;
152 Stats[case_nb * 6 + 5] = dt_in_sec;
153 }
154 }
155
156 cout << "Read all the statistic files" << endl;
157 for (i = 0; i < Iso.nb_starter; i++) {
158 if (Stats[i * 6 + 0] == -1) {
159 cout << "The run is incomplete, I don't have data for case "
160 << i << " for instance" << endl;
161 exit(1);
162 }
163 }
164
165 cout << "The run is complete" << endl;
166
167
168
169 cout << "The cases where solutions exist are:" << endl;
170 for (i = 0; i < Iso.nb_starter; i++) {
171 if (Stats[i * 6 + 1]) {
172 cout << setw(5) << i << " : " << setw(5)
173 << Stats[i * 6 + 1] << " : ";
174
175 }
176 }
177
178 int Nb_cases = 0;
179
180 Nb_cases = 0;
181 for (i = 0; i < Iso.nb_starter; i++) {
182 if (Stats[i * 6 + 1]) {
183 Nb_cases++;
184 }
185 }
186
187 int *Stats_short;
188
189
190 Stats_short = NEW_int(6 * Nb_cases);
191 h = 0;
192 for (i = 0; i < Iso.nb_starter; i++) {
193 if (Stats[i * 6 + 1]) {
194 Int_vec_copy(Stats + 6 * i, Stats_short + 6 * h, 6);
195 Stats_short[h * 6 + 0] = i;
196 h++;
197 }
198 }
199
200 // Row,Case_nb,Nb_sol,Nb_backtrack,Nb_col,Dt,Dt_in_sec
201
202 const char *Column_label[] = {
203 "Case_nb",
204 "Nb_sol",
205 "Nb_backtrack",
206 "Nb_col",
207 "Dt",
208 "Dt_in_sec"
209 };
210 string fname_collected;
211
212 fname_collected.assign("stats_collected.csv");
213 Fio.int_matrix_write_csv_with_labels(fname_collected,
214 Stats_short, Nb_cases, 6, Column_label);
215
216 cout << "Written file " << fname_collected << " of size "
217 << Fio.file_size(fname_collected) << endl;
218
219
220 Nb_sol = 0;
221 Nb_col = 0;
222 Dt_in_sec = 0;
223 for (i = 0; i < Iso.nb_starter; i++) {
224 Nb_sol += Stats[i * 6 + 1];
225 Nb_col += Stats[i * 6 + 3];
226 Dt_in_sec += Stats[i * 6 + 5];
227 }
228
229 cout << "In total we have:" << endl;
230 cout << "Nb_sol = " << Nb_sol << endl;
231 cout << "Nb_col = " << Nb_col << endl;
232 cout << "Nb_col (average) = "
233 << (double) Nb_col / Iso.nb_starter << endl;
234 cout << "Dt_in_sec = " << Dt_in_sec << endl;
235
236
237
238 FREE_OBJECTS(S);
239#if 0
240 if (f_v) {
241 cout << "isomorph_read_statistic_files "
242 "before Iso.count_solutions" << endl;
243 }
244 int f_get_statistics = FALSE;
245
246
247 Iso.count_solutions(nb_files, fname,
248 f_get_statistics, verbose_level);
249 //
250 // now we know Iso.N, the number of solutions
251 // from the clique finder
252
253 registry_dump_sorted_by_size();
254
255 Iso.build_up_database(nb_files, fname, verbose_level);
256#endif
257
258 }
259 cout << "isomorph_global::read_statistic_files done" << endl;
260
261 //discreta_exit();
262}
263
265 int size, std::string &prefix_classify,
266 std::string &prefix_iso, int level,
267 int verbose_level)
268{
269 int f_v = (verbose_level >= 1);
270 int f_implicit_fusion = FALSE;
271 int i;
272
273 if (f_v) {
274 cout << "isomorph_global::build_db" << endl;
275 cout << "size = " << size << endl;
276 cout << "level = " << level << endl;
277 cout << "prefix_classify = " << prefix_classify << endl;
278 cout << "prefix_iso = " << prefix_iso << endl;
279 }
280
281
283
284 {
285 isomorph Iso;
286 int f_use_database_for_starter = TRUE;
287
288 if (f_v) {
289 cout << "isomorph_global::build_db before Iso.init" << endl;
290 }
291 Iso.init(prefix_iso, A_base, A, gen, size, level,
292 f_use_database_for_starter,
293 f_implicit_fusion, verbose_level);
294 // sets size, level and initializes file names
295
296
297 Iso.read_data_files_for_starter(level, prefix_classify,
298 verbose_level);
299
300 for (i = 0; i <= level; i++) {
301 if (f_v) {
302 cout << "isomorph_global::build_db creating level database for "
303 "level " << i << " / " << level << endl;
304 }
305 Iso.create_level_database(i, verbose_level);
306 }
307
308 }
309 if (f_v) {
310 cout << "isomorph_global::build_db done" << endl;
311 }
312
313 //discreta_exit();
314}
315
317 int size, std::string &prefix_classify,
318 std::string &prefix_iso, int level,
319 std::string *fname, int nb_files,
320 int f_has_final_test_function,
321 int (*final_test_function)(long int *data, int sz,
322 void *final_test_data, int verbose_level),
323 void *final_test_data,
324 int verbose_level)
325{
326 int f_v = (verbose_level >= 1);
327 int f_implicit_fusion = FALSE;
328
329
330 if (f_v) {
331 cout << "isomorph_global::read_solution_files" << endl;
332 cout << "nb_files = " << nb_files << endl;
333 cout << "prefix_classify = " << prefix_classify << endl;
334 cout << "prefix_iso = " << prefix_iso << endl;
335 }
336
337
339
340 {
341 isomorph Iso;
342 int f_use_database_for_starter = TRUE;
343
344
345 if (f_v) {
346 cout << "size = " << size << endl;
347 }
348
349 if (f_v) {
350 cout << "isomorph_global::read_solution_files "
351 "before Iso.init" << endl;
352 }
353 Iso.init(prefix_iso, A_base, A, gen, size, level,
354 f_use_database_for_starter,
355 f_implicit_fusion, verbose_level);
356
357
358
359 if (f_v) {
360 cout << "isomorph_global::read_solution_files "
361 "before Iso.read_data_files_for_starter" << endl;
362 }
364 prefix_classify, verbose_level);
365
366
367
368 if (f_v) {
369 cout << "isomorph_global::read_solution_files "
370 "before Iso.count_solutions" << endl;
371 }
372 int f_get_statistics = FALSE;
373 Iso.count_solutions(nb_files, fname, f_get_statistics,
374 f_has_final_test_function,
375 final_test_function, final_test_data,
376 verbose_level);
377 //
378 // now we know Iso.N, the number of solutions
379 // from the clique finder
380
381 //registry_dump_sorted_by_size();
382
383 Iso.build_up_database(nb_files, fname,
384 f_has_final_test_function,
385 final_test_function, final_test_data,
386 verbose_level);
387
388
389 }
390 cout << "isomorph_global::read_solution_files done" << endl;
391
392 //discreta_exit();
393}
394
396 int size, std::string &prefix_classify,
397 std::string &prefix_iso, int level,
398 int **Solutions, int *Nb_sol, int verbose_level)
399{
400 int f_v = (verbose_level >= 1);
401 int f_implicit_fusion = FALSE;
402
403 if (f_v) {
404 cout << "isomorph_global::init_solutions_from_memory" << endl;
405 cout << "prefix_classify = " << prefix_classify << endl;
406 cout << "prefix_iso = " << prefix_iso << endl;
407 }
408
409
411
412 {
413 isomorph Iso;
414 int f_use_database_for_starter = TRUE;
415
416
417 if (f_v) {
418 cout << "size = " << size << endl;
419 }
420
421 if (f_v) {
422 cout << "isomorph_global::init_solutions_from_memory "
423 "before Iso.init" << endl;
424 }
425 Iso.init(prefix_iso, A_base, A, gen, size,
426 level, f_use_database_for_starter,
427 f_implicit_fusion, 0/*verbose_level - 2*/);
428 if (f_v) {
429 cout << "isomorph_global::init_solutions_from_memory "
430 "after Iso.init" << endl;
431 }
432
433
434
435 if (f_v) {
436 cout << "isomorph_global::init_solutions_from_memory "
437 "before Iso.read_data_files_for_starter" << endl;
438 }
440 prefix_classify, 0/*verbose_level - 4*/);
441
442 if (f_v) {
443 cout << "isomorph_global::init_solutions_from_memory "
444 "after Iso.read_data_files_for_starter" << endl;
445 }
446
447
448
449 if (f_v) {
450 cout << "isomorph_global::init_solutions_from_memory "
451 "before Iso.init_solutions" << endl;
452 }
453 //int f_get_statistics = FALSE;
454 Iso.init_solutions(Solutions, Nb_sol, verbose_level - 1);
455 //
456 // now we know Iso.N, the number of solutions
457 // from the clique finder
458
459 if (f_v) {
460 cout << "isomorph_global::init_solutions_from_memory "
461 "after Iso.init_solutions" << endl;
462 }
463
464 }
465 if (f_v) {
466 cout << "isomorph_global::init_solutions_from_memory done" << endl;
467 }
468
469 //discreta_exit();
470}
471
473 int size, std::string &prefix_classify, std::string &prefix_iso, int level,
474 std::string *fname, long int *list_of_cases, int nb_files, int verbose_level)
475{
476 int f_v = (verbose_level >= 1);
477 int f_implicit_fusion = FALSE;
478
479 if (f_v) {
480 cout << "isomorph_global::read_solution_files_from_clique_finder_case_by_case" << endl;
481 cout << "nb_files = " << nb_files << endl;
482 cout << "prefix_iso = " << prefix_iso << endl;
483 }
484
485
487
488 {
489 isomorph Iso;
490 int f_use_database_for_starter = TRUE;
491
492
493 if (f_v) {
494 cout << "size = " << size << endl;
495 }
496
497 if (f_v) {
498 cout << "isomorph_global::read_solution_files_from_clique_finder_case_by_case before Iso.init" << endl;
499 }
500 Iso.init(prefix_iso, A_base, A, gen, size, level,
501 f_use_database_for_starter,
502 f_implicit_fusion, 0/*verbose_level - 2*/);
503 if (f_v) {
504 cout << "isomorph_global::read_solution_files_from_clique_finder_case_by_case after Iso.init" << endl;
505 }
506
507
508 if (f_v) {
509 cout << "isomorph_global::read_solution_files_from_clique_finder_case_by_case before Iso.read_data_files_"
510 "for_starter" << endl;
511 }
512 Iso.read_data_files_for_starter(level, prefix_classify,
513 0/*verbose_level - 4*/);
514
515 if (f_v) {
516 cout << "isomorph_global::read_solution_files_from_clique_finder_case_by_case after Iso.read_data_files_"
517 "for_starter" << endl;
518 }
519
520
521
522 if (f_v) {
523 cout << "isomorph_global::read_solution_files_from_clique_finder_case_by_case before Iso.count_solutions_"
524 "from_clique_finder" << endl;
525 }
526 //int f_get_statistics = FALSE;
528 list_of_cases, fname, /*f_get_statistics,*/
529 verbose_level - 1);
530 //
531 // now we know Iso.N, the number of solutions
532 // from the clique finder
533
534 //registry_dump_sorted_by_size();
535
536 if (f_v) {
537 cout << "isomorph_global::read_solution_files_from_clique_finder_case_by_case before Iso.read_solutions_from_clique_"
538 "finder_case_by_case" << endl;
539 }
541 list_of_cases, fname, verbose_level - 1);
542
543 if (f_v) {
544 cout << "isomorph_global::read_solution_files_from_clique_finder_case_by_case after Iso.read_solutions_from_clique_"
545 "finder_case_by_case" << endl;
546 }
547
548
549 }
550 if (f_v) {
551 cout << "isomorph_global::read_solution_files_from_clique_finder_case_by_case done" << endl;
552 }
553
554 //discreta_exit();
555}
556
558 int size, std::string &prefix_classify, std::string &prefix_iso, int level,
559 std::string *fname, int nb_files, int verbose_level)
560{
561 int f_v = (verbose_level >= 1);
562 int f_implicit_fusion = FALSE;
563
564 if (f_v) {
565 cout << "isomorph_global::read_solution_files_from_clique_finder" << endl;
566 cout << "nb_files = " << nb_files << endl;
567 cout << "prefix_iso = " << prefix_iso << endl;
568 }
569
570
572
573 {
574 isomorph Iso;
575 int f_use_database_for_starter = TRUE;
576
577
578 if (f_v) {
579 cout << "size = " << size << endl;
580 }
581
582 if (f_v) {
583 cout << "isomorph_global::read_solution_files_from_clique_finder "
584 "before Iso.init" << endl;
585 }
586 Iso.init(prefix_iso, A_base, A, gen,
587 size, level, f_use_database_for_starter,
588 f_implicit_fusion, 0/*verbose_level - 2*/);
589 if (f_v) {
590 cout << "isomorph_global::read_solution_files_from_clique_finder "
591 "after Iso.init" << endl;
592 }
593
594
595 if (f_v) {
596 cout << "isomorph_global::read_solution_files_from_clique_finder "
597 "before Iso.read_data_files_for_starter" << endl;
598 }
599 Iso.read_data_files_for_starter(level, prefix_classify,
600 0/*verbose_level - 4*/);
601
602 if (f_v) {
603 cout << "isomorph_global::read_solution_files_from_clique_finder "
604 "after Iso.read_data_files_for_starter" << endl;
605 }
606
607
608
609 if (f_v) {
610 cout << "isomorph_global::read_solution_files_from_clique_finder "
611 "before Iso.count_solutions_from_clique_finder" << endl;
612 }
613 //int f_get_statistics = FALSE;
614 Iso.count_solutions_from_clique_finder(nb_files, fname,
615 verbose_level - 1);
616 //
617 // now we know Iso.N, the number of solutions
618 // from the clique finder
619
620 //registry_dump_sorted_by_size();
621
622 if (f_v) {
623 cout << "isomorph_global::read_solution_files_from_clique_finder "
624 "before Iso.read_solutions_from_clique_finder" << endl;
625 }
627 fname, verbose_level - 1);
628 if (f_v) {
629 cout << "isomorph_global::read_solution_files_from_clique_finder "
630 "after Iso.read_solutions_from_clique_finder" << endl;
631 }
632
633
634 }
635 if (f_v) {
636 cout << "isomorph_global::read_solution_files_from_clique_finder "
637 "done" << endl;
638 }
639
640 //discreta_exit();
641}
642
644 int size, std::string &prefix_classify,
645 std::string &prefix_iso, int level, int verbose_level)
646{
647 int f_v = (verbose_level >= 1);
648 int f_implicit_fusion = FALSE;
649
650 if (f_v) {
651 cout << "isomorph_global::compute_orbits" << endl;
652 }
653
654
656
657 {
658 isomorph Iso;
659 int f_use_database_for_starter = TRUE;
660
661
662 if (f_v) {
663 cout << "isomorph_global::compute_orbits before Iso.init" << endl;
664 }
665 Iso.init(prefix_iso, A_base, A, gen, size, level,
666 f_use_database_for_starter,
667 f_implicit_fusion, verbose_level);
668 // sets q, level and initializes file names
669 if (f_v) {
670 cout << "isomorph_global::compute_orbits after Iso.init" << endl;
671 }
672
673
674
675 if (f_v) {
676 cout << "isomorph_global::compute_orbits before Iso.read_data_files_for_starter" << endl;
677 }
679 prefix_classify, verbose_level);
680 if (f_v) {
681 cout << "isomorph_global::compute_orbits after Iso.read_data_files_for_starter" << endl;
682 }
683
684 if (f_v) {
685 cout << "isomorph_global::compute_orbits before Iso.init_solution" << endl;
686 }
687 Iso.init_solution(verbose_level);
688 if (f_v) {
689 cout << "isomorph_global::compute_orbits after Iso.init_solution" << endl;
690 }
691
692 if (f_v) {
693 cout << "isomorph_global::compute_orbits before Iso.orbits_of_stabilizer" << endl;
694 }
695 Iso.orbits_of_stabilizer(verbose_level);
696 if (f_v) {
697 cout << "isomorph_global::compute_orbits after Iso.orbits_of_stabilizer" << endl;
698 }
699
700 if (f_v) {
701 cout << "isomorph_global::compute_orbits before Iso.write_orbit_data" << endl;
702 }
703 Iso.write_orbit_data(verbose_level);
704 if (f_v) {
705 cout << "isomorph_global::compute_orbits after Iso.write_orbit_data" << endl;
706 }
707
708
709
710
711 }
712 cout << "isomorph_global::compute_orbits done" << endl;
713
714 //discreta_exit();
715}
716
717
719 int size, std::string &prefix_classify,
720 std::string &prefix_iso, int level,
721 int f_play_back, std::string &old_event_file,
722 int print_mod, int verbose_level)
723{
724 int f_v = (verbose_level >= 1);
725 int f_implicit_fusion = FALSE;
726 int t0;
728
729
730 t0 = Os.os_ticks();
731
732
733 if (f_v) {
734 cout << "isomorph_global::isomorph_testing" << endl;
735 }
736
737
739
740 {
741 isomorph Iso;
742 int f_use_database_for_starter = FALSE;
744
745
746 if (f_v) {
747 cout << "isomorph_global::isomorph_testing before Iso.init" << endl;
748 }
749 Iso.init(prefix_iso,
750 A_base, A, gen,
751 size, level,
752 f_use_database_for_starter,
753 f_implicit_fusion,
754 verbose_level - 1);
755
756
757
759 prefix_classify, verbose_level - 1);
760 //Iso.compute_nb_starter(search_depth, verbose_level);
761
762 Iso.init_solution(verbose_level - 1);
763
764 Iso.load_table_of_solutions(verbose_level - 1);
765
766 Iso.read_orbit_data(verbose_level - 1);
767
768 Iso.depth_completed = level /*- 2*/;
769
770 if (f_v) {
771 cout << "isomorph_global::isomorph_testing before Iso.gen->recreate_schreier_"
772 "vectors_up_to_level" << endl;
773 }
775 verbose_level - 1);
776
777 int i;
778
779 if (f_v) {
780 for (i = 0; i <= level + 1; i++) {
781 cout << "gen->first_node_at_level[" << i << "]="
782 << gen->first_node_at_level(i) << endl;
783 }
784 cout << "Iso.depth_completed=" << Iso.depth_completed << endl;
785 }
786
787#if 0
788 cout << "Node 28:" << endl;
789 Iso.gen->root[28].print_node(Iso.gen);
790#endif
791
792 Iso.iso_test_init(verbose_level - 1);
793
794 int f_implicit_fusion = FALSE;
795
796 //Iso.gen->f_allowed_to_show_group_elements = FALSE;
797
798 Iso.read_starter_nb_orbits(verbose_level); // added Oct 30, 2014
799
800
801 if (f_v) {
802 cout << "isomorph_global::isomorph_testing before Iso.isomorph_testing" << endl;
803 }
804 Iso.isomorph_testing(t0, f_play_back, old_event_file,
805 f_implicit_fusion, print_mod, verbose_level);
806 if (f_v) {
807 cout << "isomorph_global::isomorph_testing after Iso.isomorph_testing" << endl;
808 }
809
810 if (f_v) {
811 cout << "isomorph_global::isomorph_testing before Iso.Reps->save" << endl;
812 }
813 Iso.Reps->save(verbose_level - 1);
814 if (f_v) {
815 cout << "isomorph_global::isomorph_testing after Iso.Reps->save" << endl;
816 }
817
818
819 long int data1[1000];
820 int id, orbit;
821
822 Iso.setup_and_open_solution_database(verbose_level - 1);
823
824 string fname;
825
826 fname.assign(prefix_iso);
827 fname.append("orbits.txt");
828
829 {
830 ofstream fp(fname);
831 fp << "# " << Iso.size << endl;
832 for (orbit = 0; orbit < Iso.Reps->count; orbit++) {
833
834
835 id = Iso.orbit_perm[Iso.orbit_fst[Iso.Reps->rep[orbit]]];
836
837 Iso.load_solution(id, data1);
838 if (FALSE) {
839 cout << "read representative of orbit " << orbit
840 << " (id=" << id << ")" << endl;
841 Lint_vec_print(cout, data1, Iso.size);
842 cout << endl;
843 }
844
845#if 0
846 for (i = 0; i < Iso.size; i++) {
847 cout << setw(8) << data1[i] << ", ";
848 }
849 cout << endl;
850#endif
851 fp << Iso.size;
852 for (i = 0; i < Iso.size; i++) {
853 fp << " " << data1[i];
854 }
856
857 Iso.Reps->stab[orbit]->group_order(go);
858 fp << " ";
860 fp << endl;
861
862 //write_set_to_file(fname, data1, Iso.size, verbose_level - 1);
863 }
864 fp << "-1 " << Iso.Reps->count << endl;
865
866 }
867 cout << "Written file " << fname << " of size "
868 << Fio.file_size(fname) << endl;
869
870 Iso.close_solution_database(verbose_level - 1);
871
872#if 0
873 Iso.print_set_function = callback_print_isomorphism_type_extend_regulus;
874 Iso.print_set_data = this;
875 Iso.print_isomorphism_types(verbose_level);
876#endif
877
878
879 }
880 cout << "isomorph_global::isomorph_testing done" << endl;
881
882 //discreta_exit();
883}
884
886 int size, std::string &prefix_classify,
887 std::string &prefix_iso, int level,
888 int verbose_level)
889{
890 int f_v = (verbose_level >= 1);
891 int f_implicit_fusion = FALSE;
892 //int t0;
893
894
895 //t0 = os_ticks();
896
897
898 if (f_v) {
899 cout << "isomorph_global::classification_graph" << endl;
900 }
901
902
904
905 {
906 isomorph Iso;
907 int f_use_database_for_starter = FALSE;
908
909
910 if (f_v) {
911 cout << "isomorph_global::classification_graph "
912 "before Iso.init" << endl;
913 }
914 Iso.init(prefix_iso,
915 A_base, A, gen,
916 size, level,
917 f_use_database_for_starter,
918 f_implicit_fusion,
919 verbose_level - 1);
920
921
922
924 prefix_classify, verbose_level);
925
926
927
928
929
930 Iso.write_classification_matrix(verbose_level);
931 Iso.write_classification_graph(verbose_level);
932 Iso.decomposition_matrix(verbose_level);
933
934
935
936 }
937 cout << "isomorph_global::classification_graph done" << endl;
938
939 //discreta_exit();
940}
941
942
944 int size, std::string &prefix_classify,
945 std::string &prefix_iso, int level,
946 int identify_nb_files, std::string *fname, int *Iso_type,
947 int f_save, int verbose_level)
948{
949 int f_v = (verbose_level >= 1);
950 int f_implicit_fusion = FALSE;
951 long int *the_set;
952 int set_size;
953 string fname_transporter;
954
955
956
957
958 if (f_v) {
959 cout << "isomorph_global::identify" << endl;
960 }
961
962
964
965 {
966 isomorph Iso;
967 int f_use_database_for_starter = FALSE;
969
970
971 if (f_v) {
972 cout << "isomorph_global::identify before Iso.init" << endl;
973 }
974 Iso.init(prefix_iso, A_base, A, gen,
975 size, level,
976 f_use_database_for_starter,
977 f_implicit_fusion,
978 verbose_level);
979
980
981
983 prefix_classify, verbose_level);
984
985
986 int i;
987
988 for (i = 0; i < identify_nb_files; i++) {
989
990 Fio.read_set_from_file(fname[i], the_set, set_size, verbose_level);
991 if (f_v) {
992 cout << "isomorph_global::identify read file " << fname[i] << endl;
993 cout << "the_set = ";
994 Lint_vec_print(cout, the_set, set_size);
995 cout << endl;
996 }
997
998
999 fname_transporter.assign("transporter_");
1000 fname_transporter.append(fname[i]);
1001 //sprintf(fname_transporter, "transporter_%s", fname[i]);
1002
1003
1004 if (f_v) {
1005 cout << "isomorph_identify before Iso.identify" << endl;
1006 }
1007 Iso_type[i] = Iso.identify(the_set,
1008 f_implicit_fusion, verbose_level - 2);
1009 if (f_v) {
1010 cout << "isomorph_identify after Iso.identify" << endl;
1011 }
1012
1013 if (f_save) {
1014
1015#if 0
1016 FILE *f2;
1017 f2 = fopen(fname_transporter, "wb");
1019 f2, 0/* verbose_level*/);
1020
1021 fclose(f2);
1022#else
1024 fname_transporter, 0 /* verbose_level*/);
1025#endif
1026 cout << "isomorph_identify written file " << fname_transporter
1027 << " of size " << Fio.file_size(fname_transporter) << endl;
1028 }
1029
1030
1031 if (f_v) {
1032 cout << "isomorph_global::identify The set in " << fname[i]
1033 << " belongs to isomorphism type " << Iso_type[i] << endl;
1034 }
1035
1036 FREE_lint(the_set);
1037 }
1038
1039
1040 if (f_v) {
1041 cout << "isomorph_global::identify Summary:" << endl;
1042 for (i = 0; i < identify_nb_files; i++) {
1043 cout << i << " : " << fname[i] << " : " << Iso_type[i] << endl;
1044 }
1045 }
1046
1047
1048 }
1049 cout << "isomorph_global::identify done" << endl;
1050 //discreta_exit();
1051}
1052
1054 int size, std::string &prefix_classify,
1055 std::string &prefix_iso, int level,
1056 int nb_rows, long int *Table, int *Iso_type,
1057 int verbose_level)
1058// Table[nb_rows * size]
1059{
1060 int f_v = (verbose_level >= 1);
1061 int f_implicit_fusion = FALSE;
1062 long int *the_set;
1063 int set_size;
1064
1065
1066
1067
1068 if (f_v) {
1069 cout << "isomorph_global::identify_table" << endl;
1070 }
1071
1072
1074
1075 {
1076 isomorph Iso;
1077 int f_use_database_for_starter = FALSE;
1078
1079
1080 if (f_v) {
1081 cout << "isomorph_global::identify_table before Iso.init" << endl;
1082 }
1083 Iso.init(prefix_iso, A_base, A, gen,
1084 size, level,
1085 f_use_database_for_starter,
1086 f_implicit_fusion,
1087 verbose_level);
1088 // sets level and initializes file names
1089
1090
1091
1092
1094 prefix_classify, verbose_level);
1095
1096 int i;
1097
1098
1099
1100 set_size = size;
1101 the_set = NEW_lint(set_size);
1102
1103 for (i = 0; i < nb_rows; i++) {
1104
1105 Lint_vec_copy(Table + i * set_size, the_set, set_size);
1106
1107 if (f_v) {
1108 cout << "isomorph_global::identify_table "
1109 "Identifying set no " << i << endl;
1110 cout << "the_set = ";
1111 Lint_vec_print(cout, the_set, set_size);
1112 cout << endl;
1113 }
1114
1115
1116
1117 if (f_v) {
1118 cout << "isomorph_global::identify_table "
1119 "before Iso.identify" << endl;
1120 }
1121 Iso_type[i] = Iso.identify(the_set,
1122 f_implicit_fusion, verbose_level - 2);
1123 if (f_v) {
1124 cout << "isomorph_global::identify_table "
1125 "after Iso.identify" << endl;
1126 }
1127
1128
1129
1130 if (f_v) {
1131 cout << "isomorph_global::identify_table The set no " << i
1132 << " belongs to isomorphism type "
1133 << Iso_type[i] << endl;
1134 }
1135
1136 }
1137 FREE_lint(the_set);
1138
1139
1140 if (f_v) {
1141 cout << "isomorph_global::identify_table Summary:" << endl;
1142 for (i = 0; i < nb_rows; i++) {
1143 cout << i << " : " << Iso_type[i] << endl;
1144 }
1145 }
1146
1147
1148 }
1149 cout << "isomorph_global::identify_table done" << endl;
1150 //discreta_exit();
1151}
1152
1154 int size, std::string &prefix_classify, std::string &prefix_iso,
1155 void (*work_callback)(isomorph *Iso, void *data, int verbose_level),
1156 void *work_data,
1157 int level, int verbose_level)
1158{
1159 int f_v = (verbose_level >= 1);
1160
1161 if (f_v) {
1162 cout << "isomorph_global::worker" << endl;
1163 cout << "isomorph_global::worker size=" << size << endl;
1164 cout << "isomorph_global::worker level=" << level << endl;
1165 }
1166
1167
1169
1170 {
1171 isomorph Iso;
1172 int f_use_database_for_starter = FALSE;
1173 int f_implicit_fusion = FALSE;
1174
1175 if (f_v) {
1176 cout << "isomorph_global::worker before Iso.init" << endl;
1177 }
1178 Iso.init(prefix_iso,
1179 A_base, A, gen,
1180 size, level,
1181 f_use_database_for_starter,
1182 f_implicit_fusion,
1183 verbose_level);
1184 // sets level and initializes file names
1185 if (f_v) {
1186 cout << "isomorph_global::worker after Iso.init" << endl;
1187 }
1188
1189 if (f_v) {
1190 cout << "isomorph_global::worker before Iso.read_everything_including_classification" << endl;
1191 }
1193 prefix_classify, verbose_level);
1194 if (f_v) {
1195 cout << "isomorph_global::worker after Iso.read_everything_including_classification" << endl;
1196 }
1197
1198
1199
1200
1201 if (f_v) {
1202 cout << "isomorph_global::worker before Iso.setup_and_open_solution_database" << endl;
1203 }
1204 Iso.setup_and_open_solution_database(verbose_level - 1);
1205 if (f_v) {
1206 cout << "isomorph_global::worker after Iso.setup_and_open_solution_database" << endl;
1207 }
1208 if (f_v) {
1209 cout << "isomorph_global::worker before Iso.setup_and_open_level_database" << endl;
1210 }
1211 Iso.setup_and_open_level_database(verbose_level - 1);
1212 if (f_v) {
1213 cout << "isomorph_global::worker after Iso.setup_and_open_level_database" << endl;
1214 }
1215
1216#if 0
1217 Iso.print_set_function = callback_print_isomorphism_type_extend_regulus;
1218 Iso.print_set_data = this;
1219 Iso.print_isomorphism_types(f_select, select_first,
1220 select_len, verbose_level);
1221#endif
1222
1223
1224 if (f_v) {
1225 cout << "isomorph_global::worker before work_callback" << endl;
1226 }
1227 (*work_callback)(&Iso, work_data, verbose_level);
1228 if (f_v) {
1229 cout << "isomorph_global::worker after work_callback" << endl;
1230 }
1231
1232
1233 Iso.close_solution_database(verbose_level - 1);
1234 Iso.close_level_database(verbose_level - 1);
1235
1236
1237
1238
1239
1240 }
1241 cout << "isomorph_global::worker done" << endl;
1242
1243}
1244
1246 int size, std::string &prefix_classify, std::string &prefix,
1247 int level, int verbose_level)
1248{
1249 int f_v = (verbose_level >= 1);
1250
1251 if (f_v) {
1252 cout << "isomorph_global::compute_down_orbits "
1253 "level = " << level << endl;
1254 cout << "isomorph_compute_down_orbits "
1255 "verbose_level = " << verbose_level << endl;
1256 }
1257 worker(
1258 size, prefix_classify, prefix,
1259 callback_compute_down_orbits_worker,
1260 this,
1261 level, verbose_level);
1262 if (f_v) {
1263 cout << "isomorph_global::compute_down_orbits done" << endl;
1264 }
1265}
1266
1268 isomorph *Iso, int orbit,
1269 int &cnt_orbits, int &cnt_special_orbits,
1270 int *&special_orbit_identify, int verbose_level)
1271{
1272 int f_v = (verbose_level >= 1);
1273 int f_vv = (verbose_level >= 2);
1274 int f_vvv = (verbose_level >= 3);
1275 int id, rep, first; //, c;
1276 long int data[1000];
1279
1280 if (f_v) {
1281 cout << "isomorph_global::compute_down_orbits_for_isomorphism_type "
1282 "orbit=" << orbit << endl;
1283 }
1284
1285 cnt_orbits = 0;
1286 cnt_special_orbits = 0;
1287
1288 rep = Iso->Reps->rep[orbit];
1289 first = Iso->orbit_fst[rep];
1290 //c = Iso->starter_number[first];
1291 id = Iso->orbit_perm[first];
1292 Iso->load_solution(id, data);
1293
1294
1295
1296 groups::sims *Stab;
1297 groups::strong_generators *Strong_gens;
1298
1299 Stab = Iso->Reps->stab[orbit];
1300
1301 if (f_vv) {
1302 cout << "isomorph_global::compute_down_orbits_for_isomorphism_type "
1303 "computing induced action on the set (in data)" << endl;
1304 }
1305
1306
1308 Strong_gens->init_from_sims(Stab, verbose_level - 2);
1309
1310
1311 Iso->induced_action_on_set(Stab, data, 0 /*verbose_level*/);
1312
1313 if (f_vv) {
1314 cout << "data after induced_action_on_set:" << endl;
1315 Lint_vec_print(cout, data, Iso->size);
1316 cout << endl;
1317 }
1318
1320
1321 Iso->AA->group_order(go1);
1322
1323 if (f_vv) {
1324 cout << "action " << Iso->AA->label << " computed, "
1325 "group order is " << go1 << endl;
1326
1327 cout << "Order of the group that is induced on the object is ";
1328 cout << "$";
1329 go1.print_not_scientific(cout);
1330 cout << "$\\\\" << endl;
1331 }
1332
1333 if (FALSE /*go1.is_one()*/) {
1334 cnt_orbits = Combi.int_n_choose_k(Iso->size, Iso->level);
1335 cnt_special_orbits = 1;
1336 }
1337 else {
1338 long int *orbit_reps;
1339 int nb_orbits;
1340
1341 if (f_vv) {
1342 cout << "isomorph_global::compute_down_orbits_for_isomorphism_type "
1343 "orbit=" << orbit << " / " << Iso->Reps->count
1344 << " computing orbits on subsets" << endl;
1345 }
1350 Poset->init_subset_lattice(
1351 Iso->A_base, Iso->AA, Strong_gens,
1352 verbose_level);
1353 Poset->orbits_on_k_sets(Control,
1354 Iso->level, orbit_reps, nb_orbits, verbose_level - 5);
1355 FREE_OBJECT(Poset);
1356 FREE_OBJECT(Control);
1357 if (f_vv) {
1358 cout << "isomorph_global::compute_down_orbits_for_isomorphism_type "
1359 "orbit=" << orbit << " / " << Iso->Reps->count
1360 << " computing orbits on subsets done" << endl;
1361 }
1362
1363 if (f_vvv) {
1364 cout << "Orbit reps: nb_orbits=" << nb_orbits << endl;
1365 Lint_matrix_print(orbit_reps, nb_orbits, Iso->level);
1366 }
1367
1368 if (f_vv) {
1369 cout << "Number of orbits on $" << Iso->level << "$-sets is "
1370 << nb_orbits << ".\\\\" << endl;
1371 }
1372
1373 long int *rearranged_set;
1374 int *transporter;
1375 int u;
1376 int case_nb;
1377 int f_implicit_fusion = FALSE;
1378 int idx;
1379
1380 rearranged_set = NEW_lint(Iso->size);
1381 transporter = NEW_int(Iso->A_base->elt_size_in_int);
1382
1383 cnt_orbits = nb_orbits;
1384 cnt_special_orbits = 0;
1385 special_orbit_identify = NEW_int(nb_orbits);
1386 for (u = 0; u < nb_orbits; u++) {
1387
1388 if (f_vv) {
1389 cout << "iso type " << orbit << " / " << Iso->Reps->count
1390 << " down_orbit " << u << " / "
1391 << nb_orbits << ":" << endl;
1392 Lint_vec_print(cout, orbit_reps + u * Iso->level, Iso->level);
1393 cout << endl;
1394 }
1395
1396
1397
1398 Sorting.rearrange_subset_lint_all(Iso->size, Iso->level,
1399 data, orbit_reps + u * Iso->level, rearranged_set,
1400 0/*verbose_level - 3*/);
1401
1402
1403 //int_vec_print(cout, rearranged_set, Iso.size);
1404 //cout << endl;
1405 int f_failure_to_find_point, f_found;
1406
1407 Iso->A_base->element_one(transporter, 0);
1408 case_nb = Iso->trace_set(rearranged_set, transporter,
1409 f_implicit_fusion, f_failure_to_find_point,
1410 0 /*verbose_level - 2*/);
1411
1412 //cout << "f_failure_to_find_point="
1413 // << f_failure_to_find_point << endl;
1414 //cout << "case_nb=" << case_nb << endl;
1415 if (f_failure_to_find_point) {
1416 cout << "isomorph_global::compute_down_orbits_for_isomorphism_type "
1417 "f_failure_to_find_point" << endl;
1418 exit(1);
1419 }
1420
1421 f_found = Iso->find_extension_easy_new(rearranged_set,
1422 case_nb, idx, 0 /* verbose_level */);
1423#if 0
1424 f_found = Iso.identify_solution_relaxed(prefix, transporter,
1425 f_implicit_fusion, orbit_no0,
1426 f_failure_to_find_point, 3 /*verbose_level*/);
1427#endif
1428
1429 //cout << "f_found=" << f_found << endl;
1430 if (!f_found) {
1431 if (f_vv) {
1432 cout << "isomorph_global::compute_down_orbits_for_isomorphism_type not found" << endl;
1433 }
1434 continue;
1435 }
1436 else {
1437 if (f_vv) {
1438 cout << "iso type " << orbit << " / " << Iso->Reps->count
1439 << " down orbit " << u << " / " << nb_orbits
1440 << " leads to orbit " << idx << endl;
1441 }
1442 }
1443 special_orbit_identify[cnt_special_orbits] = idx;
1444 cnt_special_orbits++;
1445 } // next u
1446 if (f_v) {
1447 cout << "Number of special orbits on $" << Iso->level
1448 << "$-sets is " << cnt_special_orbits
1449 << ".\\\\" << endl;
1450 }
1451
1452 int *soi;
1453 int i;
1454
1455 soi = NEW_int(cnt_special_orbits);
1456 for (i = 0; i < cnt_special_orbits; i++) {
1457 soi[i] = special_orbit_identify[i];
1458 }
1459 FREE_int(special_orbit_identify);
1460 special_orbit_identify = soi;
1461
1462
1463 FREE_lint(rearranged_set);
1464 FREE_int(transporter);
1465 FREE_lint(orbit_reps);
1466 }
1467 FREE_OBJECT(Strong_gens);
1468
1469 if (f_v) {
1470 cout << "isomorph_global::compute_down_orbits_for_isomorphism_type "
1471 "done" << endl;
1472 }
1473}
1474
1476 isomorph &Iso, const char *prefix,
1477 char *label_of_structure_plural, std::ostream &f,
1478 int verbose_level)
1479{
1480 int f_v = (verbose_level >= 1);
1481 //int f_vv = (verbose_level >= 2);
1482 //int f_vvv = (verbose_level >= 3);
1483 int *selection;
1484 int selection_size;
1485 int i;
1486
1487 if (f_v) {
1488 cout << "isomorph_global::report_data_in_source_code_inside_tex" << endl;
1489 }
1490 selection_size = Iso.Reps->count;
1491 selection = NEW_int(selection_size);
1492 for (i = 0; i < selection_size; i++) {
1493 selection[i] = i;
1494 }
1496 Iso, prefix,
1497 label_of_structure_plural, f,
1498 selection_size, selection, verbose_level);
1499 FREE_int(selection);
1500}
1501
1502
1504 isomorph &Iso, const char *prefix,
1505 char *label_of_structure_plural, std::ostream &fp,
1506 int selection_size, int *selection,
1507 int verbose_level)
1508{
1509 int f_v = (verbose_level >= 1);
1510 int f_vv = (verbose_level >= 2);
1511 //int f_vvv = (verbose_level >= 3);
1512 int h, rep, first, /*c,*/ id, i, s;
1513 long int data[1000];
1514
1515 if (f_v) {
1516 cout << "isomorph_global::report_data_in_source_code_inside_tex_with_selection" << endl;
1517 }
1518
1519 fp << "\\section{The " << label_of_structure_plural
1520 << " in Numeric Form}" << endl << endl;
1521
1522 //fp << "\\clearpage" << endl << endl;
1523 for (s = 0; s < selection_size; s++) {
1524 h = selection[s];
1525 rep = Iso.Reps->rep[h];
1526 first = Iso.orbit_fst[rep];
1527 //c = Iso.starter_number[first];
1528 id = Iso.orbit_perm[first];
1529 Iso.load_solution(id, data);
1530 for (i = 0; i < Iso.size; i++) {
1531 fp << data[i];
1532 if (i < Iso.size - 1) {
1533 fp << ", ";
1534 }
1535 }
1536 fp << "\\\\" << endl;
1537 }
1538 fp << "\\begin{verbatim}" << endl << endl;
1539 fp << "int " << prefix << "_size = " << Iso.size << ";" << endl;
1540 fp << "int " << prefix << "_nb_reps = " << selection_size << ";" << endl;
1541 fp << "int " << prefix << "_reps[] = {" << endl;
1542 for (s = 0; s < selection_size; s++) {
1543 h = selection[s];
1544 rep = Iso.Reps->rep[h];
1545 first = Iso.orbit_fst[rep];
1546 //c = Iso.starter_number[first];
1547 id = Iso.orbit_perm[first];
1548 Iso.load_solution(id, data);
1549 fp << "\t";
1550 for (i = 0; i < Iso.size; i++) {
1551 fp << data[i];
1552 fp << ", ";
1553 }
1554 fp << endl;
1555 }
1556 fp << "};" << endl;
1557 fp << "const char *" << prefix << "_stab_order[] = {" << endl;
1558 for (s = 0; s < selection_size; s++) {
1559 h = selection[s];
1560
1562
1563 rep = Iso.Reps->rep[h];
1564 first = Iso.orbit_fst[rep];
1565 //c = Iso.starter_number[first];
1566 id = Iso.orbit_perm[first];
1567 Iso.load_solution(id, data);
1568 if (Iso.Reps->stab[h]) {
1569 Iso.Reps->stab[h]->group_order(go);
1570 fp << "\"";
1571 go.print_not_scientific(fp);
1572 fp << "\"," << endl;
1573 }
1574 else {
1575 fp << "\"";
1576 fp << "1";
1577 fp << "\"," << endl;
1578 }
1579 }
1580 fp << "};" << endl;
1581
1582 {
1583 int *stab_gens_first;
1584 int *stab_gens_len;
1585 int fst;
1586
1587 stab_gens_first = NEW_int(selection_size);
1588 stab_gens_len = NEW_int(selection_size);
1589 fst = 0;
1590 fp << "int " << prefix << "_stab_gens[] = {" << endl;
1591 for (s = 0; s < selection_size; s++) {
1592 h = selection[s];
1594 int *tl;
1595 int j;
1596
1598 tl = NEW_int(Iso.A_base->base_len());
1599
1600 if (f_vv) {
1601 cout << "isomorph_global::report_data_in_source_code_inside_tex_with_selection before extract_strong_"
1602 "generators_in_order" << endl;
1603 }
1605 *gens, tl, 0);
1606
1607 stab_gens_first[s] = fst;
1608 stab_gens_len[s] = gens->len;
1609 fst += gens->len;
1610
1611 for (j = 0; j < gens->len; j++) {
1612 if (f_vv) {
1613 cout << "isomorph_global::report_data_in_source_code_inside_tex_with_selection before extract_strong_"
1614 "generators_in_order generator " << j
1615 << " / " << gens->len << endl;
1616 }
1617 fp << "";
1618 Iso.A_base->element_print_for_make_element(gens->ith(j), fp);
1619 fp << endl;
1620 }
1621
1622 FREE_int(tl);
1623 FREE_OBJECT(gens);
1624 }
1625 fp << "};" << endl;
1626 fp << "int " << prefix << "_stab_gens_fst[] = { ";
1627 for (s = 0; s < selection_size; s++) {
1628 fp << stab_gens_first[s];
1629 if (s < selection_size - 1) {
1630 fp << ", ";
1631 }
1632 }
1633 fp << "};" << endl;
1634 fp << "int " << prefix << "_stab_gens_len[] = { ";
1635 for (s = 0; s < selection_size; s++) {
1636 fp << stab_gens_len[s];
1637 if (s < selection_size - 1) {
1638 fp << ", ";
1639 }
1640 }
1641 fp << "};" << endl;
1642 fp << "int " << prefix << "_make_element_size = "
1643 << Iso.A_base->make_element_size << ";" << endl;
1644 }
1645 fp << "\\end{verbatim}" << endl << endl;
1646}
1647
1648static void callback_compute_down_orbits_worker(
1649 isomorph *Iso, void *data, int verbose_level)
1650{
1651 int f_v = (verbose_level >= 1);
1652 int f_vv = (verbose_level >= 2);
1653 int orbit;
1654 int *Nb_orbits;
1655 int nb_orbits = 0;
1656 int nb_special_orbits = 0;
1657 int **Down_orbit_identify;
1658 int *Down_identify;
1659 int h, i, idx;
1661
1662 if (f_v) {
1663 cout << "callback_compute_down_orbits_worker" << endl;
1664 }
1665 isomorph_global *IG = (isomorph_global *) data;
1666
1667 //f_memory_debug = TRUE;
1668 Nb_orbits = NEW_int(Iso->Reps->count * 2);
1669 Down_orbit_identify = NEW_pint(Iso->Reps->count);
1670 for (orbit = 0; orbit < Iso->Reps->count; orbit++) {
1671
1672 int cnt_orbits, cnt_special_orbits;
1673 int *special_orbit_identify;
1674
1675 IG->compute_down_orbits_for_isomorphism_type(
1676 Iso, orbit, cnt_orbits, cnt_special_orbits,
1677 special_orbit_identify, verbose_level - 1);
1678
1679 if (f_vv) {
1680 cout << "callback_compute_down_orbits_worker orbit "
1681 << orbit << " / " << Iso->Reps->count
1682 << " cnt_orbits=" << cnt_orbits
1683 << " cnt_special_orbits=" << cnt_special_orbits << endl;
1684 }
1685 Nb_orbits[orbit * 2 + 0] = cnt_orbits;
1686 Nb_orbits[orbit * 2 + 1] = cnt_special_orbits;
1687 Down_orbit_identify[orbit] = special_orbit_identify;
1688
1689 nb_orbits += cnt_orbits;
1690 nb_special_orbits += cnt_special_orbits;
1691
1692#if 0
1693 if (orbit && ((orbit % 100) == 0)) {
1694 registry_dump_sorted();
1695 }
1696#endif
1697
1698 }
1699
1700 {
1701 string fname;
1702
1703 fname.assign("Nb_down_orbits.csv");
1704 Fio.int_matrix_write_csv(fname, Nb_orbits, Iso->Reps->count, 2);
1705 }
1706
1707 if (f_v) {
1708 cout << "callback_compute_down_orbits_worker" << endl;
1709 cout << "nb_orbits=" << nb_orbits << endl;
1710 cout << "nb_special_orbits=" << nb_special_orbits << endl;
1711 }
1712
1713 Down_identify = NEW_int(nb_special_orbits * 3);
1714 h = 0;
1715 for (orbit = 0; orbit < Iso->Reps->count; orbit++) {
1716 for (i = 0; i < Nb_orbits[orbit * 2 + 1]; i++) {
1717 idx = Down_orbit_identify[orbit][i];
1718 Down_identify[h * 3 + 0] = orbit;
1719 Down_identify[h * 3 + 1] = i;
1720 Down_identify[h * 3 + 2] = idx;
1721 h++;
1722 }
1723 }
1724
1725 {
1726 string fname;
1727
1728 fname.assign("Down_identify.csv");
1729 Fio.int_matrix_write_csv(fname, Down_identify, nb_special_orbits, 3);
1730 }
1731
1732 for (orbit = 0; orbit < Iso->Reps->count; orbit++) {
1733 FREE_int(Down_orbit_identify[orbit]);
1734 }
1735 FREE_pint(Down_orbit_identify);
1736 FREE_int(Down_identify);
1737 FREE_int(Nb_orbits);
1738 if (f_v) {
1739 cout << "callback_compute_down_orbits_worker done" << endl;
1740 }
1741}
1742
1743
1744
1745}}
1746
1747
1748
a collection of functions related to sorted vectors
void rearrange_subset_lint_all(int n, int k, long int *set, long int *subset, long int *rearranged_set, int verbose_level)
Definition: sorting.cpp:663
void read_spreadsheet(std::string &fname, int verbose_level)
void int_matrix_write_csv(std::string &fname, int *M, int m, int n)
Definition: file_io.cpp:1300
void int_matrix_write_csv_with_labels(std::string &fname, int *M, int m, int n, const char **column_label)
Definition: file_io.cpp:1429
void read_set_from_file(std::string &fname, long int *&the_set, int &set_size, int verbose_level)
Definition: file_io.cpp:2374
a class to represent arbitrary precision integers
Definition: ring_theory.h:366
a permutation group in a fixed action.
Definition: actions.h:99
void element_print_for_make_element(void *elt, std::ostream &ost)
Definition: action_cb.cpp:409
void element_one(void *elt, int verbose_level)
Definition: action_cb.cpp:224
void element_write_file_fp(int *Elt, std::ofstream &fp, int verbose_level)
Definition: action_cb.cpp:587
void group_order(ring_theory::longinteger_object &go)
Definition: action.cpp:2223
void element_write_file(int *Elt, std::string &fname, int verbose_level)
Definition: action_cb.cpp:621
a permutation group represented via a stabilizer chain
Definition: groups.h:1273
void extract_strong_generators_in_order(data_structures_groups::vector_ge &SG, int *tl, int verbose_level)
Definition: sims.cpp:1704
void group_order(ring_theory::longinteger_object &go)
Definition: sims.cpp:951
a strong generating set for a permutation group with respect to a fixed action
Definition: groups.h:1703
void init_from_sims(groups::sims *S, int verbose_level)
void report_data_in_source_code_inside_tex(isomorph &Iso, const char *prefix, char *label_of_structure_plural, std::ostream &f, int verbose_level)
void compute_down_orbits(int size, std::string &prefix_classify, std::string &prefix, int level, int verbose_level)
void read_solution_files(int size, std::string &prefix_classify, std::string &prefix_iso, int level, std::string *fname, int nb_files, 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_from_memory(int size, std::string &prefix_classify, std::string &prefix_iso, int level, int **Solutions, int *Nb_sol, int verbose_level)
void read_solution_files_from_clique_finder(int size, std::string &prefix_classify, std::string &prefix_iso, int level, std::string *fname, int nb_files, int verbose_level)
void init(actions::action *A_base, actions::action *A, poset_classification::poset_classification *gen, int verbose_level)
void identify_table(int size, std::string &prefix_classify, std::string &prefix_iso, int level, int nb_rows, long int *Table, int *Iso_type, int verbose_level)
void report_data_in_source_code_inside_tex_with_selection(isomorph &Iso, const char *prefix, char *label_of_structure_plural, std::ostream &fp, int selection_size, int *selection, int verbose_level)
void worker(int size, std::string &prefix_classify, std::string &prefix_iso, void(*work_callback)(isomorph *Iso, void *data, int verbose_level), void *work_data, int level, int verbose_level)
void build_db(int size, std::string &prefix_classify, std::string &prefix_iso, int level, int verbose_level)
void read_statistic_files(int size, std::string &prefix_classify, std::string &prefix, int level, std::string *fname, int nb_files, int verbose_level)
poset_classification::poset_classification * gen
Definition: isomorph.h:796
void compute_down_orbits_for_isomorphism_type(isomorph *Iso, int orbit, int &cnt_orbits, int &cnt_special_orbits, int *&special_orbit_identify, int verbose_level)
void identify(int size, std::string &prefix_classify, std::string &prefix_iso, int level, int identify_nb_files, std::string *fname, int *Iso_type, int f_save, int verbose_level)
void compute_orbits(int size, std::string &prefix_classify, std::string &prefix_iso, int level, int verbose_level)
void read_solution_files_from_clique_finder_case_by_case(int size, std::string &prefix_classify, std::string &prefix_iso, int level, std::string *fname, long int *list_of_cases, int nb_files, int verbose_level)
void classification_graph(int size, std::string &prefix_classify, std::string &prefix_iso, int level, int verbose_level)
void isomorph_testing(int size, std::string &prefix_classify, std::string &prefix_iso, int level, int f_play_back, std::string &old_event_file, int print_mod, int verbose_level)
classification of combinatorial objects using subobjects
Definition: isomorph.h:30
int identify(long int *set, int f_implicit_fusion, int verbose_level)
void write_classification_matrix(int verbose_level)
void read_solutions_from_clique_finder(int nb_files, std::string *fname, int verbose_level)
void isomorph_testing(int t0, int f_play_back, std::string &play_back_file_name, int f_implicit_fusion, int print_mod, int verbose_level)
int find_extension_easy_new(long int *set, int case_nb, int &idx, int verbose_level)
int trace_set(long int *canonical_set, int *transporter, int f_implicit_fusion, int &f_failure_to_find_point, 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 write_classification_graph(int verbose_level)
void read_starter_nb_orbits(int verbose_level)
int identify_solution_relaxed(long int *set, int *transporter, int f_implicit_fusion, int &orbit_no, int &f_failure_to_find_point, 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)
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 setup_and_open_level_database(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 init(std::string &prefix, actions::action *A_base, actions::action *A, poset_classification::poset_classification *gen, int size, int level, int f_use_database_for_starter, int f_implicit_fusion, int verbose_level)
Definition: isomorph.cpp:280
void create_level_database(int level, 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 orbits_of_stabilizer(int verbose_level)
Definition: isomorph.cpp:565
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 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)
to control the behavior of the poset classification algorithm
void init_subset_lattice(actions::action *A, actions::action *A2, groups::strong_generators *Strong_gens, int verbose_level)
void orbits_on_k_sets(poset_classification_control *Control, int k, long int *&orbit_reps, int &nb_orbits, int verbose_level)
#define Lint_vec_copy(A, B, C)
Definition: foundations.h:694
#define FREE_OBJECTS(p)
Definition: foundations.h:652
#define Lint_matrix_print(A, B, C)
Definition: foundations.h:708
#define FREE_int(p)
Definition: foundations.h:640
#define Int_vec_zero(A, B)
Definition: foundations.h:713
#define NEW_pint(n)
Definition: foundations.h:627
#define NEW_OBJECT(type)
Definition: foundations.h:638
#define Lint_vec_print(A, B, C)
Definition: foundations.h:686
#define FREE_OBJECT(p)
Definition: foundations.h:651
#define NEW_int(n)
Definition: foundations.h:625
#define NEW_OBJECTS(type, n)
Definition: foundations.h:639
#define TRUE
Definition: foundations.h:231
#define FALSE
Definition: foundations.h:234
#define Int_vec_copy(A, B, C)
Definition: foundations.h:693
#define FREE_lint(p)
Definition: foundations.h:642
#define NEW_lint(n)
Definition: foundations.h:628
#define FREE_pint(p)
Definition: foundations.h:641
the orbiter library for the classification of combinatorial objects