14namespace layer5_applications {
18static int spread_table_with_selection_compare_func(
void *data,
int i,
int j,
void *extra_data);
19static void spread_table_with_selection_swap_func(
void *data,
int i,
int j,
void *extra_data);
87 std::string &select_spread_text,
88 std::string &path_to_spread_tables,
91 int f_v = (verbose_level >= 1);
94 cout <<
"spread_table_with_selection::init" << endl;
100 cout <<
"select_spread = ";
123 cout <<
"spread_table_with_selection::init q=" <<
q << endl;
124 cout <<
"spread_table_with_selection::init nb_lines=" <<
nb_lines << endl;
125 cout <<
"spread_table_with_selection::init spread_size=" <<
spread_size << endl;
126 cout <<
"spread_table_with_selection::init size_of_packing=" <<
size_of_packing << endl;
131 cout <<
"spread_table_with_selection::init selected spreads are "
132 "from the following orbits: ";
145 cout <<
"spread_table_with_selection::init before predict_spread_table_length" << endl;
149 cout <<
"spread_table_with_selection::init after predict_spread_table_length" << endl;
150 cout <<
"spread_table_with_selection::init total_nb_of_spreads = " <<
total_nb_of_spreads << endl;
156 cout <<
"spread_table_with_selection::init before Spread_tables->init" << endl;
166 cout <<
"spread_table_with_selection::init after Spread_tables->init" << endl;
170 cout <<
"We will use " <<
nb_spread_reps <<
" isomorphism types of spreads, "
172 <<
" labeled spreads" << endl;
180 cout <<
"spread_table_with_selection::init done" << endl;
186 int f_v = (verbose_level >= 1);
189 cout <<
"spread_table_with_selection::compute_spread_table" << endl;
197 cout <<
"spread_table_with_selection::compute_spread_table files exist, "
204 cout <<
"spread_table_with_selection::compute_spread_table "
205 "after Spread_tables->load" << endl;
211 cout <<
"spread_table_with_selection::compute_spread_table "
212 "files do not exist, computing the spread table" << endl;
216 cout <<
"spread_table_with_selection::compute_spread_table "
217 "before compute_spread_table_from_scratch" << endl;
221 cout <<
"spread_table_with_selection::compute_spread_table "
222 "after compute_spread_table_from_scratch" << endl;
228 cout <<
"spread_table_with_selection::compute_spread_table before create_action_on_spreads" << endl;
232 cout <<
"spread_table_with_selection::compute_spread_table after create_action_on_spreads" << endl;
236 cout <<
"spread_table_with_selection::compute_spread_table done" << endl;
242 int f_v = (verbose_level >= 1);
245 cout <<
"spread_table_with_selection::compute_spread_table_from_scratch" << endl;
255 int *isomorphism_type_of_spread;
256 long int *Spread_table;
263 cout <<
"spread_table_with_selection::compute_spread_table_from_scratch "
264 "before make_spread_table" << endl;
271 Prev, Label, First, Len,
272 isomorphism_type_of_spread,
279 cout <<
"spread_table_with_selection::compute_spread_table_from_scratch "
280 "after make_spread_table" << endl;
285 cout <<
"spread_table_with_selection::compute_spread_table_from_scratch before "
292 int *original_position;
293 int *original_position_inv;
296 cout <<
"spread_table_with_selection::compute_spread_table_from_scratch "
297 "before NEW_int(total_nb_of_spreads)" << endl;
304 original_position[i] = i;
308 cout <<
"spread_table_with_selection::compute_spread_table_from_scratch "
309 "before Sorting.Heapsort_general_with_log" << endl;
312 spread_table_with_selection_compare_func,
313 spread_table_with_selection_swap_func,
316 cout <<
"spread_table_with_selection::compute_spread_table_from_scratch after "
320 j = original_position[i];
321 original_position_inv[j] = i;
325 for (i = 0; i < nb_spreads; i++) {
330 cout <<
"spread_table_with_selection::compute_spread_table_from_scratch "
331 "before Spread_tables->init" << endl;
339 cout <<
"spread_table_with_selection::compute_spread_table_from_scratch "
340 "after Spread_tables->init" << endl;
345 cout <<
"spread_table_with_selection::compute_spread_table_from_scratch "
346 "before Spread_tables->init_spread_table" << endl;
350 Spread_table, isomorphism_type_of_spread,
354 cout <<
"spread_table_with_selection::compute_spread_table_from_scratch "
355 "after Spread_tables->init_spread_table" << endl;
358 long int *Dual_spread_idx;
359 long int *self_dual_spread_idx;
360 int nb_self_dual_spreads;
363 cout <<
"spread_table_with_selection::compute_spread_table_from_scratch "
364 "before Spread_tables->compute_dual_spreads" << endl;
368 self_dual_spread_idx,
369 nb_self_dual_spreads,
372 cout <<
"spread_table_with_selection::compute_spread_table_from_scratch "
373 "after Spread_tables->compute_dual_spreads" << endl;
378 cout <<
"spread_table_with_selection::compute_spread_table_from_scratch "
379 "before Spread_tables->init_tables" << endl;
383 Spread_table, isomorphism_type_of_spread,
385 self_dual_spread_idx, nb_self_dual_spreads,
389 cout <<
"spread_table_with_selection::compute_spread_table_from_scratch "
390 "after Spread_tables->init_tables" << endl;
395 cout <<
"spread_table_with_selection::compute_spread_table_from_scratch preparing schreier_table" << endl;
400 schreier_table =
NEW_int(nb_spreads * 4);
401 for (i = 0; i < nb_spreads; i++) {
402 schreier_table[i * 4 + 0] = original_position[i];
403 schreier_table[i * 4 + 1] = original_position_inv[i];
404 schreier_table[i * 4 + 2] = Prev[i];
405 schreier_table[i * 4 + 3] = Label[i];
415 cout <<
"spread_table_with_selection::compute_spread_table_from_scratch "
416 "before Spread_tables->init_schreier_table" << endl;
421 cout <<
"spread_table_with_selection::compute_spread_table_from_scratch before Spread_tables->save" << endl;
427 if (nb_spreads < 10000) {
428 cout <<
"spread_table_with_selection::compute_spread_table_from_scratch "
429 "We are computing the adjacency matrix" << endl;
431 cout <<
"spread_table_with_selection::compute_spread_table_from_scratch "
432 "The adjacency matrix has been computed" << endl;
435 cout <<
"spread_table_with_selection::compute_spread_table_from_scratch "
436 "We are NOT computing the adjacency matrix" << endl;
441 for (i = 0; i < nb_spreads; i++) {
447 cout <<
"spread_table_with_selection::compute_spread_table_from_scratch done" << endl;
453 int f_v = (verbose_level >= 1);
456 cout <<
"spread_table_with_selection::create_action_on_spreads" << endl;
460 cout <<
"spread_table_with_selection::create_action_on_spreads "
461 "creating action A_on_spreads" << endl;
468 cout <<
"created action on spreads" << endl;
471 cout <<
"spread_table_with_selection::create_action_on_spreads "
472 "creating action A_on_spreads done" << endl;
478 int f_v = (verbose_level >= 1);
482 cout <<
"spread_table_with_selection::find_spread" << endl;
485 cout <<
"spread_table_with_selection::find_spread A_on_spreads == NULL" << endl;
498 int line1,
int line2,
int verbose_level)
501 line1, line2, verbose_level);
506 int f_v = (verbose_level >= 1);
512 cout <<
"spread_table_with_selection::test_if_packing_is_self_dual" << endl;
531 cout <<
"spread_table_with_selection::test_if_packing_is_self_dual done" << endl;
537void packing_classify::read_spread_table(
int verbose_level)
539 int f_v = (verbose_level >= 1);
543 cout <<
"packing_classify::read_spread_table" << endl;
549 cout <<
"packing_classify::read_spread_table "
550 "before Spread_tables->init" << endl;
553 Spread_tables->init(F,
554 TRUE , nb_iso_types_of_spreads,
555 spread_tables_prefix,
563 Spread_tables->classify_self_dual_spreads(type,
566 cout <<
"the self-dual spreads belong to the "
567 "following isomorphism types:" << endl;
568 for (i = 0; i < nb_iso_types_of_spreads; i++) {
569 cout << i <<
" : " << type[i] << endl;
572 for (a = 0; a < SoS->nb_sets; a++) {
573 if (SoS->Set_size[a] < 10) {
574 cout <<
"iso type " << a << endl;
575 lint_vec_print(cout, SoS->Sets[a], SoS->Set_size[a]);
577 for (i = 0; i < SoS->Set_size[a]; i++) {
579 cout << i <<
" : " << b <<
" : ";
580 lint_vec_print(cout, Spread_tables->spread_table +
581 b * spread_size, spread_size);
590 cout <<
"packing_classify::read_spread_table "
591 "after Spread_tables->init" << endl;
597 cout <<
"packing_classify::read_spread_table done" << endl;
606 int f_v = (verbose_level >= 1);
607 int f_do_it, idx, no;
614 cout <<
"spread_table_with_selection::predict_spread_table_length" << endl;
622 cout <<
"spread_table_with_selection::predict_spread_table_length go = " << go << endl;
628 cout <<
"spread_table_with_selection::predict_spread_table_length "
644 T->
k , no, gens, stab_order,
676 cout <<
"spread orbit " << no
677 <<
" has group order "
678 << stab_go <<
" orbit_length = "
695 cout <<
"spread_table_with_selection::predict_spread_table_length done, "
704 long int **&Sets,
int *&Prev,
int *&Label,
int *&First,
int *&Len,
705 int *&isomorphism_type_of_spread,
709 int f_v = (verbose_level >= 1);
715 cout <<
"spread_table_with_selection::make_spread_table nb_spread_reps = " <<
nb_spread_reps << endl;
716 cout <<
"spread_table_with_selection::make_spread_table total_nb_of_spreads = " <<
total_nb_of_spreads << endl;
717 cout <<
"spread_table_with_selection::make_spread_table verbose_level = " << verbose_level << endl;
733 cout <<
"spread_table_with_selection::make_spread_table "
734 "Spread " << i <<
" / "
739 SetOrb[i].
init(A, A2,
746 cout <<
"spread_table_with_selection::make_spread_table Spread "
759 First[i] = nb_spreads1;
768 Prev[nb_spreads1] = First[i] + SetOrb[i].
Extra[j * 2 + 0];
769 Label[nb_spreads1] = SetOrb[i].
Extra[j * 2 + 1];
771 isomorphism_type_of_spread[nb_spreads1] = i;
780 cout <<
"spread_table_with_selection::make_spread_table We found "
781 << nb_spreads1 <<
" spreads in total" << endl;
785 cout <<
"spread_table_with_selection::make_spread_table "
786 "nb_spreads1 != total_nb_of_spreads" << endl;
794 cout <<
"spread_table_with_selection::make_spread_table before "
800 packing_spread_compare_func,
804 cout <<
"spread_table_with_selection::make_spread_table after "
811 cout <<
"spread_table_with_selection::make_spread_table "
812 "The labeled spreads are:" << endl;
821 cout <<
"spread_table_with_selection::make_spread_table done" << endl;
826 long int *&points_covered_by_starter,
827 int &nb_points_covered_by_starter,
828 long int *starter,
int starter_size,
833 int f_v = (verbose_level >= 1);
838 cout <<
"spread_table_with_selection::compute_covered_points" << endl;
841 for (i = 0; i < starter_size; i++) {
845 points_covered_by_starter[i *
spread_size + j] = a;
849 cout <<
"covered lines:" << endl;
850 int_vec_print(cout, covered_lines, starter_size *
spread_size);
854 cout <<
"spread_table_with_selection::compute_covered_points done" << endl;
859 long int *&free_points2,
int &nb_free_points2,
long int *&free_point_idx,
860 long int *points_covered_by_starter,
861 int nb_points_covered_by_starter,
862 long int *starter,
int starter_size,
868 int f_v = (verbose_level >= 1);
872 cout <<
"spread_table_with_selection::compute_free_points2" << endl;
877 free_point_idx[i] = 0;
880 a = points_covered_by_starter[i];
881 free_point_idx[a] = -1;
885 if (free_point_idx[i] == 0) {
886 free_points2[nb_free_points2] = i;
887 free_point_idx[i] = nb_free_points2;
892 cout <<
"free points2:" << endl;
893 int_vec_print(cout, free_points2, nb_free_points2);
897 cout <<
"spread_table_with_selection::compute_free_points2 done" << endl;
903 long int *&live_blocks2,
int &nb_live_blocks2,
904 long int *points_covered_by_starter,
int nb_points_covered_by_starter,
905 long int *starter,
int starter_size,
908 int f_v = (verbose_level >= 1);
912 cout <<
"spread_table_with_selection::compute_live_blocks2" << endl;
917 for (j = 0; j < starter_size; j++) {
922 if (j == starter_size) {
923 live_blocks2[nb_live_blocks2++] = i;
927 cout <<
"spread_table_with_selection::compute_live_blocks2 done" << endl;
931 cout <<
"spread_table_with_selection::compute_live_blocks2 STARTER_CASE "
933 <<
" : Found " << nb_live_blocks2 <<
" live spreads" << endl;
939 int f_v = (verbose_level >= 1);
942 cout <<
"spread_table_with_selection::compute_adjacency_matrix" << endl;
951 cout <<
"spread_table_with_selection::compute_adjacency_matrix done" << endl;
999static int spread_table_with_selection_compare_func(
void *data,
int i,
int j,
void *extra_data)
1002 long int **Sets = (
long int **) data;
1010static void spread_table_with_selection_swap_func(
void *data,
int i,
int j,
void *extra_data)
1012 spread_table_with_selection *S = (spread_table_with_selection *) extra_data;
1014 long int **Sets = (
long int **) data;
a collection of combinatorial functions
int ij2k(int i, int j, int n)
a collection of functions related to sorted vectors
void int_vec_heapsort(int *v, int len)
int lint_vec_compare(long int *p, long int *q, int len)
void Heapsort_general(void *data, int len, int(*compare_func)(void *data, int i, int j, void *extra_data), void(*swap_func)(void *data, int i, int j, void *extra_data), void *extra_data)
void Heapsort_general_with_log(void *data, int *w, int len, int(*compare_func)(void *data, int i, int j, void *extra_data), void(*swap_func)(void *data, int i, int j, void *extra_data), void *extra_data)
int int_vec_search_linear(int *v, int len, int a, int &idx)
int int_vec_compare(int *p, int *q, int len)
tables with line-spreads in PG(3,q)
void save(int verbose_level)
void load(int verbose_level)
void compute_adjacency_matrix(data_structures::bitvector *&Bitvec, int verbose_level)
void find_spreads_containing_two_lines(std::vector< int > &v, int line1, int line2, int verbose_level)
void init(projective_space *P, int f_load, int nb_iso_types_of_spreads, std::string &path_to_spread_tables, int verbose_level)
long int * dual_spread_idx
long int * get_spread(int spread_idx)
void init_tables(int nb_spreads, long int *spread_table, int *spread_iso_type, long int *dual_spread_idx, long int *self_dual_spreads, int nb_self_dual_spreads, int verbose_level)
void compute_dual_spreads(long int **Sets, long int *&Dual_spread_idx, long int *&self_dual_spread_idx, int &nb_self_dual_spreads, int verbose_level)
int test_if_spreads_are_disjoint(int a, int b)
void init_schreier_table(int *schreier_table, int verbose_level)
void init_spread_table(int nb_spreads, long int *spread_table, int *spread_iso_type, int verbose_level)
int files_exist(int verbose_level)
provides access to pre-computed combinatorial data in encoded form
long int * Spread_representative(int q, int k, int i, int &sz)
int Spread_nb_reps(int q, int k)
domain to compute with objects of type longinteger
long int quotient_as_lint(longinteger_object &a, longinteger_object &b)
a class to represent arbitrary precision integers
void create_from_base_10_string(const char *str, int verbose_level)
a permutation group in a fixed action.
action * create_induced_action_on_sets(int nb_sets, int set_size, long int *sets, int verbose_level)
groups::strong_generators * Strong_gens
void stabilizer_of_spread_representative(int q, int k, int no, data_structures_groups::vector_ge *&gens, std::string &stab_order, int verbose_level)
to hold a vector of group elements
a strong generating set for a permutation group with respect to a fixed action
data_structures_groups::vector_ge * gens
void group_order(ring_theory::longinteger_object &go)
int find_set(long int *set, int verbose_level)
exact cover problems arising with the lifting of combinatorial objects
orbit of sets using a Schreier tree, used in packing::make_spread_table
void init(actions::action *A, actions::action *A2, long int *set, int sz, data_structures_groups::vector_ge *gens, int verbose_level)
geometry::projective_space * P
field_theory::finite_field * F
to classify spreads of PG(k-1,q) in PG(n-1,q) where k divides n
projective_geometry::projective_space_with_action * PA
spreads tables with a selection of isomorphism types
int * tmp_isomorphism_type_of_spread
void compute_live_blocks2(exact_cover *EC, int starter_case, long int *&live_blocks2, int &nb_live_blocks2, long int *points_covered_by_starter, int nb_points_covered_by_starter, long int *starter, int starter_size, int verbose_level)
void find_spreads_containing_two_lines(std::vector< int > &v, int line1, int line2, int verbose_level)
data_structures::bitvector * Bitvec
void compute_covered_points(long int *&points_covered_by_starter, int &nb_points_covered_by_starter, long int *starter, int starter_size, int verbose_level)
void compute_spread_table(int verbose_level)
void init(spread_classify *T, int f_select_spread, std::string &select_spread_text, std::string &path_to_spread_tables, int verbose_level)
spread_table_with_selection()
geometry::spread_tables * Spread_tables
long int total_nb_of_spreads
actions::action * A_on_spreads
std::string path_to_spread_tables
void make_spread_table(actions::action *A, actions::action *A2, groups::strong_generators *Strong_gens, long int **&Sets, int *&Prev, int *&Label, int *&first, int *&len, int *&isomorphism_type_of_spread, int verbose_level)
field_theory::finite_field * F
void compute_adjacency_matrix(int verbose_level)
int nb_iso_types_of_spreads
int find_spread(long int *set, int verbose_level)
void compute_spread_table_from_scratch(int verbose_level)
int test_if_packing_is_self_dual(int *packing, int verbose_level)
void predict_spread_table_length(actions::action *A, groups::strong_generators *Strong_gens, int verbose_level)
int is_adjacent(int i, int j)
long int * spread_orbit_length
std::string select_spread_text
void create_action_on_spreads(int verbose_level)
~spread_table_with_selection()
long int * get_spread(int spread_idx)
void compute_free_points2(long int *&free_points2, int &nb_free_points2, long int *&free_point_idx, long int *points_covered_by_starter, int nb_points_covered_by_starter, long int *starter, int starter_size, int verbose_level)
#define Lint_vec_copy(A, B, C)
#define Int_vec_scan(A, B, C)
#define Lint_vec_print(A, B, C)
#define NEW_OBJECTS(type, n)
#define Int_vec_print(A, B, C)
the orbiter library for the classification of combinatorial objects
induced_actions::action_on_sets * on_sets