17namespace layer1_foundations {
18namespace orthogonal_geometry {
56 cout <<
"blt_set_domain::freeself" << endl;
60 cout <<
"blt_set_domain::freeself before O" << endl;
82 cout <<
"blt_set_domain::freeself done" << endl;
91 int f_v = (verbose_level >= 1);
95 cout <<
"blt_set_domain::init" << endl;
96 cout <<
"blt_set_domain::init "
97 "verbose_level = " << verbose_level << endl;
110 sprintf(str,
"BLT_q%d",
q);
119 cout <<
"blt_set_domain::init q=" <<
q
129 cout <<
"blt_set_domain::init "
135 cout <<
"blt_set_domain::init "
136 "allocating Pts and Candidates" << endl;
148 cout <<
"blt_set_domain::init before P->projective_space_init" << endl;
157 cout <<
"blt_set_domain::init after P->projective_space_init" << endl;
166 cout <<
"blt_set_domain::init finished" << endl;
171 int first_point_of_starter,
172 long int *points,
int nb_points,
int *point_color,
176 int f_v = (verbose_level >= 1);
185 int f12, f13, f23, d;
192 cout <<
"blt_set_domain::compute_adjacency_list_fast" << endl;
194 L = ((
long int) nb_points * ((
long int) nb_points - 1)) >> 1;
195 L100 = (L / 100) + 1;
201 form_value =
NEW_int(nb_points);
204 cout <<
"blt_set_domain::compute_adjacency_list_fast unranking points" << endl;
206 for (i = 0; i < nb_points; i++) {
212 cout <<
"blt_set_domain::compute_adjacency_list_fast computing adjacency matrix" << endl;
220 for (i = 0; i < nb_points; i++) {
224 m[0] =
F->
mult(Pi[0], two);
230 for (j = i + 1; j < nb_points; j++, k++) {
233 if ((k % L100) == 0 && k) {
234 cout <<
"blt_set_domain::compute_adjacency_list_fast "
235 "nb_points=" << nb_points <<
" progress: "
247 F->
mult(m[0], Pj[0]),
248 F->
mult(m[1], Pj[1]),
249 F->
mult(m[2], Pj[2]),
250 F->
mult(m[3], Pj[3]),
274 cout <<
"blt_set_domain::compute_adjacency_list_fast done" << endl;
281 long int *starter,
int starter_sz,
282 long int special_line,
283 long int *candidates,
int nb_candidates,
284 int *&point_color,
int &nb_colors,
287 int f_v = (verbose_level >= 1);
288 int f_vv = (verbose_level >= 2);
293 long int *pts_on_special_line;
299 cout <<
"blt_set_domain::compute_colors" << endl;
303 cout <<
"after unrank_line " << special_line <<
":" << endl;
304 cout <<
"p1=" << p1 <<
" p2=" << p2 << endl;
309 cout <<
"p1=" << p1 <<
" ";
312 cout <<
"p2=" << p2 <<
" ";
316 if (p1 != starter[0]) {
317 cout <<
"p1 != starter[0]" << endl;
326 cout <<
"pts_on_special_line:" << endl;
331 if (!Sorting.
lint_vec_search(pts_on_special_line,
q + 1, starter[0], idx, 0)) {
332 cout <<
"cannot find the first point on the line" << endl;
335 for (i = idx; i <
q + 1; i++) {
336 pts_on_special_line[i] = pts_on_special_line[i + 1];
339 cout <<
"pts_on_special_line without the first "
340 "starter point:" << endl;
349 starter_t =
NEW_int(starter_sz);
351 for (i = 1; i < starter_sz; i++) {
356 cout <<
"a == 0, this should not be" << endl;
366 cout <<
"starter_t:" << endl;
373 int *open_colors_inv;
379 point_color =
NEW_int(nb_candidates);
381 nb_colors =
q - starter_sz + 1;
383 for (i = 0; i <
q; i++) {
384 for (h = 1; h < starter_sz; h++) {
385 if (starter_t[h] == i) {
389 if (h == starter_sz) {
390 free_pts[j] = pts_on_special_line[i];
395 if (j != nb_colors) {
396 cout <<
"blt_set_domain::compute_colors error: j != nb_colors" << endl;
400 cout <<
"The " << nb_colors <<
" free points are :" << endl;
403 cout <<
"The " << nb_colors <<
" open colors are :" << endl;
407 for ( ; j <
q; j++) {
408 open_colors[j] = starter_t[j - nb_colors + 1];
411 cout <<
"open_colors :" << endl;
415 for (i = 0; i <
q; i++) {
417 open_colors_inv[j] = i;
420 cout <<
"open_colors_inv :" << endl;
426 for (i = 0; i < nb_candidates; i++) {
429 cout <<
"candidate " << i <<
" / " << nb_candidates
430 <<
" is " << candidates[i] <<
" = ";
437 cout <<
"a == 0, this should not be" << endl;
443 c = open_colors_inv[t];
444 if (c >= nb_colors) {
445 cout <<
"c >= nb_colors" << endl;
446 cout <<
"i=" << i << endl;
447 cout <<
"candidates[i]=" << candidates[i] << endl;
448 cout <<
"as vector: ";
451 cout <<
"a=" << a << endl;
452 cout <<
"b=" << b << endl;
453 cout <<
"t=" << t << endl;
454 cout <<
"c=" << c << endl;
455 cout <<
"nb_colors=" << nb_colors << endl;
463 cout <<
"point colors:" << endl;
474 cout <<
"blt_set_domain::compute_colors done" << endl;
481 long int *candidates,
int nb_candidates,
482 long int *good_candidates,
int &nb_good_candidates,
485 int f_v = (verbose_level >= 1);
486 int f_vv = (verbose_level >= 2);
497 cout <<
"blt_set_domain::early_test_func checking set ";
500 cout <<
"candidate set of size "
501 << nb_candidates <<
":" << endl;
505 for (i = 0; i < nb_candidates; i++) {
508 cout <<
"candidate " << i <<
"="
509 << candidates[i] <<
": ";
515 for (i = 0; i < len; i++) {
519 for (i = 0; i < nb_candidates; i++) {
524 two =
O->
F->
add(1, 1);
529 nb_good_candidates = nb_candidates;
532 nb_good_candidates = 0;
535 cout <<
"blt_set_domain::early_test_func before testing" << endl;
537 for (j = 0; j < nb_candidates; j++) {
541 cout <<
"blt_set::early_test_func "
542 "testing " << j <<
" / "
543 << nb_candidates << endl;
549 m1[0] =
O->
F->
mult(two, v1[0]);
570 m3[0] =
O->
F->
mult(two, v3[0]);
577 for (i = 1; i < len; i++) {
613 good_candidates[nb_good_candidates++] =
629 int v1[5], v2[5], v3[5];
655 int f_BLT_test =
FALSE;
656 int f_collinearity_test =
FALSE;
658 int f_vv = (verbose_level >= 2);
664 cout <<
"checking set ";
670 f_collinearity_test =
TRUE;
672 if (!
O->
BLT_test(len, S, verbose_level)) {
680 cout <<
"OK" << endl;
686 cout <<
"not OK because of ";
690 if (f_collinearity_test) {
691 cout <<
"collinearity test";
701 int f_v = (verbose_level >= 1);
708 cout <<
"blt_set_domain::collinearity_test test for" << endl;
709 for (i = 0; i < len; i++) {
718 for (i = 0; i < len - 1; i++) {
727 cout <<
"{x,y}={" << x <<
","
728 << y <<
"} are collinear" << endl;
733 cout <<
"fxy=" << fxy << endl;
741 cout <<
"collinearity test fails" << endl;
751 for (i = 0; i < len; i++) {
760 long int *&free_pts,
int *&free_pt_idx,
int &nb_free_pts,
763 int f_v = (verbose_level >= 1);
764 int f_vv = (verbose_level >= 2);
765 long int *lines_on_pt;
767 long int i, j, a, b, h, f, fst, len, pt;
771 cout <<
"blt_set_domain::find_free_points" << endl;
774 for (i = 0; i < S_sz; i++) {
776 lines_on_pt + i * (
q + 1),
781 cout <<
"blt_set_domain::find_free_points "
782 "Lines on partial BLT set:" << endl;
787 for (i = 0; i < S_sz; i++) {
788 for (j = 0; j <
q + 1; j++) {
789 a = lines_on_pt[i * (
q + 1) + j];
791 Perp + i * (
q + 1) * (
q + 1) + j * (
q + 1),
796 cout <<
"blt_set_domain::find_free_points Perp:" << endl;
810 cout <<
"blt_set_domain::find_free_points nb_free_pts="
811 << nb_free_pts << endl;
819 for (h = 0; h < nb_free_pts; h++) {
824 cout <<
"blt_set_domain::find_free_points len != 1" << endl;
838 cout <<
"blt_set_domain::find_free_points "
839 "There are " << nb_free_pts <<
" free points" << endl;
842 cout <<
"blt_set_domain::find_free_points done" << endl;
847 int case_number,
int nb_cases_total,
848 long int *Starter_set,
int starter_size,
849 long int *candidates,
int nb_candidates,
850 int f_eliminate_graphs_if_possible,
854 int f_v = (verbose_level >= 1);
855 int f_vv = (verbose_level >= 1);
860 cout <<
"blt_set_domain::create_graph" << endl;
865 long int *lines_on_pt;
873 cout <<
"Case " << case_number
874 <<
" Lines on partial BLT set:" << endl;
879 special_line = lines_on_pt[0];
882 cout <<
"blt_set_domain::create_graph before compute_colors" << endl;
885 Starter_set, starter_size,
887 candidates, nb_candidates,
888 point_color, nb_colors,
891 cout <<
"blt_set_domain::create_graph after compute_colors" << endl;
897 C.
init(point_color, nb_candidates,
FALSE, 0);
899 cout <<
"blt_set_domain::create_graph Case " << case_number
900 <<
" / " << nb_cases_total
901 <<
" point colors (1st classification): ";
909 C2.
init(point_color, nb_candidates,
TRUE, 0);
911 cout <<
"blt_set_domain::create_graph Case " << case_number
912 <<
" / " << nb_cases_total
913 <<
" point colors (2nd classification): ";
926 if (C.
type_len[idx] != minimal_type_multiplicity) {
927 cout <<
"idx != minimal_type" << endl;
928 cout <<
"idx=" << idx << endl;
929 cout <<
"minimal_type=" << minimal_type << endl;
930 cout <<
"C.type_len[idx]=" << C.
type_len[idx] << endl;
931 cout <<
"minimal_type_multiplicity="
932 << minimal_type_multiplicity << endl;
936 int minimal_type, minimal_type_multiplicity;
939 minimal_type_multiplicity = C2.
type_len[idx];
942 cout <<
"blt_set_domain::create_graph Case " << case_number
943 <<
" / " << nb_cases_total <<
" minimal type is "
944 << minimal_type << endl;
945 cout <<
"blt_set_domain::create_graph Case " << case_number
946 <<
" / " << nb_cases_total <<
" minimal_type_multiplicity "
947 << minimal_type_multiplicity << endl;
950 if (f_eliminate_graphs_if_possible) {
951 if (minimal_type_multiplicity == 0) {
952 cout <<
"blt_set_domain::create_graph Case " << case_number
953 <<
" / " << nb_cases_total <<
" Color class "
954 << minimal_type <<
" is empty, the case is "
955 "eliminated" << endl;
964 cout <<
"blt_set_domain::create_graph Case " << case_number
965 <<
" / " << nb_cases_total <<
" Computing adjacency list, "
966 "nb_points=" << nb_candidates << endl;
972 cout <<
"blt_set_domain::create_graph before compute_adjacency_list_fast" << endl;
975 candidates, nb_candidates, point_color,
980 cout <<
"blt_set_domain::create_graph Case " << case_number
981 <<
" / " << nb_cases_total <<
" Computing adjacency "
984 cout <<
"blt_set_domain::create_graph Case " << case_number
985 <<
" / " << nb_cases_total <<
" bitvector_length="
986 << bitvector_length << endl;
992 cout <<
"blt_set_domain::create_graph creating colored_graph" << endl;
999 string label, label_tex;
1001 sprintf(str,
"BLT_%d", case_number);
1003 sprintf(str,
"BLT\\_%d", case_number);
1004 label_tex.assign(str);
1006 CG->
init(nb_candidates , nb_colors, 1 ,
1007 point_color, Bitvec,
TRUE,
1013 for (i = 0; i < nb_candidates; i++) {
1014 CG->
points[i] = candidates[i];
1022 sprintf(str,
"_graph_%d_%d", starter_size, case_number);
1025 CG->
init_user_data(Starter_set, starter_size, verbose_level - 2);
1031 cout <<
"blt_set_domain::create_graph colored_graph created" << endl;
1039 cout <<
"blt_set_domain::create_graph done" << endl;
a collection of combinatorial functions
compact storage of 0/1-data as bitvectors
void m_i(long int i, int a)
void allocate(long int length)
a collection of functions related to sorted vectors
int lint_vec_search(long int *v, int len, long int a, int &idx, int verbose_level)
a statistical analysis of data consisting of single integers
void init(int *data, int data_length, int f_second, int verbose_level)
void print(int f_backwards)
void init_lint(long int *data, int data_length, int f_second, int verbose_level)
int * second_sorting_perm_inv
int add5(int i1, int i2, int i3, int i4, int i5)
int product3(int a1, int a2, int a3)
to rank and unrank subspaces of a fixed dimension in F_q^n
void init(int n, int k, field_theory::finite_field *F, int verbose_level)
projective space PG(n,q) of dimension n over Fq
void projective_space_init(int n, field_theory::finite_field *F, int f_init_incidence_structure, int verbose_level)
a graph with a vertex coloring
void init_user_data(long int *data, int data_size, 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 pair_test(int a, int x, int y, int verbose_level)
void early_test_func(long int *S, int len, long int *candidates, int nb_candidates, long int *good_candidates, int &nb_good_candidates, int verbose_level)
int collinearity_test(long int *S, int len, int verbose_level)
void compute_adjacency_list_fast(int first_point_of_starter, long int *points, int nb_points, int *point_color, data_structures::bitvector *&Bitvec, int verbose_level)
geometry::projective_space * P
void init(orthogonal *O, int verbose_level)
field_theory::finite_field * F
void find_free_points(long int *S, int S_sz, long int *&free_pts, int *&free_pt_idx, int &nb_free_pts, int verbose_level)
void compute_colors(int orbit_at_level, long int *starter, int starter_sz, long int special_line, long int *candidates, int nb_candidates, int *&point_color, int &nb_colors, int verbose_level)
void print(std::ostream &ost, long int *S, int len)
geometry::grassmann * G53
int f_orthogonal_allocated
int create_graph(int case_number, int nb_cases_total, long int *Starter_set, int starter_size, long int *candidates, int nb_candidates, int f_eliminate_graphs_if_possible, graph_theory::colored_graph *&CG, int verbose_level)
int check_conditions(int len, long int *S, int verbose_level)
an orthogonal geometry O^epsilon(n,q)
void points_on_line_by_line_rank(long int line_rk, long int *line, int verbose_level)
field_theory::finite_field * F
void lines_on_point_by_line_rank(long int pt, long int *line_pencil_line_ranks, int verbose_level)
void unrank_point(int *v, int stride, long int rk, int verbose_level)
void unrank_line(long int &p1, long int &p2, long int index, int verbose_level)
int evaluate_bilinear_form(int *u, int *v, int stride)
int BLT_test(int size, long int *set, int verbose_level)
void points_on_line(long int pi, long int pj, long int *line, int verbose_level)
#define Lint_vec_copy(A, B, C)
#define Lint_matrix_print(A, B, C)
#define Lint_vec_print(A, B, C)
#define Int_vec_print(A, B, C)
the orbiter library for the classification of combinatorial objects