Orbiter 2022
Combinatorial Objects
action_on_bricks.cpp
Go to the documentation of this file.
1// action_on_bricks.cpp
2//
3// Anton Betten
4// Jan 10, 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 free();
25}
26
28{
29 A = NULL;
30 B = NULL;
31}
32
34{
35 null();
36}
37
39 int f_linear_action, int verbose_level)
40{
41 int f_v = (verbose_level >= 1);
42
43 if (f_v) {
44 cout << "action_on_bricks::init q=" << B->q
45 << " f_linear_action=" << f_linear_action << endl;
46 }
51 if (f_v) {
52 cout << "action_on_bricks::init degree=" << degree << endl;
53 }
54 if (f_v) {
55 cout << "action_on_bricks::init done" << endl;
56 }
57}
58
60 long int i, int verbose_level)
61{
62 long int j;
63
64 if (f_linear_action) {
65 j = compute_image_linear_action(Elt, i, verbose_level);
66 }
67 else {
68 j = compute_image_permutation_action(Elt, i, verbose_level);
69 }
70 return j;
71}
72
74 long int i, int verbose_level)
75{
76 //verbose_level = 3; // !!!
77 int f_v = (verbose_level >= 1);
78 //int f_vv = (verbose_level >= 2);
79 int v[3], w[3], rk_v, rk_w;
80 int vv[3], ww[3], rk_vv, rk_ww;
81 long int j;
82
83 if (f_v) {
84 cout << "action_on_bricks::compute_image "
85 "i = " << i << endl;
86 }
87 if (i < 0 || i >= degree) {
88 cout << "action_on_bricks::compute_image "
89 "i = " << i << " out of range" << endl;
90 exit(1);
91 }
92 B->unrank_coordinates(i, v[0], v[1], w[0], w[1], 0);
93 v[2] = 1;
94 w[2] = 1;
95 if (f_v) {
96 cout << "action_on_bricks::compute_image v=";
97 Int_vec_print(cout, v, 3);
98 cout << endl;
99 cout << "action_on_bricks::compute_image w=";
100 Int_vec_print(cout, w, 3);
101 cout << endl;
102 }
103
104 B->F->PG_element_rank_modified(v, 1, 3, rk_v);
105 B->F->PG_element_rank_modified(w, 1, 3, rk_w);
106 if (f_v) {
107 cout << "action_on_bricks::compute_image rk_v=" << rk_v << endl;
108 cout << "action_on_bricks::compute_image rk_w=" << rk_w << endl;
109 cout << "action_on_bricks::compute_image A=" << endl;
110 A->element_print_quick(Elt, cout);
111 }
112 rk_vv = A->image_of(Elt, rk_v);
113 rk_ww = A->image_of(Elt, rk_w);
114 if (f_v) {
115 cout << "action_on_bricks::compute_image rk_vv=" << rk_vv << endl;
116 cout << "action_on_bricks::compute_image rk_ww=" << rk_ww << endl;
117 }
118 B->F->PG_element_unrank_modified(vv, 1, 3, rk_vv);
119 B->F->PG_element_unrank_modified(ww, 1, 3, rk_ww);
120 if (f_v) {
121 cout << "action_on_bricks::compute_image vv=";
122 Int_vec_print(cout, vv, 3);
123 cout << endl;
124 cout << "action_on_bricks::compute_image ww=";
125 Int_vec_print(cout, ww, 3);
126 cout << endl;
127 }
128 if (vv[2] == 0) {
129 cout << "action_on_bricks::compute_image vv[2] == 0" << endl;
130 exit(1);
131 }
132 if (ww[2] == 0) {
133 cout << "action_on_bricks::compute_image ww[2] == 0" << endl;
134 exit(1);
135 }
136 B->F->PG_element_normalize(vv, 1, 3);
137 B->F->PG_element_normalize(ww, 1, 3);
138 if (f_v) {
139 cout << "action_on_bricks::compute_image after normalize vv=";
140 Int_vec_print(cout, vv, 3);
141 cout << endl;
142 cout << "action_on_bricks::compute_image after normalize ww=";
143 Int_vec_print(cout, ww, 3);
144 cout << endl;
145 }
146 j = B->rank_coordinates(vv[0], vv[1], ww[0], ww[1], 0);
147 if (j < 0 || j >= degree) {
148 cout << "action_on_bricks::compute_image "
149 "j = " << j << " out of range" << endl;
150 exit(1);
151 }
152 return j;
153}
154
156 int *Elt, long int i, int verbose_level)
157{
158 //verbose_level = 3; // !!!
159 int f_v = (verbose_level >= 1);
160 //int f_vv = (verbose_level >= 2);
161 int x0, y0, x1, y1, x2, y2, x3, y3;
162 int a, b, c, d;
163 long int j;
164
165 if (f_v) {
166 cout << "action_on_bricks::compute_image_permutation_action "
167 "i = " << i << endl;
168 }
169 if (i < 0 || i >= degree) {
170 cout << "action_on_bricks::compute_image_permutation_action "
171 "i = " << i << " out of range" << endl;
172 exit(1);
173 }
174 B->unrank_coordinates(i, x0, y0, x1, y1, 0);
175 a = x0 * B->q + y0;
176 b = x1 * B->q + y1;
177
178 if (f_v) {
179 cout << "action_on_bricks::compute_image_permutation_action "
180 "a=" << a << endl;
181 cout << "action_on_bricks::compute_image_permutation_action "
182 "b=" << b << endl;
183 cout << "action_on_bricks::compute_image_permutation_action "
184 "A=" << endl;
185 A->element_print_quick(Elt, cout);
186 }
187 c = A->image_of(Elt, a);
188 d = A->image_of(Elt, b);
189 if (f_v) {
190 cout << "action_on_bricks::compute_image_permutation_action "
191 "c=" << c << endl;
192 cout << "action_on_bricks::compute_image_permutation_action "
193 "d=" << d << endl;
194 }
195 y2 = c % B->q;
196 x2 = c / B->q;
197 y3 = d % B->q;
198 x3 = d / B->q;
199
200 j = B->rank_coordinates(x2, y2, x3, y3, 0);
201 if (j < 0 || j >= degree) {
202 cout << "action_on_bricks::compute_image_permutation_action "
203 "j = " << j << " out of range" << endl;
204 exit(1);
205 }
206 return j;
207}
208
209
210}}}
211
void unrank_coordinates(int rk, int &x1, int &y1, int &x2, int &y2, int verbose_level)
int rank_coordinates(int x1, int y1, int x2, int y2, int verbose_level)
void PG_element_rank_modified(int *v, int stride, int len, int &a)
void PG_element_unrank_modified(int *v, int stride, int len, int a)
a permutation group in a fixed action.
Definition: actions.h:99
void element_print_quick(void *elt, std::ostream &ost)
Definition: action_cb.cpp:353
long int compute_image(int *Elt, long int i, int verbose_level)
long int compute_image_linear_action(int *Elt, long int i, int verbose_level)
long int compute_image_permutation_action(int *Elt, long int i, int verbose_level)
void init(actions::action *A, combinatorics::brick_domain *B, int f_linear_action, int verbose_level)
#define Int_vec_print(A, B, C)
Definition: foundations.h:685
the orbiter library for the classification of combinatorial objects