17namespace layer1_foundations {
18namespace orthogonal_geometry {
23void orthogonal::create_Linear_BLT_set(
long int *set,
int *ABC,
int verbose_level)
27 int f_v = (verbose_level >= 1);
28 int f_vv = (verbose_level >= 2);
35 cout <<
"orthogonal::create_Linear_BLT_set" << endl;
37 int_vec_zero(ABC, 3 * (
q + 1));
38 for (i = 0; i <
q; i++) {
43 cout <<
"i=" << i <<
" a=" << a
44 <<
" b=" << b <<
" c=" << c << endl;
49 F->create_BLT_point(v, a, b, c, verbose_level - 2);
51 cout <<
"point " << i <<
" : ";
52 int_vec_print(cout, v, 5);
57 cout <<
"rank " << set[i] << endl;
60 int_vec_init5(v, 0, 0, 0, 1, 0);
63 int_vec_print(cout, v, 5);
68 cout <<
"rank " << set[
q] << endl;
71 cout <<
"orthogonal::create_Linear_BLT_set done" << endl;
83 int f_v = (verbose_level >= 1);
84 int f_vv = (verbose_level >= 2);
92 cout <<
"orthogonal::create_FTWKB_BLT_set q <= 5" << endl;
97 cout <<
"orthogonal::create_FTWKB_BLT_set q mod 3 must be 2" << endl;
101 for (i = 0; i <
q; i++) {
106 cout <<
"i=" << i <<
" a=" << a
107 <<
" b=" << b <<
" c=" << c << endl;
114 cout <<
"point " << i <<
" : ";
120 cout <<
"rank " << set[i] << endl;
131 cout <<
"rank " << set[
q] << endl;
134 cout <<
"orthogonal::create_FTWKB_BLT_set the BLT set FTWKB is ";
145 int f_v = (verbose_level >= 1);
146 int f_vv = (verbose_level >= 2);
148 int i,
m, minus_one, exponent, a, b, c;
157 cout <<
"m=" <<
m << endl;
158 cout <<
"exponent=" << exponent << endl;
159 cout <<
"minus_one=" << minus_one << endl;
162 for (i = 0; i <
q; i++) {
167 cout <<
"i=" << i <<
" a=" << a
168 <<
" b=" << b <<
" c=" << c << endl;
175 cout <<
"point " << i <<
" : ";
181 cout <<
"rank " << set[i] << endl;
192 cout <<
"rank " << set[
q] << endl;
195 cout <<
"orthogonal::create_K1_BLT_set the BLT set K1 is ";
206 int f_v = (verbose_level >= 1);
207 int f_vv = (verbose_level >= 2);
209 int five, r, i, a, b, c;
215 cout <<
"orthogonal::create_K2_BLT_set q <= 5" << endl;
219 if (r != 2 && r != 3) {
220 cout <<
"orthogonal::create_K2_BLT_set "
221 "q mod 5 must be 2 or 3" << endl;
226 for (i = 0; i <
q; i++) {
231 cout <<
"i=" << i <<
" a=" << a
232 <<
" b=" << b <<
" c=" << c << endl;
239 cout <<
"point " << i <<
" : ";
245 cout <<
"rank " << set[i] << endl;
256 cout <<
"rank " << set[
q] << endl;
259 cout <<
"orthogonal::create_K2_BLT_set "
260 "the BLT set K2 is ";
267 long int *set,
int verbose_level)
269 int f_v = (verbose_level >= 1);
270 int f_vv = (verbose_level >= 2);
273 int coordinates[] = {
317 cout <<
"orthogonal::create_LP_37_72_BLT_set q = 37" << endl;
320 for (i = 0; i <=
q; i++) {
321 v0 = coordinates[i * 5 + 2];
322 v1 = coordinates[i * 5 + 0];
323 v2 = coordinates[i * 5 + 4];
324 v3 = coordinates[i * 5 + 1];
325 v4 = coordinates[i * 5 + 3];
328 cout <<
"point " << i <<
" : ";
334 cout <<
"rank " << set[i] << endl;
338 cout <<
"orthogonal::create_LP_37_72_BLT_set "
339 "the BLT set LP_37_72 is ";
347 int f_v = (verbose_level >= 1);
348 int f_vv = (verbose_level >= 2);
351 int coordinates[] = {
395 cout <<
"orthogonal::create_LP_37_4a_BLT_set q = 37" << endl;
398 for (i = 0; i <=
q; i++) {
399 v0 = coordinates[i * 5 + 2];
400 v1 = coordinates[i * 5 + 0];
401 v2 = coordinates[i * 5 + 4];
402 v3 = coordinates[i * 5 + 1];
403 v4 = coordinates[i * 5 + 3];
406 cout <<
"point " << i <<
" : ";
412 cout <<
"rank " << set[i] << endl;
416 cout <<
"orthogonal::create_LP_37_4a_BLT_set "
417 "the BLT set LP_37_4a is ";
425 int f_v = (verbose_level >= 1);
426 int f_vv = (verbose_level >= 2);
429 int coordinates[] = {
473 cout <<
"orthogonal::create_LP_37_4b_BLT_set q = 37" << endl;
476 for (i = 0; i <=
q; i++) {
477 v0 = coordinates[i * 5 + 2];
478 v1 = coordinates[i * 5 + 0];
479 v2 = coordinates[i * 5 + 4];
480 v3 = coordinates[i * 5 + 1];
481 v4 = coordinates[i * 5 + 3];
484 cout <<
"point " << i <<
" : ";
490 cout <<
"rank " << set[i] << endl;
494 cout <<
"orthogonal::create_LP_37_4b_BLT_set "
495 "the BLT set LP_37_4b is ";
502 long int *set,
int verbose_level)
512 int f_v = (verbose_level >= 1);
513 int f_vv = (verbose_level >= 2);
516 int coordinates[] = {
562 cout <<
"orthogonal::create_Law_71_BLT_set q = 71" << endl;
565 for (i = 0; i <=
q; i++) {
566 v0 = coordinates[i * 5 + 2];
567 v1 = coordinates[i * 5 + 0];
568 v2 = coordinates[i * 5 + 4];
569 v3 = coordinates[i * 5 + 1];
570 v4 = coordinates[i * 5 + 3];
573 cout <<
"point " << i <<
" : ";
579 cout <<
"rank " << set[i] << endl;
583 cout <<
"orthogonal::create_Law_71_BLT_set "
584 "the BLT set LP_71 is ";
596 if (!
BLT_test(size, set, verbose_level)) {
604 int f_v = (verbose_level >= 1);
605 int f_vv = (verbose_level >= 2);
608 int fxy, fxz, fyz,
l1,
l2,
l3;
615 cout <<
"BLT_test for" << endl;
618 for (i = 0; i < size; i++) {
620 cout << i <<
" : " << set[i] <<
" : ";
657 cout <<
"fxz=" << fxz <<
" (log " <<
l1 <<
") ";
665 for (i = 1; i < size - 1; i++) {
693 cout <<
"i=" << i <<
" fxy=" << fxy <<
" (log=" <<
l2
694 <<
") fyz=" << fyz <<
" (log=" <<
l3
695 <<
") a=" << a << endl;
705 cout <<
"not OK; i=" << i << endl;
706 cout <<
"{x,y,z}={" << x <<
"," << y
707 <<
"," << z <<
"}" << endl;
714 cout <<
"fxz=" << fxz <<
" ";
719 cout <<
" (log=" <<
l1 <<
")" << endl;
720 cout <<
"fxy=" << fxy <<
" ";
725 cout <<
" (log=" <<
l2 <<
")" << endl;
726 cout <<
"fyz=" << fyz <<
" ";
731 cout <<
" (log=" <<
l3 <<
")" << endl;
732 cout <<
"a=" << a <<
"(log=" <<
F->
log_alpha(a)
733 <<
") is the negative of a square" << endl;
742 cout <<
"BLT_test fails" << endl;
753 int f_v = (verbose_level >= 1);
759 cout <<
"collinearity test for" << endl;
760 for (i = 0; i < size; i++) {
773 for (i = 0; i < size - 1; i++) {
786 cout <<
"{x,y}={" << x <<
"," << y
787 <<
"} are collinear" << endl;
792 cout <<
"fxy=" << fxy << endl;
800 cout <<
"collinearity test fails" << endl;
808 int verbose_level = 0;
824 cout <<
"orthogonal::triple_is_collinear rk < 2" << endl;
859 cout <<
"field element indices and f_minus_square:" << endl;
860 for (i = 0; i <
q; i++) {
879 int &nb_planes,
int *&intersection_matrix,
880 int &Block_size,
int *&Blocks,
884 int f_v = (verbose_level >= 1);
885 int f_vv = (verbose_level >= 2);
886 int f_vvv = (verbose_level >= 3);
889 int rk, H, log2_of_q, n_choose_k;
890 int f_special =
FALSE;
891 int f_complete =
TRUE;
917 cout <<
"computing planes spanned by 3-subsets" << endl;
918 cout <<
"n_choose_k=" << n_choose_k << endl;
919 cout <<
"log2_of_q=" << log2_of_q << endl;
924 for (i = 0; i < level; i++) {
928 cout <<
"subset " << setw(5) << cnt <<
" : ";
934 base_col,
FALSE, NULL, level,
n,
n, 0);
936 cout <<
"after Gauss, rank = " << rk << endl;
940 for (i = 0; i < level *
n; i++) {
944 cout <<
"hash =" << setw(10) << H << endl;
951 int *Hash_sorted, *sorting_perm, *sorting_perm_inv,
952 nb_types, *type_first, *type_len;
955 sorting_perm, sorting_perm_inv,
956 nb_types, type_first, type_len);
960 cout << nb_types <<
" types of planes" << endl;
963 for (i = 0; i < nb_types; i++) {
964 cout << setw(3) << i <<
" : "
965 << setw(4) << type_first[i] <<
" : "
966 << setw(4) << type_len[i] <<
" : "
967 << setw(10) << Hash_sorted[type_first[i]] << endl;
970 int *type_len_sorted, *sorting_perm2, *sorting_perm_inv2,
971 nb_types2, *type_first2, *type_len2;
974 sorting_perm2, sorting_perm_inv2,
975 nb_types2, type_first2, type_len2);
978 cout <<
"multiplicities:" << endl;
979 for (i = 0; i < nb_types2; i++) {
982 cout << setw(4) << type_len2[i] <<
" x "
983 << setw(10) << type_len_sorted[type_first2[i]] << endl;
986 int f, ff, ll, j, u, ii, jj, idx;
988 f = type_first2[nb_types2 - 1];
989 nb_planes = type_len2[nb_types2 - 1];
991 if (nb_planes == 1) {
992 cout <<
"there is a unique plane that appears "
993 << type_len_sorted[f]
994 <<
" times among the 3-sets of points" << endl;
997 cout <<
"there are " << nb_planes
998 <<
" planes that each appear "
999 << type_len_sorted[f]
1000 <<
" times among the 3-sets of points" << endl;
1001 for (i = 0; i < nb_planes; i++) {
1002 j = sorting_perm_inv2[f + i];
1003 cout <<
"The " << i <<
"-th plane, which is " << j
1004 <<
", appears " << type_len_sorted[f + i]
1005 <<
" times" << endl;
1010 cout <<
"these planes are:" << endl;
1011 for (i = 0; i < nb_planes; i++) {
1012 cout <<
"plane " << i << endl;
1013 j = sorting_perm_inv2[f + i];
1016 for (u = 0; u < ll; u++) {
1017 cnt = sorting_perm_inv[ff + u];
1019 cout <<
"subset " << setw(5) << cnt <<
" : ";
1021 cout <<
" : " << endl;
1034 Blocks =
NEW_int(nb_planes * size);
1036 for (i = 0; i < nb_planes; i++) {
1037 j = sorting_perm_inv2[f + i];
1041 cout << setw(3) << i <<
" : " << setw(3) <<
" : "
1042 << setw(4) << ff <<
" : "
1043 << setw(4) << ll <<
" : "
1044 << setw(10) << Hash_sorted[type_first[j]] << endl;
1047 for (u = 0; u < ll; u++) {
1048 cnt = sorting_perm_inv[ff + u];
1051 cout <<
"subset " << setw(5) << cnt <<
" : ";
1053 cout <<
" : " << endl;
1055 for (ii = 0; ii < level; ii++) {
1058 for (ii = 0; ii < level; ii++) {
1059 if (!Sorting.
int_vec_search(Block, Block_size, subset[ii], idx)) {
1060 for (jj = Block_size; jj > idx; jj--) {
1061 Block[jj] = Block[jj - 1];
1063 Block[idx] = subset[ii];
1068 f_complete, base_col,
FALSE, NULL, level,
n,
n, 0);
1070 cout <<
"after Gauss, rank = " << rk << endl;
1075 for (ii = 0; ii < level *
n; ii++) {
1079 cout <<
"hash =" << setw(10) << H << endl;
1083 cout <<
"found Block ";
1087 for (u = 0; u < Block_size; u++) {
1088 Blocks[i * Block_size + u] = Block[u];
1092 cout <<
"Incidence structure between points "
1093 "and high frequency planes:" << endl;
1094 if (nb_planes < 30) {
1096 nb_planes, Block_size, Block_size, 3);
1100 int *Incma, *Incma_t, *IIt, *ItI;
1103 Incma =
NEW_int(size * nb_planes);
1104 Incma_t =
NEW_int(nb_planes * size);
1106 ItI =
NEW_int(nb_planes * nb_planes);
1109 for (i = 0; i < size * nb_planes; i++) {
1112 for (i = 0; i < nb_planes; i++) {
1113 for (j = 0; j < Block_size; j++) {
1114 a = Blocks[i * Block_size + j];
1115 Incma[a * nb_planes + i] = 1;
1119 cout <<
"Incidence matrix:" << endl;
1121 size, nb_planes, nb_planes, 1);
1123 for (i = 0; i < size; i++) {
1124 for (j = 0; j < nb_planes; j++) {
1125 Incma_t[j * size + i] = Incma[i * nb_planes + j];
1128 for (i = 0; i < size; i++) {
1129 for (j = 0; j < size; j++) {
1131 for (u = 0; u < nb_planes; u++) {
1132 a += Incma[i * nb_planes + u] * Incma_t[u * size + j];
1134 IIt[i * size + j] = a;
1138 cout <<
"I * I^\\top = " << endl;
1141 for (i = 0; i < nb_planes; i++) {
1142 for (j = 0; j < nb_planes; j++) {
1144 for (u = 0; u < size; u++) {
1145 a += Incma[u * nb_planes + i] * Incma[u * nb_planes + j];
1147 ItI[i * nb_planes + j] = a;
1151 cout <<
"I^\\top * I = " << endl;
1153 nb_planes, nb_planes, nb_planes, 3);
1156 intersection_matrix =
NEW_int(nb_planes * nb_planes);
1157 for (i = 0; i < nb_planes; i++) {
1158 for (j = 0; j < nb_planes; j++) {
1159 intersection_matrix[i * nb_planes + j] = ItI[i * nb_planes + j];
1167 snprintf(fname, 1000,
"plane_invariant_%d_%d.txt",
q, k);
1170 fp << nb_planes << endl;
1171 for (i = 0; i < nb_planes; i++) {
1172 for (j = 0; j < nb_planes; j++) {
1173 fp << ItI[i * nb_planes + j] <<
" ";
1178 fp <<
"# Incidence structure between points "
1179 "and high frequency planes:" << endl;
1180 fp << l <<
" " << Block_size << endl;
1181 print_integer_matrix_width(fp,
1182 Blocks, nb_planes, Block_size, Block_size, 3);
a collection of combinatorial functions
int first_k_subset(int *set, int n, int k)
void unrank_k_subset(int rk, int *set, int n, int k)
long int int_n_choose_k(int n, int k)
int next_k_subset(int *set, int n, int k)
catch all class for algorithms
int hashing_fixed_width(int hash0, int a, int bit_length)
void init5(int *v, int a0, int a1, int a2, int a3, int a4)
a collection of functions related to sorted vectors
int int_vec_search(int *v, int len, int a, int &idx)
void int_vec_classify(int length, int *the_vec, int *&the_vec_sorted, int *&sorting_perm, int *&sorting_perm_inv, int &nb_types, int *&type_first, int *&type_len)
int add5(int i1, int i2, int i3, int i4, int i5)
orthogonal_geometry::orthogonal_indexing * Orthogonal_indexing
int product3(int a1, int a2, int a3)
linear_algebra::linear_algebra * Linear_algebra
various functions related to geometries
void create_BLT_point(field_theory::finite_field *F, int *v5, int a, int b, int c, int verbose_level)
int Gauss_int(int *A, int f_special, int f_complete, int *base_cols, int f_P, int *P, int m, int n, int Pn, int verbose_level)
basic number theoretic functions
data_structures::int_vec * Int_vec
void Q_unrank(int *v, int stride, int k, long int a, int verbose_level)
long int rank_point(int *v, int stride, int verbose_level)
field_theory::finite_field * F
void unrank_point(int *v, int stride, long int rk, int verbose_level)
void create_Law_71_BLT_set(long int *set, int verbose_level)
void create_FTWKB_BLT_set(long int *set, int *ABC, int verbose_level)
int collinearity_test(int size, long int *set, int verbose_level)
void create_LP_37_4a_BLT_set(long int *set, int verbose_level)
void create_LP_37_72_BLT_set(long int *set, int verbose_level)
int * index_minus_square_without
int * index_minus_nonsquare
void create_K2_BLT_set(long int *set, int *ABC, int verbose_level)
int evaluate_bilinear_form(int *u, int *v, int stride)
int BLT_test_full(int size, long int *set, int verbose_level)
int BLT_test(int size, long int *set, int verbose_level)
int is_minus_square(int i)
void create_K1_BLT_set(long int *set, int *ABC, int verbose_level)
void plane_invariant(unusual_model *U, int size, int *set, int &nb_planes, int *&intersection_matrix, int &Block_size, int *&Blocks, int verbose_level)
int triple_is_collinear(long int pt1, long int pt2, long int pt3)
void print_minus_square_tables()
void create_LP_37_4b_BLT_set(long int *set, int verbose_level)
Penttila's unusual model to create BLT-sets.
#define Int_vec_zero(A, B)
#define Lint_vec_print(A, B, C)
#define Int_vec_print_integer_matrix_width(A, B, C, D, E, F)
#define Int_vec_print(A, B, C)
orbiter_kernel_system::orbiter_session * Orbiter
global Orbiter session
the orbiter library for the classification of combinatorial objects