Orbiter 2022
Combinatorial Objects
action_on_cosets.cpp
Go to the documentation of this file.
1// action_on_cosets.cpp
2//
3// Anton Betten
4// Dec 24, 2013
5
7#include "group_actions.h"
8
9using namespace std;
10
11
12namespace orbiter {
13namespace layer3_group_actions {
14namespace induced_actions {
15
16
18{
19 null();
20}
21
23{
24 freeself();
25}
26
28{
29 v1 = NULL;
30 v2 = NULL;
31}
32
34{
35 int f_v = FALSE;
36 //int f_vv = FALSE;
37
38 if (f_v) {
39 cout << "action_on_cosets::free" << endl;
40 }
41 if (v1) {
42 FREE_int(v1);
43 }
44 if (v2) {
45 FREE_int(v2);
46 }
47 null();
48 if (f_v) {
49 cout << "action_on_cosets::free done" << endl;
50 }
51}
52
53void action_on_cosets::init(int nb_points, int *Points,
54 actions::action *A_linear,
56 int dimension_of_subspace,
57 int n,
58 int *subspace_basis,
59 int *base_cols,
60 void (*unrank_point)(int *v, int a, void *data),
61 int (*rank_point)(int *v, void *data),
62 void *rank_unrank_data,
63 int verbose_level)
64{
65 int f_v = FALSE;
66 int i;
67
68 if (f_v) {
69 cout << "action_on_cosets::init nb_points=" << nb_points
70 << " dimension_of_subspace=" << dimension_of_subspace
71 << " n=" << n << endl;
72 }
73 f_lint = FALSE;
85 v1 = NEW_int(n);
86 v2 = NEW_int(n);
87 for (i = 0; i < nb_points - 1; i++) {
88 if (Points[i] >= Points[i + 1]) {
89 cout << "action_on_cosets::init the array Points[] "
90 "is not sorted increasingly" << endl;
91 exit(1);
92 }
93 }
94 if (f_v) {
95 cout << "action_on_cosets::init done" << endl;
96 }
97}
98
99void action_on_cosets::init_lint(int nb_points, long int *Points,
100 actions::action *A_linear,
102 int dimension_of_subspace,
103 int n,
104 int *subspace_basis,
105 int *base_cols,
106 void (*unrank_point)(int *v, long int a, void *data),
107 long int (*rank_point)(int *v, void *data),
108 void *rank_unrank_data,
109 int verbose_level)
110{
111 int f_v = FALSE;
112 int i;
113
114 if (f_v) {
115 cout << "action_on_cosets::init_lint nb_points=" << nb_points
116 << " dimension_of_subspace=" << dimension_of_subspace
117 << " n=" << n << endl;
118 }
119
120 f_lint = TRUE;
132 v1 = NEW_int(n);
133 v2 = NEW_int(n);
134 for (i = 0; i < nb_points - 1; i++) {
135 if (Points[i] >= Points[i + 1]) {
136 cout << "action_on_cosets::init_lint the array Points[] "
137 "is not sorted increasingly" << endl;
138 exit(1);
139 }
140 }
141 if (f_v) {
142 cout << "action_on_cosets::init done" << endl;
143 }
144}
145
146void action_on_cosets::reduce_mod_subspace(int *v, int verbose_level)
147{
149 subspace_basis, base_cols, v, verbose_level);
150}
151
152
153long int action_on_cosets::compute_image(int *Elt, long int i, int verbose_level)
154{
155 int f_v = (verbose_level >= 1);
156 int f_vv = (verbose_level >= 2);
157 int idx;
159
160 if (f_v) {
161 cout << "action_on_cosets::compute_image i = " << i << endl;
162 }
163 if (i >= nb_points) {
164 cout << "action_on_cosets::compute_image "
165 "i = " << i << " i >= nb_points" << endl;
166 exit(1);
167 }
168 if (f_lint) {
169 (*unrank_point_lint)(v1, lint_Points[i], rank_unrank_data);
170 }
171 else {
172 (*unrank_point)(v1, Points[i], rank_unrank_data);
173 }
174 if (f_vv) {
175 cout << "action_on_cosets::compute_image after unrank:";
176 Int_vec_print(cout, v1, n);
177 cout << endl;
178 }
179
181 Elt, 0/*verbose_level - 1*/);
182
183 if (f_vv) {
184 cout << "action_on_cosets::compute_image "
185 "after element_image_of_low_level:";
186 Int_vec_print(cout, v2, n);
187 cout << endl;
188 }
189
190 reduce_mod_subspace(v2, 0 /* verbose_level */);
191
192 if (f_vv) {
193 cout << "action_on_cosets::compute_image "
194 "after reduce_mod_subspace:";
195 Int_vec_print(cout, v2, n);
196 cout << endl;
197 }
198 if (f_lint) {
199 long int R;
200
201 R = (*rank_point_lint)(v2, rank_unrank_data);
202 if (f_vv) {
203 cout << "action_on_cosets::compute_image after "
204 "rank, R = " << R << endl;
205 }
206 if (!Sorting.lint_vec_search(lint_Points, nb_points, R, idx, verbose_level)) {
207 cout << "action_on_cosets::compute_image image "
208 << R << " not found in list of points (using lint)" << endl;
209
210 Sorting.lint_vec_search(lint_Points, nb_points, R, idx, 2 /*verbose_level*/);
211
212 cout << "action_on_cosets::compute_image image "
213 << R << " not found in list of points (using lint)" << endl;
214
215
216 exit(1);
217 }
218 }
219 else {
220 int r;
221
222 r = (*rank_point)(v2, rank_unrank_data);
223 if (f_vv) {
224 cout << "action_on_cosets::compute_image after "
225 "rank, r = " << r << endl;
226 }
227 if (!Sorting.int_vec_search(Points, nb_points, r, idx)) {
228 cout << "action_on_cosets::compute_image image "
229 << r << " not found in list of points (using int)" << endl;
230 exit(1);
231 }
232 }
233 if (f_v) {
234 cout << "action_on_cosets::compute_image image "
235 "of " << i << " is " << idx << endl;
236 }
237 return idx;
238}
239
240
241
242}}}
243
a collection of functions related to sorted vectors
int int_vec_search(int *v, int len, int a, int &idx)
Definition: sorting.cpp:1094
int lint_vec_search(long int *v, int len, long int a, int &idx, int verbose_level)
Definition: sorting.cpp:1157
void reduce_mod_subspace(int k, int len, int *basis, int *base_cols, int *v, int verbose_level)
a permutation group in a fixed action.
Definition: actions.h:99
void element_image_of_low_level(int *input, int *output, void *elt, int verbose_level)
Definition: action_cb.cpp:209
void init(int nb_points, int *Points, actions::action *A_linear, field_theory::finite_field *F, int dimension_of_subspace, int n, int *subspace_basis, int *base_cols, void(*unrank_point)(int *v, int a, void *data), int(*rank_point)(int *v, void *data), void *rank_unrank_data, int verbose_level)
void init_lint(int nb_points, long int *Points, actions::action *A_linear, field_theory::finite_field *F, int dimension_of_subspace, int n, int *subspace_basis, int *base_cols, void(*unrank_point)(int *v, long int a, void *data), long int(*rank_point)(int *v, void *data), void *rank_unrank_data, int verbose_level)
long int compute_image(int *Elt, long int i, int verbose_level)
#define FREE_int(p)
Definition: foundations.h:640
#define NEW_int(n)
Definition: foundations.h:625
#define TRUE
Definition: foundations.h:231
#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