Orbiter 2022
Combinatorial Objects
singer_cycle.cpp
Go to the documentation of this file.
1// singer_cycle.cpp
2//
3// Anton Betten
4// March 19, 2013
5//
6//
7//
8//
9//
10
11#include "orbiter.h"
12
13using namespace std;
14
15namespace orbiter {
16namespace layer5_applications {
17namespace apps_geometry {
18
19
21{
22 F = NULL;
23 A = NULL;
24 A2 = NULL;
25 n = q = 0;
26 poly_coeffs = NULL;
27 Singer_matrix = NULL;
28 //Elt = NULL;
29 //gens = NULL;
30 nice_gens = NULL;
31 SG = NULL;
32 // target_go;
33 P = NULL;
34 singer_point_list = NULL;
36 Sch = NULL;
38 line_orbit_reps = NULL;
39 line_orbit_len = NULL;
40 line_orbit_first = NULL;
41 line_orbit_label = NULL;
43 line_orbit = NULL;
44 line_orbit_inv = NULL;
45 Inc = NULL;
46 T = NULL;
47 //null();
48}
49
51{
52 freeself();
53}
54
56{
57}
58
60{
61 if (poly_coeffs) {
63 }
64 if (Singer_matrix) {
66 }
67 if (nice_gens) {
69 }
70 if (SG) {
72 }
75 }
78 }
79 if (Sch) {
81 }
82 if (line_orbit_reps) {
84 }
85 if (line_orbit_len) {
87 }
88 if (line_orbit_first) {
90 }
91 if (line_orbit_label) {
92 delete [] line_orbit_label;
93 }
95 delete [] line_orbit_label_tex;
96 }
97 if (line_orbit) {
99 }
100 if (line_orbit_inv) {
102 }
103 if (Inc) {
105 }
106 if (T) {
107 FREE_OBJECT(T);
108 }
109 // P must be deleted last:
110 if (P) {
111 FREE_OBJECT(P);
112 }
113 null();
114}
115
119 actions::action *A2, int verbose_level)
120{
121 int f_v = (verbose_level >= 1);
122 string poly;
123 int i, j, a;
124
125 if (f_v) {
126 cout << "singer_cycle::init" << endl;
127 }
133 if (F->e > 1) {
134 cout << "singer_cycle::init field must be prime field" << endl;
135 exit(1);
136 }
138
139 K.get_primitive_polynomial(poly, q, n, verbose_level);
140 poly_coeffs = NEW_int(n + 1);
141 {
142 //finite_field GFp;
143
144 //GFp.init(p, 0);
145
148
149 FX.create_object_by_rank_string(m, poly, 0);
150 int *rep = (int *) m;
151 int *coeffs = rep + 1;
152
153 for (i = 0; i <= n; i++) {
154 poly_coeffs[i] = coeffs[i];
155 }
156
157 }
158
159 if (f_v) {
160 cout << "singer_cycle::init coefficients: ";
161 Int_vec_print(cout, poly_coeffs, n + 1);
162 cout << endl;
163 }
164
166 for (i = 0; i < n - 1; i++) {
167 for (j = 0; j < n; j++) {
168 if (j == i + 1) {
169 a = 1;
170 }
171 else {
172 a = 0;
173 }
174 Singer_matrix[i * n + j] = a;
175 }
176 }
177 for (j = 0; j < n; j++) {
178 Singer_matrix[(n - 1) * n + j] = F->negate(poly_coeffs[j]);
179 }
180 if (f_v) {
181 cout << "singer_cycle::init Singer_matrix: " << endl;
183 }
184 //Elt = NEW_int(A->elt_size_in_int);
185 //A->make_element(Elt, Singer_matrix, verbose_level);
186
188
189 target_go.create((NT.i_power_j(q, n) - 1) / (q - 1), __FILE__, __LINE__);
190
194 n * n, 1 /* nb_gens*/,
195 target_go,
196 nice_gens,
197 verbose_level);
198
199 //gens = NEW_OBJECT(vector_ge);
200 //gens->init(A);
201 //gens->allocate(1);
202 //A->element_move(Elt, gens->ith(0), 0);
203 if (f_v) {
204 cout << "singer_cycle::init created Singer cycle:" << endl;
206 cout << endl;
207 cout << "singer_cycle::init Singer cycle on lines:" << endl;
209 cout << endl;
210 }
211 if (f_v) {
212 cout << "singer_cycle::init done" << endl;
213 }
214}
215
216void singer_cycle::init_lines(int verbose_level)
217{
218 int f_v = (verbose_level >= 1);
219 int i, j, a, b, c, h;
220 int *v;
221 int *line;
222
223 if (f_v) {
224 cout << "singer_cycle::init_lines" << endl;
225 }
226
227 v = NEW_int(n);
228
230
232 FALSE /* f_init_incidence_structure */,
233 verbose_level);
234
235
238 a = 0;
239 singer_point_list[0] = 0;
241 for (i = 0; i < P->N_points - 1; i++) {
242 b = A->element_image_of(a, nice_gens->ith(0), 0);
243 singer_point_list[1 + i] = b;
244 singer_point_list_inv[b] = i + 1;
245 a = b;
246 }
247
248 line = NEW_int(P->k);
249
250 if (f_v) {
251 cout << "singer_cycle::init_lines singer_point_list:" << endl;
252 for (i = 0; i < P->N_points; i++) {
253 cout << i << " : " << singer_point_list[i] << " : ";
255 Int_vec_print(cout, v, n);
256 cout << endl;
257 }
258 }
259
260 if (f_v) {
261 cout << "Lines on point P_0:" << endl;
262 for (i = 0; i < P->r; i++) {
263 a = P->Implementation->Lines_on_point[0 * P->r + i];
264 cout << "Line " << i << " has rank " << a << ":" << endl;
265 P->Grass_lines->unrank_lint(a, 0);
267 h = 0;
268 for (j = 0; j < P->k; j++) {
269 b = P->Implementation->Lines[a * P->k + j];
271 if (c != 0) {
272 line[h++] = c;
273 }
274 }
275 cout << "points on this line in powers of singer cycle: ";
276 Int_vec_print(cout, line, h);
277 cout << endl;
278 }
279 }
280
281
282
284 Sch->init(A2, verbose_level - 2);
286 Sch->init_single_generator(nice_gens->ith(0), verbose_level - 2);
288 if (f_v) {
289 cout << "Found " << Sch->nb_orbits << " orbits on lines" << endl;
290 for (i = 0; i < Sch->nb_orbits; i++) {
291 cout << "Orbit " << i << " of length " << Sch->orbit_len[i] << endl;
292 }
293 }
298
299 line_orbit_label = new string[P->N_lines];
300 line_orbit_label_tex = new string[P->N_lines];
303 for (i = 0; i < Sch->nb_orbits; i++) {
307 }
308 if (f_v) {
309 cout << "line_orbit_reps:";
311 cout << endl;
312 cout << "line_orbit_len:";
314 cout << endl;
315 cout << "line_orbit_first:";
317 cout << endl;
318 }
319 h = 0;
320 for (i = 0; i < nb_line_orbits; i++) {
321 a = line_orbit_reps[i];
322 if (f_v) {
323 cout << "computing orbit of line " << a << " of length "
324 << line_orbit_len[i] << ":" << endl;
325 }
326 for (j = 0; j < line_orbit_len[i]; j++) {
327 line_orbit[h] = a;
328 line_orbit_inv[a] = h;
329
330 char str[1000];
331 sprintf(str, "A%d", j);
332 str[0] += i;
333 if (f_v) {
334 cout << "label " << j << " is " << str << endl;
335 }
336 line_orbit_label[h].assign(str);
337
338 sprintf(str, "A_{%d}", j);
339 str[0] += i;
340 if (f_v) {
341 cout << "label " << j << " in tex is " << str << endl;
342 }
343 line_orbit_label_tex[h].assign(str);
344
345 b = A2->element_image_of(a, nice_gens->ith(0), 0);
346 a = b;
347 h++;
348 }
349 }
350 if (f_v) {
351 cout << "h=" << h << endl;
352 for (i = 0; i < P->N_lines; i++) {
353 cout << i << " : " << line_orbit_label[i] << " : " << line_orbit[i] << endl;
354 }
355 }
356
357 int f_combined_action = FALSE;
358
360
362
364 T->init(P->N_points, P->N_lines,
365 Inc,
366 f_combined_action,
367 NULL /* Aut */,
368 A /* A_on_points */,
369 A2 /*A_on_lines*/,
370 SG /* Aut->strong_generators*/,
371 verbose_level - 1);
372
373
374#if 0
375 partitionstack *Stack;
376 incidence_structure *Inc;
377 int f_combined_action = FALSE;
378 int f_write_tda_files = FALSE;
379 int f_include_group_order = FALSE;
380 int f_pic = FALSE;
381 int f_include_tda_scheme = FALSE;
382
383
384 int set_size = P->N_points;
385 int nb_blocks = P->N_lines;
386
387 Stack = NEW_OBJECT(partitionstack);
388 Stack->allocate(set_size + nb_blocks, 0 /* verbose_level */);
389 Stack->subset_continguous(set_size, nb_blocks);
390 Stack->split_cell(0 /* verbose_level */);
391 Stack->sort_cells();
392
393 if (f_v) {
394 cout << "before incidence_structure_compute_TDA_general" << endl;
395 }
396 incidence_structure_compute_TDA_general(*Stack,
397 Inc,
398 f_combined_action,
399 NULL, A, A2,
400 gens,
401 f_write_tda_files,
402 f_include_group_order,
403 f_pic,
404 f_include_tda_scheme,
405 verbose_level);
406#endif
407 if (f_v) {
408 cout << "after incidence_structure_compute_TDA_general" << endl;
409 }
410
411#if 0
412 //Stack->isolate_point(set_size + 11);
413 Stack->isolate_point(0);
414
415 Stack->split_cell(0 /* verbose_level */);
416 Stack->sort_cells();
417
418 int TDO_depth = INT_MAX;
419
420 cout << "before compute_TDO_safe" << endl;
421 Inc->compute_TDO_safe(*Stack, TDO_depth, verbose_level - 3);
422 cout << "after compute_TDO_safe" << endl;
423 Inc->get_and_print_row_tactical_decomposition_scheme_tex(cout, FALSE /* f_enter_math */, *Stack);
424 Inc->get_and_print_column_tactical_decomposition_scheme_tex(cout, FALSE /* f_enter_math */, *Stack);
425#endif
426
427 //FREE_OBJECT(Inc);
428 //FREE_OBJECT(Stack);
429 //FREE_OBJECT(T);
430
431 FREE_int(line);
432 FREE_int(v);
433 if (f_v) {
434 cout << "singer_cycle::init_lines done" << endl;
435 }
436}
437
438}}}
439
440
void unrank_lint(long int rk, int verbose_level)
Definition: grassmann.cpp:343
interface for various incidence geometries
Definition: geometry.h:1099
void get_and_print_row_tactical_decomposition_scheme_tex(std::ostream &ost, int f_enter_math, int f_print_subscripts, data_structures::partitionstack &PStack)
void init_by_matrix_as_bitmatrix(int m, int n, data_structures::bitmatrix *Bitmatrix, int verbose_level)
void get_and_print_column_tactical_decomposition_scheme_tex(std::ostream &ost, int f_enter_math, int f_print_subscripts, data_structures::partitionstack &PStack)
void compute_TDO_safe(data_structures::partitionstack &PStack, int depth, int verbose_level)
projective space PG(n,q) of dimension n over Fq
Definition: geometry.h:1916
projective_space_implementation * Implementation
Definition: geometry.h:1940
void projective_space_init(int n, field_theory::finite_field *F, int f_init_incidence_structure, int verbose_level)
provides access to pre-computed combinatorial data in encoded form
void get_primitive_polynomial(std::string &poly, int p, int e, int verbose_level)
void create(long int i, const char *file, int line)
domain of polynomials in one variable over a finite field
Definition: ring_theory.h:691
void create_object_by_rank_string(unipoly_object &p, std::string &rk, int verbose_level)
a permutation group in a fixed action.
Definition: actions.h:99
void element_print_as_permutation(void *elt, std::ostream &ost)
Definition: action_cb.cpp:421
long int element_image_of(long int a, void *elt, int verbose_level)
Definition: action_cb.cpp:198
Schreier trees for orbits of groups on points.
Definition: groups.h:839
void compute_all_point_orbits(int verbose_level)
Definition: schreier.cpp:988
void init_single_generator(int *elt, int verbose_level)
Definition: schreier.cpp:360
void init(actions::action *A, int verbose_level)
Definition: schreier.cpp:308
a strong generating set for a permutation group with respect to a fixed action
Definition: groups.h:1703
void init_from_data_with_target_go(actions::action *A, int *data_gens, int data_gens_size, int nb_gens, ring_theory::longinteger_object &target_go, data_structures_groups::vector_ge *&nice_gens, int verbose_level)
tactical decomposition of an incidence structure with respect to a given group
void init(int nb_rows, int nb_cols, geometry::incidence_structure *Inc, int f_combined_action, actions::action *Aut, actions::action *A_on_points, actions::action *A_on_lines, groups::strong_generators *gens, int verbose_level)
void init(int n, field_theory::finite_field *F, actions::action *A, actions::action *A2, int verbose_level)
data_structures_groups::vector_ge * nice_gens
Definition: tl_geometry.h:862
apps_combinatorics::tactical_decomposition * T
Definition: tl_geometry.h:878
#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_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