Orbiter 2022
Combinatorial Objects
w3q.cpp
Go to the documentation of this file.
1// w3q.cpp
2//
3// Anton Betten
4//
5// started: March 4, 2011
6//
7//
8//
9
10#include "foundations.h"
11
12using namespace std;
13
14
15namespace orbiter {
16namespace layer1_foundations {
17namespace geometry {
18
19
20
22{
23 null();
24}
25
27{
28 freeself();
29}
30
32{
33 q = 0;
34 nb_lines = 0;
35 P3 = NULL;
36 Q4 = NULL;
37 F = NULL;
38 Basis = NULL;
39 Lines = NULL;
40 Q4_rk = NULL;
41 Line_idx = NULL;
42}
43
45{
46 if (P3) {
48 }
49 if (Q4) {
51 }
52 if (Basis) {
54 }
55 if (Lines) {
57 }
58 if (Q4_rk) {
60 }
61 if (Line_idx) {
63 }
64 null();
65}
66
67void W3q::init(field_theory::finite_field *F, int verbose_level)
68{
69 int f_v = (verbose_level >= 1);
70 int f_vv = FALSE; //(verbose_level >= 2);
71 int f_vvv = FALSE; //(verbose_level >= 3);
72 int h, rk;
73
74 W3q::F = F;
75 W3q::q = F->q;
76
77 if (f_v) {
78 cout << "W3q::init" << endl;
79 }
82 Basis = NEW_int(2 * 4);
83
85 FALSE /* f_init_incidence_structure */,
86 verbose_level - 1 /*MINIMUM(verbose_level - 1, 3)*/);
87 F = P3->F;
88 Q4->init(0, 5, F, verbose_level - 1);
89
90
91 if (f_v) {
92 cout << "W3q::init before find_lines" << endl;
93 }
94 find_lines(verbose_level);
95 if (f_v) {
96 cout << "W3q::init after find_lines" << endl;
97 }
98
99
100 if (f_v) {
101 print_lines();
102 }
103
104#if 0
105 cout << "They are" << endl;
106 int_vec_print(cout, Lines, nb_lines);
107 cout << endl;
108#endif
109
110 if (nb_lines != Q4->nb_points) {
111 cout << "W3q::init nb_lines != Q4->nb_points" << endl;
112 exit(1);
113 }
116
117
118 for (h = 0; h < nb_lines; h++) {
120 if (f_vv) {
121 cout << "Line " << h << " is " << Lines[h] << ":" << endl;
123 Basis, 2, 4, 4, F->log10_of_q);
124 cout << endl;
125 }
126
128
129 if (f_vvv) {
130 cout << "v5=";
131 Int_vec_print(cout, v5, 5);
132 cout << endl;
133 }
134
135 rk = Q4->rank_point(v5, 1, 0);
136
137 if (f_vvv) {
138 cout << "orthogonal point rank " << rk << endl;
139 }
140
141 Q4_rk[h] = rk;
142 Line_idx[rk] = h;
143 }
144
145
146}
147
148void W3q::find_lines(int verbose_level)
149{
150 int f_v = (verbose_level >= 1);
151 int h, c;
152
153 if (f_v) {
154 cout << "W3q::find_lines" << endl;
155 }
157 nb_lines = 0;
158 for (h = 0; h < P3->N_lines; h++) {
159 P3->unrank_line(Basis, h);
161 //c = F->evaluate_symmetric_form(2, Basis, Basis + 4);
162 if (c) {
163 continue;
164 }
165 Lines[nb_lines++] = h;
166 }
167 cout << "We found " << nb_lines << " absolute lines" << endl;
168 if (f_v) {
169 cout << "W3q::find_lines done" << endl;
170 }
171}
172
174{
175 int h;
176
177 cout << "the lines are:" << endl;
178 for (h = 0; h < nb_lines; h++) {
179 cout << setw(4) << h << " : ";
180 cout << setw(4) << Lines[h] << " : " << endl;
182 Int_matrix_print(Basis, 2, 4);
183 cout << endl;
184 }
185}
186
187int W3q::evaluate_symplectic_form(int *x4, int *y4)
188{
189 return F->Linear_algebra->evaluate_symplectic_form(4, x4, y4);
190
191 /*F->add4(
192 F->mult(x4[0], y4[1]),
193 F->negate(F->mult(x4[1], y4[0])),
194 F->mult(x4[2], y4[3]),
195 F->negate(F->mult(x4[3], y4[2]))
196 );*/
197}
198
199void W3q::isomorphism_Q4q(int *x4, int *y4, int *v)
200{
201 v[0] = F->Linear_algebra->Pluecker_12(x4, y4);
202 v[1] = F->negate(F->Linear_algebra->Pluecker_13(x4, y4));
203 v[2] = F->Linear_algebra->Pluecker_42(x4, y4);
204 v[3] = F->negate(F->Linear_algebra->Pluecker_14(x4, y4));
205 v[4] = F->Linear_algebra->Pluecker_23(x4, y4);
206}
207
208
210{
211 int h;
212 cout << "The isomorphism is:" << endl;
213 cout << "h : Lines[h] : Q4_rk[h] : Line_idx[h] : "
214 "x : y : point in Q(4,q)" << endl;
215 cout << "Where x and y are a basis for the line" << endl;
216 for (h = 0; h < nb_lines; h++) {
217 cout << setw(4) << h << " : ";
218 cout << setw(4) << Lines[h] << " : ";
219 cout << setw(4) << Q4_rk[h] << " : ";
220 cout << setw(4) << Line_idx[h] << " : ";
222 Int_vec_print(cout, Basis, 4);
223 cout << " : ";
224 Int_vec_print(cout, Basis + 4, 4);
225 Q4->unrank_point(v5, 1, Q4_rk[h], 0);
226 cout << " : ";
227 Int_vec_print(cout, v5, 5);
228 cout << endl;
229 }
230}
231
233{
234 int h;
235 cout << "The isomorphism is:" << endl;
236 cout << "h : Line_idx[h] : Lines[Line_idx[h]] "
237 "x : y : point in Q(4,q)" << endl;
238 cout << "Where x and y are a basis for the line" << endl;
239 for (h = 0; h < nb_lines; h++) {
240 cout << setw(4) << h << " : ";
241 cout << setw(4) << Line_idx[h] << " : ";
242 cout << setw(4) << Lines[Line_idx[h]] << " : ";
244 Int_vec_print(cout, Basis, 4);
245 cout << " : ";
246 Int_vec_print(cout, Basis + 4, 4);
247 Q4->unrank_point(v5, 1, h, 0);
248 cout << " : ";
249 Int_vec_print(cout, v5, 5);
250 cout << endl;
251 }
252}
253
254int W3q::find_line(int line)
255{
256 int idx;
258
259 if (!Sorting.int_vec_search(Lines, nb_lines, line, idx)) {
260 cout << "W3q::find_line could not find the line" << endl;
261 exit(1);
262 }
263 return idx;
264}
265
266}}}
267
a collection of functions related to sorted vectors
int int_vec_search(int *v, int len, int a, int &idx)
Definition: sorting.cpp:1094
void init(field_theory::finite_field *F, int verbose_level)
Definition: w3q.cpp:67
orthogonal_geometry::orthogonal * Q4
Definition: geometry.h:2450
void isomorphism_Q4q(int *x4, int *y4, int *v)
Definition: w3q.cpp:199
void find_lines(int verbose_level)
Definition: w3q.cpp:148
field_theory::finite_field * F
Definition: geometry.h:2451
int evaluate_symplectic_form(int *x4, int *y4)
Definition: w3q.cpp:187
projective space PG(n,q) of dimension n over Fq
Definition: geometry.h:1916
void projective_space_init(int n, field_theory::finite_field *F, int f_init_incidence_structure, int verbose_level)
long int rank_point(int *v, int stride, int verbose_level)
void unrank_point(int *v, int stride, long int rk, int verbose_level)
void init(int epsilon, int n, field_theory::finite_field *F, int verbose_level)
Definition: orthogonal.cpp:312
#define FREE_int(p)
Definition: foundations.h:640
#define NEW_OBJECT(type)
Definition: foundations.h:638
#define FREE_OBJECT(p)
Definition: foundations.h:651
#define NEW_int(n)
Definition: foundations.h:625
#define Int_vec_print_integer_matrix_width(A, B, C, D, E, F)
Definition: foundations.h:691
#define Int_matrix_print(A, B, C)
Definition: foundations.h:707
#define FALSE
Definition: foundations.h:234
#define Int_vec_print(A, B, C)
Definition: foundations.h:685
the orbiter library for the classification of combinatorial objects