Orbiter 2022
Combinatorial Objects
andre_construction_line_element.cpp
Go to the documentation of this file.
1// andre_construction_line_element.cpp
2//
3// Anton Betten
4// May 31, 2013
5//
6//
7//
8//
9//
10
11#include "foundations.h"
12
13using namespace std;
14
15
16
17namespace orbiter {
18namespace layer1_foundations {
19namespace geometry {
20
21
22
24{
25 null();
26}
27
29{
30 freeself();
31}
32
34{
35 pivots = NULL;
36 non_pivots = NULL;
37 coset = NULL;
38 coordinates = NULL;
39}
40
42{
43 if (pivots) {
45 }
46 if (non_pivots) {
48 }
49 if (coset) {
51 }
52 if (coordinates) {
54 }
55 null();
56}
57
59 andre_construction *Andre, int verbose_level)
60{
61 int f_v = (verbose_level >= 1);
62
63 if (f_v) {
64 cout << "andre_construction_line_element::init" << endl;
65 }
72 pivots = NEW_int(k);
73 non_pivots = NEW_int(n - k);
74 coset = NEW_int(n - k);
75 coordinates = NEW_int((k + 1) * n);
76 if (f_v) {
77 cout << "andre_construction_line_element::init done" << endl;
78 }
79}
80
82 int line_rank, int verbose_level)
83{
84 int f_v = (verbose_level >= 1);
85 int i, j, a;
87
88 if (f_v) {
89 cout << "andre_construction_line_element::unrank "
90 "line_rank=" << line_rank << endl;
91 }
93 if (line_rank < 1) {
95 }
96 else {
98 line_rank -= 1;
101 Gg.AG_element_unrank(q, coset, 1, n - k, coset_idx);
104 coordinates, k * n);
105 for (i = 0; i < n - k; i++) {
107 parallel_class_idx * (n - k) + i];
108 }
109 for (i = 0; i < k; i++) {
111 }
112 for (i = 0; i < n; i++) {
113 coordinates[k * n + i] = 0;
114 }
115 for (i = 0; i < n - k; i++) {
116 a = coset[i];
117 j = non_pivots[i];
118 coordinates[k * n + j] = a;
119 }
120 }
121 if (f_v) {
122 cout << "andre_construction_line_element::unrank done" << endl;
123 }
124}
125
127{
128 int f_v = (verbose_level >= 1);
129 int i, j, a, rk, idx;
133
134 if (f_v) {
135 cout << "andre_construction_line_element::rank" << endl;
136 }
137 line_rank = 0;
138 if (f_is_at_infinity) {
139 line_rank = 0;
140 }
141 else {
142 line_rank = 1;
143
145 k, n, pivots,
146 0 /* verbose_level */);
147 Combi.set_complement(pivots, k, non_pivots, a, n);
148
149 for (i = 0; i < k; i++) {
151 coordinates + k * n, n, pivots[i],
152 0 /* verbose_level */);
153 // afterwards: v2[idx] = 0 and v1,v2
154 // span the same space as before
155 // v1 is not changed if v1[idx] is nonzero
156 }
157 for (i = 0; i < n - k; i++) {
158 j = non_pivots[i];
159 a = coordinates[k * n + j];
160 coset[i] = a;
161 }
162 coset_idx = Gg.AG_element_rank(q, coset, 1, n - k);
163
165 coordinates, 0 /* verbose_level*/);
167 spread_size, rk, idx, 0)) {
168 cout << "andre_construction_line_element::rank cannot "
169 "find the spread element in the sorted list" << endl;
170 exit(1);
171 }
174 }
175 if (f_v) {
176 cout << "andre_construction_line_element::unrank done" << endl;
177 }
178 return line_rank;
179}
180
182 int idx, int verbose_level)
183// 0 \le idx \le order
184{
185 int f_v = (verbose_level >= 1);
186 int *vec1;
187 int *vec2;
188 int point_rank, a;
190
191 if (f_v) {
192 cout << "andre_construction_line_element::make_"
193 "affine_point" << endl;
194 }
195 vec1 = NEW_int(k + 1);
196 vec2 = NEW_int(n);
197 Gg.AG_element_unrank(q, vec1, 1, k, idx);
198 vec1[k] = 1;
199
201
202 point_rank = spread_size;
203 a = Gg.AG_element_rank(q, vec2, 1, n);
204 point_rank += a;
205
206 FREE_int(vec1);
207 FREE_int(vec2);
208 if (f_v) {
209 cout << "andre_construction_line_element::make_"
210 "affine_point done" << endl;
211 }
212 return point_rank;
213}
214
215}}}
216
217
void set_complement(int *subset, int subset_size, int *complement, int &size_complement, int universal_set_size)
a collection of functions related to sorted vectors
int lint_vec_search(long int *v, int len, long int a, int &idx, int verbose_level)
Definition: sorting.cpp:1157
Andre / Bruck / Bose construction of a translation plane from a spread.
Definition: geometry.h:28
various functions related to geometries
Definition: geometry.h:721
void AG_element_unrank(int q, int *v, int stride, int len, long int a)
long int AG_element_rank(int q, int *v, int stride, int len)
long int rank_lint_here(int *Mtx, int verbose_level)
Definition: grassmann.cpp:275
void mult_vector_from_the_left(int *v, int *A, int *vA, int m, int n)
void Gauss_step(int *v1, int *v2, int len, int idx, int verbose_level)
int Gauss_simple(int *A, int m, int n, int *base_cols, 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_copy(A, B, C)
Definition: foundations.h:693
the orbiter library for the classification of combinatorial objects