18namespace layer1_foundations {
22static int spread_table_compare_func(
void *a,
void *b,
void *data);
95 int nb_iso_types_of_spreads,
96 std::string &path_to_spread_tables,
99 int f_v = (verbose_level >= 1);
103 cout <<
"spread_tables::init" << endl;
107 cout <<
"spread_tables::init P->n != 3" << endl;
121 cout <<
"spread_tables::init nb_lines=" <<
nb_lines << endl;
122 cout <<
"spread_tables::init spread_size=" <<
spread_size << endl;
123 cout <<
"spread_tables::init nb_iso_types_of_spreads="
128 prefix.assign(path_to_spread_tables);
131 sprintf(str,
"spread_%d", NT.
i_power_j(
q, 2));
143 cout <<
"spread_tables::init before Gr->compute_dual_line_idx" << endl;
149 cout <<
"spread_tables::init after Gr->compute_dual_line_idx" << endl;
154 cout <<
"spread_tables::init before load" << endl;
158 cout <<
"spread_tables::init after load" << endl;
164 cout <<
"spread_tables::init done" << endl;
193 long int *spread_table,
int *spread_iso_type,
196 int f_v = (verbose_level >= 1);
199 cout <<
"spread_tables::init_spread_table" << endl;
205 cout <<
"spread_tables::init_spread_table done" << endl;
210 long int *spread_table,
int *spread_iso_type,
211 long int *dual_spread_idx,
212 long int *self_dual_spreads,
int nb_self_dual_spreads,
215 int f_v = (verbose_level >= 1);
218 cout <<
"spread_tables::init_tables" << endl;
227 cout <<
"spread_tables::init_tables done" << endl;
234 int f_v = (verbose_level >= 1);
237 cout <<
"spread_tables::init_schreier_table" << endl;
241 cout <<
"spread_tables::init_schreier_table done" << endl;
246 int nb_select,
int *select,
248 std::string &path_to_spread_tables,
251 int f_v = (verbose_level >= 1);
256 cout <<
"spread_tables::init_reduced, nb_select=" << nb_select << endl;
259 P = old_spread_table->
P;
266 prefix.assign(path_to_spread_tables);
269 sprintf(str,
"reduced_spread_%d", NT.
i_power_j(
q, 2));
283 cout <<
"spread_tables::init_reduced allocating spread_table" << endl;
287 cout <<
"spread_tables::init_reduced allocating spread_iso_type" << endl;
299 int *select_original_idx;
301 select_sorted =
NEW_int(nb_select);
302 select_original_idx =
NEW_int(nb_select);
306 cout <<
"spread_tables::init_reduced "
307 "sorting good spreads" << endl;
311 select_original_idx[i] = i;
314 cout <<
"spread_tables::init_reduced "
315 "sorting good spreads done" << endl;
320 cout <<
"spread_tables::init_reduced computing dual_spread_idx" << endl;
331 idx = select_original_idx[idx];
336 cout <<
"spread_tables::init_reduced computing dual_spread_idx done" << endl;
343 cout <<
"spread_tables::init_reduced computing self_dual_spreads" << endl;
354 cout <<
"spread_tables::init_reduced computing self_dual_spreads done" << endl;
360 cout <<
"spread_tables::init_reduced done" << endl;
370 int line1,
int line2,
int verbose_level)
372 int f_v = (verbose_level >= 1);
375 cout <<
"spread_tables::find_spreads_containing_two_lines" << endl;
376 cout <<
"spread_tables::find_spreads_containing_two_lines line1 = " << line1 << endl;
377 cout <<
"spread_tables::find_spreads_containing_two_lines line2 = " << line2 << endl;
385 for (spread_idx = 0; spread_idx <
nb_spreads; spread_idx++) {
387 f_found_line1 =
FALSE;
390 f_found_line1 =
TRUE;
394 f_found_line2 =
FALSE;
397 f_found_line2 =
TRUE;
401 if (f_found_line1 && f_found_line2) {
402 v.push_back(spread_idx);
406 cout <<
"spread_tables::find_spreads_containing_two_lines done" << endl;
414 int f_v = (verbose_level >= 1);
418 cout <<
"spread_tables::classify_self_dual_spreads" << endl;
440 cout <<
"spread_tables::classify_self_dual_spreads done" << endl;
446 int f_v = (verbose_level >= 1);
450 cout <<
"spread_tables::files_exist testing whether file exists: " <<
fname_spreads << endl;
462 int f_v = (verbose_level >= 1);
466 cout <<
"spread_tables::save" << endl;
470 cout <<
"spread_tables::save "
477 cout <<
"spread_tables::save "
482 cout <<
"spread_tables::save, "
489 "isomorphism_type_of_spread");
491 cout <<
"spread_tables::save, "
497 cout <<
"spread_tables::save, "
506 cout <<
"spread_tables::save, "
512 cout <<
"spread_tables::save, "
519 "self_dual_spreads");
521 cout <<
"spread_tables::save, "
530 cout <<
"spread_tables::save "
537 cout <<
"spread_tables::save "
542 cout <<
"spread_tables::save no schreier table" << endl;
547 cout <<
"spread_tables::save done" << endl;
553 int f_v = (verbose_level >= 1);
558 cout <<
"spread_tables::load" << endl;
562 cout <<
"spread_tables::load "
570 cout <<
"spread_tables::load b != spread_size" << endl;
574 cout <<
"spread_tables::load "
579 cout <<
"spread_tables::load, "
587 cout <<
"spread_tables::load a != nb_spreads" << endl;
591 cout <<
"spread_tables::load, "
597 cout <<
"spread_tables::load, "
605 cout <<
"spread_tables::load a != nb_spreads" << endl;
609 cout <<
"spread_tables::load, "
615 cout <<
"spread_tables::load, "
623 cout <<
"spread_tables::load, "
631 cout <<
"spread_tables::load, "
639 cout <<
"spread_tables::load a != nb_spreads" << endl;
643 cout <<
"spread_tables::load b != 4" << endl;
647 cout <<
"spread_tables::load, "
653 cout <<
"spread_tables::load no schreier tables" << endl;
659 cout <<
"spread_tables::load done" << endl;
668 int f_v = (verbose_level >= 1);
669 long int i, j, k, N2;
672 cout <<
"spread_tables::compute_adjacency_matrix" << endl;
696 if ((k & ((1 << 21) - 1)) == 0) {
697 cout <<
"i=" << i <<
" j=" << j <<
" k=" << k <<
" / " << N2 << endl;
729 fname.append(
"_disjoint_spreads.colored_graph");
731 CG->
save(fname, verbose_level);
733 cout <<
"Written file " << fname <<
" of size "
742 cout <<
"spread_tables::compute_adjacency_matrix done" << endl;
759 long int *&Dual_spread_idx,
760 long int *&self_dual_spread_idx,
761 int &nb_self_dual_spreads,
764 int f_v = (verbose_level >= 1);
765 long int *dual_spread;
772 cout <<
"spread_tables::compute_dual_spreads" << endl;
790 cout <<
"spread_tables::compute_dual_spreads spread "
810 spread_table_compare_func, (
void *) v,
814 cout <<
"spread_tables::compute_dual_spreads Dual "
815 "spread of spread " << i
816 <<
" is spread no " << idx << endl;
818 Dual_spread_idx[i] = idx;
824 cout <<
"The dual spread is not in the list, error!" << endl;
825 cout <<
"dual_spread: ";
834 cout <<
"spread_tables::compute_dual_spreads we found "
836 cout <<
"They are: ";
843 cout <<
"spread_tables::compute_dual_spreads done" << endl;
849 long int *set1,
int sz1,
850 long int *set2,
int sz2,
858 cout <<
"spread_tables::test_if_pair_of_sets_are_adjacent" << endl;
860 for (i = 0; i < sz1; i++) {
862 for (j = 0; j < sz2; j++) {
877 for (i = 0; i < len; i++) {
879 for (j = i + 1; j < len; j++) {
906 for (i = 0; i < len; i++) {
908 for (j = i + 1; j < len; j++) {
911 cout <<
"elements i=" << i <<
" j=" << j <<
" corresponding to spreads " << a <<
" and " << b <<
" are not line disjoint" << endl;
932 long int *live_point_index,
int nb_live_points,
933 long int *live_blocks,
int nb_live_blocks,
938 int f_v = (verbose_level >= 1);
941 cout <<
"spread_tables::make_exact_cover_problem" << endl;
945 int nb_rows = nb_live_points;
946 int nb_cols = nb_live_blocks;
949 Dio->
open(nb_rows, nb_cols);
951 Dio->
sum = nb_needed;
953 for (i = 0; i < nb_rows; i++) {
962 for (j = 0; j < nb_cols; j++) {
966 u = live_point_index[i];
968 cout <<
"spread_tables::make_exact_cover_problem "
969 "live_point_index[i] == -1" << endl;
975 for (j = 0; j < nb_cols; j++) {
982 cout <<
"spread_tables::make_exact_cover_problem done" << endl;
987 long int *list_of_lines,
long int *packing,
int sz_of_packing,
991 int f_v = (verbose_level >= 1);
995 cout <<
"spread_tables::compute_list_of_lines_from_packing" << endl;
997 for (i = 0; i < sz_of_packing; i++) {
1003 cout <<
"spread_tables::compute_list_of_lines_from_packing done" << endl;
1008 int *Partial_packings,
int nb_pp,
int sz,
1009 int *&Iso_type_invariant,
1012 int f_v = (verbose_level >= 1);
1016 cout <<
"spread_tables::compute_iso_type_invariant" << endl;
1021 for (i = 0; i < nb_pp; i++) {
1022 for (j = 0; j < sz; j++) {
1023 a = Partial_packings[i * sz + j];
1030 cout <<
"spread_tables::compute_iso_type_invariant done" << endl;
1045 ost <<
"_{" << b <<
"}";
1054static int spread_table_compare_func(
void *a,
void *b,
void *data)
1059 int *p = (
int *) data;
1063 for (i = 0; i < n; i++) {
compact storage of 0/1-data as bitvectors
void m_i(long int i, int a)
void allocate(long int length)
void init_basic_with_Sz_in_int(int underlying_set_size, int nb_sets, int *Sz, int verbose_level)
a collection of functions related to sorted vectors
int int_vec_search(int *v, int len, int a, int &idx)
int test_if_sets_are_disjoint(long int *set1, int sz1, long int *set2, int sz2)
void int_vec_heapsort_with_log(int *v, int *w, int len)
int vec_search(void **v, int(*compare_func)(void *a, void *b, void *data), void *data_for_compare, int len, void *a, int &idx, int verbose_level)
void lint_vec_heapsort(long int *v, int len)
ring_theory::longinteger_object * nCkq
void compute_dual_line_idx(int *&dual_line_idx, int *&self_dual_lines, int &nb_self_dual_lines, int verbose_level)
void print_single_generator_matrix_tex(std::ostream &ost, long int a)
projective space PG(n,q) of dimension n over Fq
field_theory::finite_field * F
tables with line-spreads in PG(3,q)
int test_if_set_of_spreads_is_line_disjoint(long int *set, int len)
void save(int verbose_level)
std::string fname_schreier_table
void compute_list_of_lines_from_packing(long int *list_of_lines, long int *packing, int sz_of_packing, int verbose_level)
void load(int verbose_level)
std::string fname_dual_spread
void compute_adjacency_matrix(data_structures::bitvector *&Bitvec, int verbose_level)
void classify_self_dual_spreads(int *&type, data_structures::set_of_sets *&SoS, 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
void create_file_names(int verbose_level)
int test_if_set_of_spreads_is_line_disjoint_and_complain_if_not(long int *set, int len)
void compute_iso_type_invariant(int *Partial_packings, int nb_pp, int sz, int *&Iso_type_invariant, int verbose_level)
std::string fname_isomorphism_type_of_spreads
long int * get_spread(int spread_idx)
std::string fname_dual_line_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)
void report_one_spread(std::ostream &ost, int a)
int test_if_spreads_are_disjoint(int a, int b)
std::string fname_self_dual_lines
void init_reduced(int nb_select, int *select, spread_tables *old_spread_table, std::string &path_to_spread_tables, int verbose_level)
void init_schreier_table(int *schreier_table, int verbose_level)
int test_if_pair_of_sets_are_adjacent(long int *set1, int sz1, long int *set2, int sz2, 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)
void make_exact_cover_problem(solvers::diophant *&Dio, long int *live_point_index, int nb_live_points, long int *live_blocks, int nb_live_blocks, int nb_needed, int verbose_level)
std::string fname_self_dual_spreads
std::string fname_spreads
field_theory::finite_field * F
int nb_iso_types_of_spreads
long int * self_dual_spreads
a graph with a vertex coloring
void save(std::string &fname, int verbose_level)
void init(int nb_points, int nb_colors, int nb_colors_per_vertex, int *colors, data_structures::bitvector *Bitvec, int f_ownership_of_bitvec, std::string &label, std::string &label_tex, int verbose_level)
basic number theoretic functions
int i_power_j(int i, int j)
a collection of functions related to file io
void int_matrix_write_csv(std::string &fname, int *M, int m, int n)
void int_vec_write_csv(int *v, int len, std::string &fname, const char *label)
void lint_matrix_write_csv(std::string &fname, long int *M, int m, int n)
void int_matrix_read_csv(std::string &fname, int *&M, int &m, int &n, int verbose_level)
long int file_size(std::string &fname)
void lint_matrix_read_csv(std::string &fname, long int *&M, int &m, int &n, int verbose_level)
void lint_vec_write_csv(long int *v, int len, std::string &fname, const char *label)
diophantine systems of equations (i.e., linear systems over the integers)
void fill_coefficient_matrix_with(int a)
diophant_equation_type * type
#define Lint_vec_copy(A, B, C)
#define Int_vec_zero(A, B)
#define Lint_vec_print(A, B, C)
#define Int_vec_copy(A, B, C)
the orbiter library for the classification of combinatorial objects