Orbiter 2022
Combinatorial Objects
orbits_on_subspaces.cpp
Go to the documentation of this file.
1/*
2 * orbits_on_subspaces.cpp
3 *
4 * Created on: Oct 20, 2021
5 * Author: betten
6 */
7
8
9
10
11#include "orbiter.h"
12
13using namespace std;
14
15namespace orbiter {
16namespace layer5_applications {
17namespace apps_algebra {
18
19
20static long int orbits_on_subspaces_rank_point_func(int *v, void *data);
21static void orbits_on_subspaces_unrank_point_func(int *v, long int rk, void *data);
22static void orbits_on_subspaces_early_test_func(long int *S, int len,
23 long int *candidates, int nb_candidates,
24 long int *good_candidates, int &nb_good_candidates,
25 void *data, int verbose_level);
26
27
28
30{
31 GTA = NULL;
32
38
39}
40
41
42
44{
45}
46
49 int depth,
50 int verbose_level)
51{
52 int f_v = (verbose_level >= 1);
53
54 if (f_v) {
55 cout << "orbits_on_subspaces::init" << endl;
56 }
58
59
60 int n;
61
62 n = GTA->AG->LG->n;
63
64 Control->f_depth = TRUE;
65 Control->depth = depth;
66 if (f_v) {
67 cout << "orbits_on_subspaces::init "
68 "Control->max_depth=" << Control->depth << endl;
69 }
70
71
74
75
76
79
81 orbits_on_subspaces_VS->init(GTA->AG->LG->F, n /* dimension */, verbose_level - 1);
83 orbits_on_subspaces_rank_point_func,
84 orbits_on_subspaces_unrank_point_func,
85 this,
86 verbose_level - 1);
87
88
89#if 0
90 if (Descr->f_print_generators) {
91 int f_print_as_permutation = FALSE;
92 int f_offset = TRUE;
93 int offset = 1;
94 int f_do_it_anyway_even_for_big_degree = TRUE;
95 int f_print_cycles_of_length_one = TRUE;
96
97 cout << "orbits_on_subspaces::init "
98 "printing generators "
99 "for the group:" << endl;
100 LG->Strong_gens->gens->print(cout,
101 f_print_as_permutation,
102 f_offset, offset,
103 f_do_it_anyway_even_for_big_degree,
104 f_print_cycles_of_length_one);
105 }
106#endif
107
110 GTA->AG->A /* LG->A2 */, GTA->AG->Subgroup_gens /* ->LG->Strong_gens */,
112 verbose_level);
114 orbits_on_subspaces_early_test_func,
115 this /* void *data */,
116 verbose_level);
117
118
119
120 if (f_v) {
121 cout << "orbits_on_subspaces::init "
122 "GTA->AG->LG->label=" << GTA->AG->LG->label << endl;
123 }
124
125 Control->problem_label.assign(GTA->AG->LG->label);
126 Control->f_problem_label = TRUE;
127
130 Control->depth, verbose_level);
131
132
133
134 int schreier_depth = Control->depth;
135 int f_use_invariant_subset_if_available = FALSE;
136 int f_debug = FALSE;
137 int nb_orbits;
138
140 int t0 = Os.os_ticks();
141
142 if (f_v) {
143 cout << "orbits_on_subspaces::init "
144 "calling generator_main" << endl;
145 cout << "A=";
147 cout << "A2=";
149 }
151 schreier_depth,
152 f_use_invariant_subset_if_available,
153 f_debug,
154 verbose_level - 1);
155
156
157 if (f_v) {
158 cout << "orbits_on_subspaces::init "
159 "done with generator_main" << endl;
160 }
161 nb_orbits = orbits_on_subspaces_PC->nb_orbits_at_level(Control->depth);
162 if (f_v) {
163 cout << "orbits_on_subspaces::init we found "
164 << nb_orbits << " orbits at depth "
165 << Control->depth << endl;
166 }
167
169 orbits_on_subspaces_PC, Control->depth, verbose_level);
170
171
172
173
174 if (f_v) {
175 cout << "orbits_on_subspaces::init done" << endl;
176 }
177}
178
179
180
181// #############################################################################
182// global functions:
183// #############################################################################
184
185
186static long int orbits_on_subspaces_rank_point_func(int *v, void *data)
187{
191 long int rk;
192
193 //cout << "orbits_on_subspaces_rank_point_func temporarily disabled" << endl;
194 //exit(1);
195
196
197 OoS = (orbits_on_subspaces *) data;
198 G = OoS->GTA;
199 gen = OoS->orbits_on_subspaces_PC;
201 gen->get_VS()->dimension, rk);
202 return rk;
203}
204
205static void orbits_on_subspaces_unrank_point_func(int *v, long int rk, void *data)
206{
207 orbits_on_subspaces *OoS;
208 group_theoretic_activity *G;
210
211 //cout << "orbits_on_subspaces_unrank_point_func temporarily disabled" << endl;
212 //exit(1);
213
214 OoS = (orbits_on_subspaces *) data;
215 G = OoS->GTA;
216 gen = OoS->orbits_on_subspaces_PC;
217 gen->get_VS()->F->PG_element_unrank_modified(v, 1,
218 gen->get_VS()->dimension, rk);
219}
220
221static void orbits_on_subspaces_early_test_func(long int *S, int len,
222 long int *candidates, int nb_candidates,
223 long int *good_candidates, int &nb_good_candidates,
224 void *data, int verbose_level)
225{
226 //verbose_level = 1;
227
228 orbits_on_subspaces *OoS;
229 group_theoretic_activity *G;
230 //poset_classification *gen;
231 int f_v = (verbose_level >= 1);
232 int i;
233
234 OoS = (orbits_on_subspaces *) data;
235 G = OoS->GTA;
236
237 //gen = G->orbits_on_subspaces_PC;
238
239 if (f_v) {
240 cout << "gorbits_on_subspaces_early_test_func" << endl;
241 cout << "testing " << nb_candidates << " candidates" << endl;
242 }
243 nb_good_candidates = 0;
244 for (i = 0; i < nb_candidates; i++) {
245 S[len] = candidates[i];
246 if (G->AG->subspace_orbits_test_set(len + 1, S, verbose_level - 1)) {
247 good_candidates[nb_good_candidates++] = candidates[i];
248 }
249 }
250 if (f_v) {
251 cout << "orbits_on_subspaces_early_test_func" << endl;
252 cout << "Out of " << nb_candidates << " candidates, "
253 << nb_good_candidates << " survive" << endl;
254 }
255}
256
257
258
259
260}}}
261
262
finite dimensional vector space over a finite field
Definition: algebra.h:688
void init(field_theory::finite_field *F, int dimension, int verbose_level)
void init_rank_functions(long int(*rank_point_func)(int *v, void *data), void(*unrank_point_func)(int *v, long int rk, void *data), void *data, int verbose_level)
void PG_element_unrank_modified(int *v, int stride, int len, int a)
void PG_element_rank_modified_lint(int *v, int stride, int len, long int &a)
to control the behavior of the poset classification algorithm
void initialize_and_allocate_root_node(poset_classification_control *PC_control, poset_with_group_action *Poset, int depth, int verbose_level)
int main(int t0, int schreier_depth, int f_use_invariant_subset_if_available, int f_debug, int verbose_level)
void init_subspace_lattice(actions::action *A, actions::action *A2, groups::strong_generators *Strong_gens, algebra::vector_space *VS, int verbose_level)
void add_testing_without_group(void(*func)(long int *S, int len, long int *candidates, int nb_candidates, long int *good_candidates, int &nb_good_candidates, void *data, int verbose_level), void *data, int verbose_level)
void orbits_on_poset_post_processing(poset_classification::poset_classification *PC, int depth, int verbose_level)
Definition: any_group.cpp:1649
poset_classification::poset_with_group_action * orbits_on_subspaces_Poset
void init(group_theoretic_activity *GTA, poset_classification::poset_classification_control *Control, int depth, int verbose_level)
#define NEW_OBJECT(type)
Definition: foundations.h:638
#define NEW_int(n)
Definition: foundations.h:625
#define TRUE
Definition: foundations.h:231
#define FALSE
Definition: foundations.h:234
the orbiter library for the classification of combinatorial objects