Orbiter 2022
Combinatorial Objects
isomorph.h
Go to the documentation of this file.
1// isomorph.h
2//
3// Anton Betten
4//
5// moved here from top_level.h: July 28, 2018
6// top_level started: September 23 2010
7// based on global.h, which was taken from reader.h: 3/22/09
8
9
10
11#ifndef ORBITER_SRC_LIB_TOP_LEVEL_ISOMORPH_ISOMORPH_H_
12#define ORBITER_SRC_LIB_TOP_LEVEL_ISOMORPH_ISOMORPH_H_
13
14
15namespace orbiter {
16namespace layer4_classification {
17
18
19// #############################################################################
20// isomorph.cpp
21// isomorph_testing.cpp
22// isomorph_database.cpp
23// isomorph_trace.cpp
24// isomorph_files.cpp
25// #############################################################################
26
28
29
30class isomorph {
31public:
32 int size;
33 int level;
37
38
39 std::string prefix;
40 std::string prefix_invariants;
41 std::string prefix_tex;
42
43 std::string fname_staborbits;
44 std::string fname_case_len;
45 std::string fname_statistics;
47 std::string fname_db1;
48 std::string fname_db2;
49 std::string fname_db3;
50 std::string fname_db4;
51 std::string fname_db5;
52
53 std::string fname_db_level;
56 std::string fname_db_level_ge;
57
58 std::string event_out_fname;
60
62 // the number of orbits at 'level',
63 // previously called nb_cases
64
65 int N;
66 // the number of solutions,
67 // computed in init_cases_from_file
68 // or read from file in read_case_len
69
70
71
73 // [nb_starter + 1] the beginning of solutions
74 // belonging to a given starter
75 // previously called case_first
77 // [nb_starter + 1] the number of solutions
78 // belonging to a given starter
79 // previously called case_len
80
81
82 // solution_first and solution_len are initialized in
83 // isomorph_files.cpp
84 // isomorph::init_solutions
85 // isomorph::count_solutions_from_clique_finder
86 // isomorph::count_solutions
87
88 // they are written to file in
89 // isomorph::write_solution_first_and_len()
90
91
92
94 // [N] starter_number[i] = j means that
95 // solution i belongs to starter j
96 // previously called case_number
97
98
99
100
101
102 // from the summary file (and only used in isomorph_files.cpp)
104 // [nb_starter]
106 // [nb_starter]
108 // [nb_starter]
110 // [nb_starter]
111
112
113 actions::action *A_base;
114 // A Betten 3/18/2013
115 // the action in which we represent the group
116 // do not free
117 actions::action *A;
118 // the action in which we act on the set
119 // do not free
120
121
123 // do not free
124
125
126
128 // Number of flag orbits.
129 // Overall number of orbits of stabilizers
130 // of starters on the solutions
131 // computed in orbits_of_stabilizer,
132 // which in turn calls orbits_of_stabilizer_case
133 // for each starter
134 // orbits_of_stabilizer_case takes the
135 // strong generators from the
136 // generator data structure
137 // For computing the orbits, induced_action_on_sets
138 // is used to establish an action on sets.
139
141 // Used in isomorph_testing:
142 // The flag orbit we are currently testing.
143 // In the end, this will become the representative of a
144 // n e w isomorphism type
145
147 // [nb_orbits + 1]
148 // orbit_fst[i] is the beginning of solutions
149 // associated to the i-th flag orbit
150 // in the sorted list of solutions
151 // allocated in isomorph::read_orbit_data()
152
154 // [nb_orbits]
155 // orbit_len[i] is the length of the i-th flag orbit
156 // allocated in isomorph::read_orbit_data()
157
158
160 // [N]
161 // orbit_number[i] is the flag orbit
162 // containing the i-th solution
163 // in the original labeling
164 // allocated in isomorph::read_orbit_data()
165
166
168 // [N]
169 // orbit_perm[i] is the original label
170 // of the i-th solution in the ordered list
171 // we often see id = orbit_perm[orbit_fst[orbit_no]];
172 // this is the index of the first solution
173 // associated to flag orbit orbit_no, for instance
174 // allocated in isomorph::read_orbit_data()
175
177 // [N]
178 // orbit_perm_inv is the inverse of orbit_perm
179 // allocated in isomorph::read_orbit_data()
180
181
182 int *schreier_vector; // [N]
183 // allocated in isomorph::read_orbit_data()
184 int *schreier_prev; // [N]
185 // allocated in isomorph::read_orbit_data()
186
187
188 // added Dec 25, 2012:
189 // computed in isomorph.cpp isomorph::orbits_of_stabilizer
190 // these variables are not used ?? (Oct 30, 2014)
191 // They are used, for instance in isomorph_testing.cpp
192 // isomorph::write_classification_graph (May 3, 2015)
194 // [nb_starter + 1]
195 // the beginning of flag orbits
196 // belonging to a given starter
198 // [nb_starter]
199 // the number of flag orbits belonging to a given starter
200
201
202
203
205
207
208
209
210
212
213 // for iso_test:
214
215
216 std::ofstream *fp_event_out;
217
218 actions::action *AA;
219 actions::action *AA_perm;
220 actions::action *AA_on_k_subsets;
221 data_structures_groups::union_find *UF;
222 data_structures_groups::vector_ge *gens_perm;
223
225 int *subset;
226 long int *subset_witness;
227 long int *rearranged_set;
229 long int *canonical_set;
230 long int *tmp_set;
232
234 int NCK;
235 ring_theory::longinteger_object stabilizer_group_order;
236
239 // int[stabilizer_nb_generators][size]
240
241
246
247
248 // temporary data used in identify_solution
250 long int *tmp_set1;
251 long int *tmp_set2;
252 long int *tmp_set3;
256 // temporary data used in trace_set_recursion
259 // temporary data used in trace_set_recursion
262 // temporary data used in find_extension
264 // temporary data used in make_set_smaller
268 // temporary data used in orbit_representative
271 // temporary data used in handle_automorphism
273
274
275 // database access:
276 database *D1, *D2;
277 std::string fname_ge1;
278 std::string fname_ge2;
279 //FILE *fp_ge1, *fp_ge2; // read access
280 std::ifstream *fp_ge1;
281 std::ifstream *fp_ge2;
282 Vector *v;
283 database *DB_sol;
286 int *hash_vs_id_hash; // sorted
289 long int *table_of_solutions; // [N * size]
290
291 // pointer only, do not free:
292 database *DB_level;
293 //FILE *fp_ge;
294 std::ifstream *fp_ge; // either fg_ge1 or fp_ge2
295
296 groups::sims *stabilizer_recreated;
297
298
300 int iso_cnt, groups::sims *Stab, groups::schreier &Orb,
301 long int *data, void *print_set_data, int verbose_level);
303
304
305 // some statistics:
307
308 // isomorph.cpp
309 isomorph();
310 void null();
311 ~isomorph();
312 void free();
313 void null_tmp_data();
314 void allocate_tmp_data();
315 void free_tmp_data();
316 void init(std::string &prefix,
317 actions::action *A_base, actions::action *A,
319 int size, int level,
321 int f_implicit_fusion, int verbose_level);
322 void init_solution(int verbose_level);
323 void load_table_of_solutions(int verbose_level);
324 void init_starter_number(int verbose_level);
327 void orbits_of_stabilizer(int verbose_level);
328 void orbits_of_stabilizer_case(int the_case,
329 data_structures_groups::vector_ge &gens, int verbose_level);
330 void orbit_representative(int i, int &i0,
331 int &orbit, int *transporter, int verbose_level);
332 // slow because it calls load_strong_generators
333 void test_orbit_representative(int verbose_level);
334 void test_identify_solution(int verbose_level);
335 void compute_stabilizer(groups::sims *&Stab, int verbose_level);
336 void test_compute_stabilizer(int verbose_level);
337 void test_memory();
338 void test_edges(int verbose_level);
339 int test_edge(int n1, long int *subset1,
340 int *transporter, int verbose_level);
342 std::string &prefix, int verbose_level);
343 // Calls gen->read_level_file_binary
344 // for all levels i from 0 to level
345 // Uses letter a files for i from 0 to level - 1
346 // and letter b file for i = level.
347 // If gen->f_starter is TRUE,
348 // we start from i = gen->starter_size instead.
349 // Finally, it computes nb_starter.
350 void compute_nb_starter(int level, int verbose_level);
351 void print_node_local(int level, int node_local);
352 void print_node_global(int level, int node_global);
353 void test_hash(int verbose_level);
354 void compute_Ago_Ago_induced(ring_theory::longinteger_object *&Ago,
355 ring_theory::longinteger_object *&Ago_induced, int verbose_level);
356 void init_high_level(actions::action *A,
358 int size, std::string &prefix_classify, std::string &prefix,
359 int level, int verbose_level);
360 void get_orbit_transversal(data_structures_groups::orbit_transversal *&T,
361 int verbose_level);
362
363
364
365 // isomorph_testing.cpp
366 void iso_test_init(int verbose_level);
367 void iso_test_init2(int verbose_level);
368 void probe(int flag_orbit, int subset_rk,
369 int f_implicit_fusion, int verbose_level);
370 void isomorph_testing(int t0, int f_play_back,
371 std::string &play_back_file_name,
372 int f_implicit_fusion, int print_mod, int verbose_level);
373 void write_classification_matrix(int verbose_level);
374 void write_classification_graph(int verbose_level);
375 void decomposition_matrix(int verbose_level);
376 void compute_down_link(int *&down_link, int verbose_level);
377 void do_iso_test(int t0, groups::sims *&Stab,
378 int f_play_back, std::ifstream *play_back_file,
379 int &f_eof, int print_mod,
380 int f_implicit_fusion, int verbose_level);
381 int next_subset(int t0,
382 int &f_continue, groups::sims *Stab, long int *data,
383 int f_play_back, std::ifstream *play_back_file, int &f_eof,
384 int verbose_level);
385 void process_rearranged_set(groups::sims *Stab, long int *data,
386 int f_implicit_fusion, int verbose_level);
387 int is_minimal(int verbose_level);
389 void stabilizer_action_init(int verbose_level);
390 // Computes the permutations of the set
391 // that are induced by the
392 // generators for the stabilizer in AA
393 void stabilizer_action_add_generator(int *Elt, int verbose_level);
394 void print_statistics_iso_test(int t0, groups::sims *Stab);
395 int identify(long int *set, int f_implicit_fusion,
396 int verbose_level);
397 int identify_database_is_open(long int *set,
398 int f_implicit_fusion, int verbose_level);
399 void induced_action_on_set_basic(groups::sims *S,
400 long int *set, int verbose_level);
401 void induced_action_on_set(groups::sims *S,
402 long int *set, int verbose_level);
403 // Called by do_iso_test and print_isomorphism_types
404 // Creates the induced action on the set from the given action.
405 // The given action is gen->A2
406 // The induced action is computed to AA
407 // The set is in set[].
408 // Allocates a n e w union_find data structure and initializes it
409 // using the generators in S.
410 // Calls action::induced_action_by_restriction()
411 int handle_automorphism(long int *set,
412 groups::sims *Stab, int *Elt, int verbose_level);
413
414 // isomorph_database.cpp
415 void setup_and_open_solution_database(int verbose_level);
416 void setup_and_create_solution_database(int verbose_level);
417 void close_solution_database(int verbose_level);
418 void setup_and_open_level_database(int verbose_level);
419 // Called from do_iso_test, identify and test_hash
420 // (Which are all in isomorph_testing.cpp)
421 // Calls init_DB for D and D.open.
422 // Calls init_DB_level for D1 and D2 and D1->open and D2->open.
423 // Calls fopen for fp_ge1 and fp_ge2.
424 void close_level_database(int verbose_level);
425 // Closes D1, D2, fp_ge1, fp_ge2.
426 void prepare_database_access(int cur_level, int verbose_level);
427 // sets D to be D1 or D2, depending on cur_level
428 // Called from
429 // load_strong_generators
430 // trace_next_point_database
431 void init_DB_sol(int verbose_level);
432 // We assume that the starter is of size 5 and that
433 // fields 3-8 are the starter
434 void add_solution_to_database(long int *data,
435 int nb, int id, int no,
436 int nb_solutions, int h, uint_4 &datref,
437 int print_mod, int verbose_level);
438 void load_solution(int id, long int *data);
439 void load_solution_by_btree(int btree_idx,
440 int idx, int &id, long int *data);
441 int find_extension_easy(long int *set,
442 int case_nb, int &idx, int verbose_level);
443 // returns TRUE if found, FALSE otherwise
444 // Called from identify_solution
445 // Linear search through all solutions at a given starter.
446 // calls load solution for each of the solutions
447 // stored with the case and compares the vectors.
448 int find_extension_search_interval(long int *set,
449 int first, int len, int &idx,
450 int f_btree_idx, int btree_idx,
451 int f_through_hash, int verbose_level);
452 int find_extension_easy_old(long int *set,
453 int case_nb, int &idx, int verbose_level);
454 int find_extension_easy_new(long int *set,
455 int case_nb, int &idx, int verbose_level);
456 int open_database_and_identify_object(long int *set,
457 int *transporter,
458 int f_implicit_fusion, int verbose_level);
460 int verbose_level);
461 void create_level_database(int level, int verbose_level);
462 void load_strong_generators(int cur_level,
463 int cur_node_local,
464 data_structures_groups::vector_ge &gens,
465 ring_theory::longinteger_object &go,
466 int verbose_level);
467 // Called from compute_stabilizer and
468 // from orbit_representative
469 void load_strong_generators_oracle(int cur_level,
470 int cur_node_local,
471 data_structures_groups::vector_ge &gens,
472 ring_theory::longinteger_object &go,
473 int verbose_level);
474 void load_strong_generators_database(int cur_level,
475 int cur_node_local,
476 data_structures_groups::vector_ge &gens,
477 ring_theory::longinteger_object &go,
478 int verbose_level);
479 // Reads node cur_node_local (local index)
480 // from database D through btree 0
481 // Reads generators from file fp_ge
482
483 // isomorph_trace.cpp
484 int identify_solution_relaxed(long int *set, int *transporter,
485 int f_implicit_fusion, int &orbit_no,
486 int &f_failure_to_find_point,
487 int verbose_level);
488 // returns the orbit number corresponding to
489 // the canonical version of set and the extension.
490 // Calls trace_set and find_extension_easy.
491 // Called from process_rearranged_set
492 int identify_solution(long int *set, int *transporter,
493 int f_implicit_fusion, int &f_failure_to_find_point,
494 int verbose_level);
495 // returns the orbit number corresponding to
496 // the canonical version of set and the extension.
497 // Calls trace_set and find_extension_easy.
498 // If needed, calls make_set_smaller
499 int trace_set(long int *canonical_set, int *transporter,
500 int f_implicit_fusion, int &f_failure_to_find_point,
501 int verbose_level);
502 // returns the case number of the canonical set
503 // (local orbit number)
504 // Called from identify_solution and identify_solution_relaxed
505 // calls trace_set_recursion
506 void make_set_smaller(int case_nb_local,
507 long int *set, int *transporter, int verbose_level);
508 // Called from identify_solution.
509 // The goal is to produce a set that is lexicographically
510 // smaller than the current starter.
511 // To do this, we find an element that is less than
512 // the largest element in the current starter.
513 // There are two ways to find such an element.
514 // Either, the set already contains such an element,
515 // or one can produce such an element
516 // by applying an element in the
517 // stabilizer of the current starter.
518 int trace_set_recursion(int cur_level,
519 int cur_node_global,
520 long int *canonical_set, int *transporter,
521 int f_implicit_fusion,
522 int &f_failure_to_find_point, int verbose_level);
523 // returns the node in the generator that corresponds
524 // to the canonical_set.
525 // Called from trace_set.
526 // Calls trace_next_point and handle_extension.
527 int trace_next_point(int cur_level,
528 int cur_node_global,
529 long int *canonical_set, int *transporter,
530 int f_implicit_fusion,
531 int &f_failure_to_find_point, int verbose_level);
532 // Called from trace_set_recursion
533 // Calls oracle::trace_next_point_in_place
534 // and (possibly) trace_next_point_database
535 // Returns FALSE is the set becomes lexicographically smaller
536 int trace_next_point_database(int cur_level,
537 int cur_node_global,
538 long int *canonical_set, int *Elt_transporter,
539 int verbose_level);
540 // Returns FALSE is the set becomes lexicographically smaller
541 int handle_extension(int cur_level,
542 int cur_node_global,
543 long int *canonical_set, int *Elt_transporter,
544 int f_implicit_fusion,
545 int &f_failure_to_find_point, int verbose_level);
546 int handle_extension_database(int cur_level,
547 int cur_node_global,
548 long int *canonical_set, int *Elt_transporter,
549 int f_implicit_fusion,
550 int &f_failure_to_find_point,
551 int verbose_level);
552 int handle_extension_oracle(int cur_level,
553 int cur_node_global,
554 long int *canonical_set, int *Elt_transporter,
555 int f_implicit_fusion,
556 int &f_failure_to_find_point,
557 int verbose_level);
558 // Returns next_node_global at level cur_level + 1.
559 void apply_isomorphism_database(int cur_level,
560 int cur_node_global,
561 int current_extension, long int *canonical_set,
562 int *Elt_transporter, int ref,
563 int verbose_level);
564 void apply_isomorphism_oracle(int cur_level,
565 int cur_node_global,
566 int current_extension, long int *canonical_set,
567 int *Elt_transporter,
568 int verbose_level);
569
570
571 // isomorph_files.cpp
572 void init_solutions(int **Solutions,
573 int *Nb_sol, int verbose_level);
574 // Solutions[nb_starter], Nb_sol[nb_starter]
576 long int *list_of_cases, std::string *fname,
577 int verbose_level);
578 void count_solutions_from_clique_finder(int nb_files,
579 std::string *fname,
580 int verbose_level);
582 long int *list_of_cases, std::string *fname,
583 int verbose_level);
584 void read_solutions_from_clique_finder(int nb_files,
585 std::string *fname, int verbose_level);
586 void add_solutions_to_database(int *Solutions,
587 int the_case, int nb_solutions, int nb_solutions_total,
588 int print_mod, int &no,
589 int verbose_level);
590 void build_up_database(int nb_files, std::string *fname,
591 int f_has_final_test_function,
592 int (*final_test_function)(long int *data, int sz,
593 void *final_test_data, int verbose_level),
594 void *final_test_data,
595 int verbose_level);
597 int modulus, int level,
598 int f_collated, int base_split,
599 int f_get_statistics,
600 int f_has_final_test_function,
601 int (*final_test_function)(long int *data, int sz,
602 void *final_test_data, int verbose_level),
603 void *final_test_data,
604 int verbose_level);
606 int nb_Mod, int *Mod_r, int *Mod_split, int *Mod_base_split,
607 int level, int f_get_statistics,
608 int f_has_final_test_function,
609 int (*final_test_function)(long int *data, int sz,
610 void *final_test_data, int verbose_level),
611 void *final_test_data,
612 int verbose_level);
613 void count_solutions(int nb_files,
614 std::string *fname,
615 int f_get_statistics,
616 int f_has_final_test_function,
617 int (*final_test_function)(long int *data, int sz,
618 void *final_test_data, int verbose_level),
619 void *final_test_data,
620 int verbose_level);
621 void get_statistics(int nb_files, std::string *fname,
622 int verbose_level);
623 void write_statistics();
624 void evaluate_statistics(int verbose_level);
625 void count_solutions2(int nb_files, std::string *fname,
626 int &total_days, int &total_hours, int &total_minutes,
627 int f_has_final_test_function,
628 int (*final_test_function)(long int *data, int sz,
629 void *final_test_data, int verbose_level),
630 void *final_test_data,
631 int verbose_level);
634 void write_starter_nb_orbits(int verbose_level);
635 void read_starter_nb_orbits(int verbose_level);
636 void write_hash_and_datref_file(int verbose_level);
637 // Writes the file 'fname_hash_and_datref'
638 // containing id_to_hash[] and id_to_datref[]
639 void read_hash_and_datref_file(int verbose_level);
640 // Reads the file 'fname_hash_and_datref'
641 // containing id_to_hash[] and id_to_datref[]
642 // Also initializes hash_vs_id_hash and hash_vs_id_id
643 // Called from init_solution
644 void print_hash_vs_id();
645 void write_orbit_data(int verbose_level);
646 // Writes the file 'fname_staborbits'
647 void read_orbit_data(int verbose_level);
648 // Reads from the file 'fname_staborbits'
649 // Reads nb_orbits, N,
650 // orbit_fst[nb_orbits + 1]
651 // orbit_len[nb_orbits]
652 // orbit_number[N]
653 // orbit_perm[N]
654 // schreier_vector[N]
655 // schreier_prev[N]
656 // and computed orbit_perm_inv[N]
657 void print_isomorphism_types(int f_select,
658 int select_first, int select_len,
659 int verbose_level);
660 // Calls print_set_function (if available)
661 void induced_action_on_set_and_kernel(std::ostream &file,
662 actions::action *A, groups::sims *Stab, int size, long int *set,
663 int verbose_level);
664 void handle_event_files(int nb_event_files,
665 const char **event_file_name, int verbose_level);
666 void read_event_file(const char *event_file_name,
667 int verbose_level);
668 void skip_through_event_file(std::ifstream &f,
669 int verbose_level);
670 void skip_through_event_file1(std::ifstream &f,
671 int case_no, int orbit_no, int verbose_level);
672 void event_file_completed_cases(const char *event_file_name,
673 int &nb_completed_cases, int *completed_cases,
674 int verbose_level);
675 void event_file_read_case(const char *event_file_name,
676 int case_no, int verbose_level);
677 void event_file_read_case1(std::ifstream &f,
678 int case_no, int verbose_level);
680 std::ifstream *play_back_file,
681 int &f_eof, int verbose_level);
683 std::string &prefix_classify, int verbose_level);
684
685
686};
687
688
689// #############################################################################
690// isomorph_arguments.cpp
691// #############################################################################
692
694
695
697public:
699
707
709 //int read_statistics_split_m;
710
714 int f_event_file; // -e <event file> option
715 std::string event_file_name;
723
725 std::string prefix_iso;
726
727 actions::action *A;
728 actions::action *A2;
732
735
737
738 void (*callback_report)(isomorph *Iso, void *data,
739 int verbose_level);
740 void (*callback_subset_orbits)(isomorph *Iso, void *data,
741 int verbose_level);
743
745 int (*final_test_function)(long int *data, int sz,
746 void *final_test_data, int verbose_level);
748
751 void null();
752 void freeself();
753 int read_arguments(int argc, std::string *argv,
754 int verbose_level);
755 void init(actions::action *A, actions::action *A2,
757 int target_size,
760 void (*callback_report)(isomorph *Iso, void *data,
761 int verbose_level),
762 void (*callback_subset_orbits)(isomorph *Iso, void *data,
763 int verbose_level),
764 void *callback_data,
765 int verbose_level);
766 //void execute(int verbose_level);
767
768};
769
771
773 long int *the_set;
776};
777
778
779
780
781// #############################################################################
782// isomorph_global.cpp
783// #############################################################################
784
785
787
788
790
791public:
792
793 actions::action *A_base;
794 actions::action *A;
795
797
798
801 void init(actions::action *A_base, actions::action *A,
803 int verbose_level);
805 int size, std::string &prefix_classify,
806 std::string &prefix, int level,
807 std::string *fname, int nb_files,
808 int verbose_level);
809 void build_db(
810 int size, std::string &prefix_classify,
811 std::string &prefix_iso, int level,
812 int verbose_level);
814 int size, std::string &prefix_classify,
815 std::string &prefix_iso, int level,
816 std::string *fname, int nb_files,
817 int f_has_final_test_function,
818 int (*final_test_function)(long int *data, int sz,
819 void *final_test_data, int verbose_level),
820 void *final_test_data,
821 int verbose_level);
823 int size, std::string &prefix_classify,
824 std::string &prefix_iso, int level,
825 int **Solutions, int *Nb_sol, int verbose_level);
827 int size, std::string &prefix_classify, std::string &prefix_iso, int level,
828 std::string *fname, long int *list_of_cases, int nb_files, int verbose_level);
830 int size, std::string &prefix_classify, std::string &prefix_iso, int level,
831 std::string *fname, int nb_files, int verbose_level);
832 void compute_orbits(
833 int size, std::string &prefix_classify,
834 std::string &prefix_iso, int level, int verbose_level);
835 void isomorph_testing(
836 int size, std::string &prefix_classify,
837 std::string &prefix_iso, int level,
838 int f_play_back, std::string &old_event_file,
839 int print_mod, int verbose_level);
841 int size, std::string &prefix_classify,
842 std::string &prefix_iso, int level,
843 int verbose_level);
844 void identify(
845 int size, std::string &prefix_classify,
846 std::string &prefix_iso, int level,
847 int identify_nb_files, std::string *fname, int *Iso_type,
848 int f_save, int verbose_level);
849 void identify_table(
850 int size, std::string &prefix_classify,
851 std::string &prefix_iso, int level,
852 int nb_rows, long int *Table, int *Iso_type,
853 int verbose_level);
854 void worker(
855 int size, std::string &prefix_classify, std::string &prefix_iso,
856 void (*work_callback)(isomorph *Iso, void *data, int verbose_level),
857 void *work_data,
858 int level, int verbose_level);
860 int size, std::string &prefix_classify, std::string &prefix,
861 int level, int verbose_level);
863 isomorph *Iso, int orbit,
864 int &cnt_orbits, int &cnt_special_orbits,
865 int *&special_orbit_identify, int verbose_level);
867 isomorph &Iso, const char *prefix,
868 char *label_of_structure_plural, std::ostream &f,
869 int verbose_level);
871 isomorph &Iso, const char *prefix,
872 char *label_of_structure_plural, std::ostream &fp,
873 int selection_size, int *selection,
874 int verbose_level);
875
876};
877
878
879
880// #############################################################################
881// representatives.cpp
882// #############################################################################
883
885
886
887
889public:
890 actions::action *A;
891
892 std::string prefix;
893 std::string fname_rep;
894 std::string fname_stabgens;
895 std::string fname_fusion;
896 std::string fname_fusion_ge;
897
898
899
900 // flag orbits:
902 int *fusion; // [nb_objects]
903 // fusion[i] == -2 means that the flag orbit i
904 // has not yet been processed by the
905 // isomorphism testing procedure.
906 // fusion[i] = i means that flag orbit [i]
907 // in an orbit representative
908 // Otherwise, fusion[i] is an earlier flag_orbit,
909 // and handle[i] is a group element that maps
910 // to it
911 int *handle; // [nb_objects]
912 // handle[i] is only relevant if fusion[i] != i,
913 // i.e., if flag orbit i is not a representative
914 // of an isomorphism type.
915 // In this case, handle[i] is the (handle of a)
916 // group element moving flag orbit i to flag orbit fusion[i].
917
918
919 // classified objects:
920 int count;
921 int *rep; // [count]
922 groups::sims **stab; // [count]
923
924
925
926 //char *elt;
927 int *Elt1;
928 int *tl; // [A->base_len]
929
933
934
936 void null();
938 void free();
939 void init(actions::action *A, int nb_objects, std::string &prefix, int verbose_level);
940 void write_fusion(int verbose_level);
941 void read_fusion(int verbose_level);
942 void write_representatives_and_stabilizers(int verbose_level);
943 void read_representatives_and_stabilizers(int verbose_level);
944 void save(int verbose_level);
945 void load(int verbose_level);
948};
949
950
951
952
953
954}}
955
956
957#endif /* ORBITER_SRC_LIB_TOP_LEVEL_ISOMORPH_ISOMORPH_H_ */
958
959
960
DISCRETA class for a database.
Definition: discreta.h:1525
command line arguments to control the lifting via exact cover
Definition: solver.h:155
auxiliary class for class isomorph
Definition: isomorph.h:696
int read_arguments(int argc, std::string *argv, int verbose_level)
int(* final_test_function)(long int *data, int sz, void *final_test_data, int verbose_level)
Definition: isomorph.h:745
poset_classification::poset_classification_control * Control
Definition: isomorph.h:731
poset_classification::poset_classification * gen
Definition: isomorph.h:729
void init(actions::action *A, actions::action *A2, poset_classification::poset_classification *gen, int target_size, poset_classification::poset_classification_control *Control, exact_cover_arguments *ECA, void(*callback_report)(isomorph *Iso, void *data, int verbose_level), void(*callback_subset_orbits)(isomorph *Iso, void *data, int verbose_level), void *callback_data, int verbose_level)
void(* callback_subset_orbits)(isomorph *Iso, void *data, int verbose_level)
Definition: isomorph.h:740
void(* callback_report)(isomorph *Iso, void *data, int verbose_level)
Definition: isomorph.h:738
auxiliary class for class isomorph
Definition: isomorph.h:789
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 trace_set_recursion(int cur_level, int cur_node_global, long int *canonical_set, int *transporter, int f_implicit_fusion, int &f_failure_to_find_point, 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)
int identify(long int *set, int f_implicit_fusion, 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 write_classification_matrix(int verbose_level)
data_structures_groups::union_find * UF
Definition: isomorph.h:221
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 isomorph_testing(int t0, int f_play_back, std::string &play_back_file_name, int f_implicit_fusion, int print_mod, 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)
int handle_automorphism(long int *set, groups::sims *Stab, int *Elt, 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)
ring_theory::longinteger_object stabilizer_group_order
Definition: isomorph.h:235
int identify_solution(long int *set, int *transporter, int f_implicit_fusion, int &f_failure_to_find_point, 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)
int find_extension_search_interval(long int *set, int first, int len, int &idx, int f_btree_idx, int btree_idx, int f_through_hash, int verbose_level)
void compute_Ago_Ago_induced(ring_theory::longinteger_object *&Ago, ring_theory::longinteger_object *&Ago_induced, int verbose_level)
Definition: isomorph.cpp:1642
void write_classification_graph(int verbose_level)
void probe(int flag_orbit, int subset_rk, int f_implicit_fusion, int verbose_level)
void test_orbit_representative(int verbose_level)
Definition: isomorph.cpp:1074
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)
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 make_set_smaller(int case_nb_local, long int *set, int *transporter, int verbose_level)
void load_strong_generators_database(int cur_level, int cur_node_local, data_structures_groups::vector_ge &gens, ring_theory::longinteger_object &go, int verbose_level)
void read_everything_including_classification(std::string &prefix_classify, int verbose_level)
void load_solution(int id, long int *data)
int find_extension_easy(long int *set, int case_nb, int &idx, int verbose_level)
void print_node_local(int level, int node_local)
Definition: isomorph.cpp:1584
void test_edges(int verbose_level)
Definition: isomorph.cpp:1394
void init_solution(int verbose_level)
Definition: isomorph.cpp:418
void apply_isomorphism_oracle(int cur_level, int cur_node_global, int current_extension, long int *canonical_set, int *Elt_transporter, int verbose_level)
void induced_action_on_set(groups::sims *S, long int *set, int verbose_level)
void test_identify_solution(int verbose_level)
Definition: isomorph.cpp:1112
void compute_nb_starter(int level, int verbose_level)
Definition: isomorph.cpp:1572
void load_strong_generators(int cur_level, int cur_node_local, data_structures_groups::vector_ge &gens, ring_theory::longinteger_object &go, int verbose_level)
void orbits_of_stabilizer_case(int the_case, data_structures_groups::vector_ge &gens, int verbose_level)
Definition: isomorph.cpp:813
void read_event_file(const char *event_file_name, int verbose_level)
void print_statistics_iso_test(int t0, groups::sims *Stab)
void orbit_representative(int i, int &i0, int &orbit, int *transporter, int verbose_level)
Definition: isomorph.cpp:1006
void read_hash_and_datref_file(int verbose_level)
int test_edge(int n1, long int *subset1, int *transporter, int verbose_level)
Definition: isomorph.cpp:1460
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 compute_down_link(int *&down_link, int verbose_level)
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 prepare_database_access(int cur_level, int verbose_level)
void write_starter_nb_orbits(int verbose_level)
void setup_and_create_solution_database(int verbose_level)
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 init_high_level(actions::action *A, poset_classification::poset_classification *gen, int size, std::string &prefix_classify, std::string &prefix, int level, int verbose_level)
Definition: isomorph.cpp:1692
void handle_event_files(int nb_event_files, const char **event_file_name, int verbose_level)
void apply_isomorphism_database(int cur_level, int cur_node_global, int current_extension, long int *canonical_set, int *Elt_transporter, int ref, int verbose_level)
void stabilizer_action_add_generator(int *Elt, int verbose_level)
void create_level_database(int level, int verbose_level)
void test_compute_stabilizer(int verbose_level)
Definition: isomorph.cpp:1338
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 compute_stabilizer(groups::sims *&Stab, int verbose_level)
Definition: isomorph.cpp:1172
void process_rearranged_set(groups::sims *Stab, long int *data, int f_implicit_fusion, int verbose_level)
void init_solutions(int **Solutions, int *Nb_sol, int verbose_level)
int trace_next_point(int cur_level, int cur_node_global, long int *canonical_set, int *transporter, int f_implicit_fusion, int &f_failure_to_find_point, int verbose_level)
void load_table_of_solutions(int verbose_level)
Definition: isomorph.cpp:433
void load_solution_by_btree(int btree_idx, int idx, int &id, long int *data)
int handle_extension_oracle(int cur_level, int cur_node_global, long int *canonical_set, int *Elt_transporter, int f_implicit_fusion, int &f_failure_to_find_point, int verbose_level)
int next_subset(int t0, int &f_continue, groups::sims *Stab, long int *data, int f_play_back, std::ifstream *play_back_file, int &f_eof, 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)
void induced_action_on_set_basic(groups::sims *S, long int *set, int verbose_level)
void get_orbit_transversal(data_structures_groups::orbit_transversal *&T, int verbose_level)
Definition: isomorph.cpp:1798
int trace_next_point_database(int cur_level, int cur_node_global, long int *canonical_set, int *Elt_transporter, int verbose_level)
void init_DB_level(layer2_discreta::database &D, int level, int verbose_level)
void orbits_of_stabilizer(int verbose_level)
Definition: isomorph.cpp:565
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 load_strong_generators_oracle(int cur_level, int cur_node_local, data_structures_groups::vector_ge &gens, ring_theory::longinteger_object &go, int verbose_level)
int find_extension_easy_old(long int *set, int case_nb, int &idx, 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 identify_database_is_open(long int *set, int f_implicit_fusion, int verbose_level)
void skip_through_event_file1(std::ifstream &f, int case_no, int orbit_no, int verbose_level)
int handle_extension_database(int cur_level, int cur_node_global, long int *canonical_set, int *Elt_transporter, int f_implicit_fusion, int &f_failure_to_find_point, int verbose_level)
data_structures_groups::vector_ge * gens_perm
Definition: isomorph.h:222
int handle_extension(int cur_level, int cur_node_global, long int *canonical_set, int *Elt_transporter, int f_implicit_fusion, int &f_failure_to_find_point, int verbose_level)
void do_iso_test(int t0, groups::sims *&Stab, int f_play_back, std::ifstream *play_back_file, int &f_eof, int print_mod, int f_implicit_fusion, int verbose_level)
int open_database_and_identify_object(long int *set, int *transporter, int f_implicit_fusion, int verbose_level)
int next_subset_play_back(int &subset_rank, std::ifstream *play_back_file, int &f_eof, int verbose_level)
void print_node_global(int level, int node_global)
Definition: isomorph.cpp:1592
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
auxiliary class for class isomorph
Definition: isomorph.h:888
void write_representatives_and_stabilizers(int verbose_level)
void read_representatives_and_stabilizers(int verbose_level)
void init(actions::action *A, int nb_objects, std::string &prefix, int verbose_level)
unsigned int uint_4
Definition: foundations.h:184
the orbiter library for the classification of combinatorial objects
auxiliary class to pass case specific data to the function isomorph_worker
Definition: isomorph.h:772