Orbiter 2022
Combinatorial Objects
andre_construction.cpp
Go to the documentation of this file.
1// andre_construction.cpp
2//
3// Anton Betten
4// May 30, 2013
5//
6//
7//
8//
9//
10
11#include "foundations.h"
12
13using namespace std;
14
15
16namespace orbiter {
17namespace layer1_foundations {
18namespace geometry {
19
20
21
23{
24 null();
25}
26
28{
29 freeself();
30}
31
33{
34 Grass = NULL;
40 pivot = NULL;
41 non_pivot = NULL;
42}
43
45{
46 if (Grass) {
48 }
51 }
54 }
57 }
60 }
63 }
64 if (pivot) {
66 }
67 if (non_pivot) {
69 }
70 null();
71}
72
74 int k, long int *spread_elements_numeric,
75 int verbose_level)
76{
77 int f_v = (verbose_level >= 1);
78 int i, j, a;
82
83 if (f_v) {
84 cout << "andre_construction::init" << endl;
85 }
87 q = F->q;
89 order = NT.i_power_j(q, k);
90 spread_size = order + 1;
91 n = 2 * k;
92 N = order * order + order + 1;
93 if (f_v) {
94 cout << "andre_construction::init order=" << order << endl;
95 cout << "andre_construction::init N=" << N << endl;
96 }
97
99 Grass->init(n, k, F, verbose_level);
100
101 if (f_v) {
102 cout << "andre_construction::init after Grass->init" << endl;
103 }
104
108 for (i = 0; i < spread_size; i++) {
113 }
114
115 if (f_v) {
116 cout << "andre_construction::init allocating "
117 "spread_elements_perm" << endl;
118 }
119
122 for (i = 0; i < spread_size; i++) {
124 }
129 if (f_v) {
130 cout << "andre_construction::init "
131 "int_vec_heapsort_with_log" << endl;
132 }
133 for (i = 0; i < spread_size; i++) {
136 }
137
138 if (f_v) {
139 cout << "andre_construction::init before genma" << endl;
140 }
141
143 for (i = 0; i < spread_size; i++) {
145 spread_elements_genma + i * k * n,
147 }
150 for (i = 0; i < spread_size; i++) {
152 k, n, pivot + i * k, 0 /*verbose_level*/);
153 Combi.set_complement(pivot + i * k, k, non_pivot + i * (n - k), a, n);
154 if (a != n - k) {
155 cout << "andre_construction::init "
156 "problem in set_complement" << endl;
157 }
158 cout << "andre_construction::init spread element " << i
159 << " is " << spread_elements_numeric[i] << ":" << endl;
161 cout << "pivot: ";
162 Int_vec_print(cout, pivot + i * k, k);
163 cout << endl;
164 cout << "non_pivot: ";
165 Int_vec_print(cout, non_pivot + i * (n - k), n - k);
166 cout << endl;
167 }
168 if (f_v) {
169 cout << "andre_construction::init done" << endl;
170 }
171}
172
175 int *pts_on_line, int verbose_level)
176{
177 int f_v = (verbose_level >= 1);
178 int i;
179
180 if (f_v) {
181 cout << "andre_construction::points_on_line" << endl;
182 }
183 if (Line->f_is_at_infinity) {
184 for (i = 0; i < spread_size; i++) {
185 pts_on_line[i] = i;
186 }
187 }
188 else {
189 pts_on_line[0] = Line->parallel_class_idx;
190 for (i = 0; i < order; i++) {
191 pts_on_line[1 + i] = Line->make_affine_point(
192 i, 0 /* verbose_level*/);
193 }
194 }
195 if (f_v) {
196 cout << "andre_construction::points_on_line done" << endl;
197 }
198}
199
200void andre_construction::report(std::ostream &ost, int verbose_level)
201{
202 int f_v = (verbose_level >= 1);
203
204 if (f_v) {
205 cout << "andre_construction::report" << endl;
206 }
207
208
209 ost << "The spread: \\\\" << endl;
210
212
213 if (f_v) {
214 cout << "andre_construction::report done" << endl;
215 }
216}
217
218
219}}}
220
221
222
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
void lint_vec_heapsort_with_log(long int *v, long int *w, int len)
Definition: sorting.cpp:1981
a line in the projective plane created using the Andre construction
Definition: geometry.h:104
void init(field_theory::finite_field *F, int k, long int *spread_elements_numeric, int verbose_level)
void report(std::ostream &ost, int verbose_level)
void points_on_line(andre_construction_line_element *Line, int *pts_on_line, int verbose_level)
to rank and unrank subspaces of a fixed dimension in F_q^n
Definition: geometry.h:892
void print_set_tex(std::ostream &ost, long int *v, int len)
Definition: grassmann.cpp:157
void unrank_lint_here(int *Mtx, long int rk, int verbose_level)
Definition: grassmann.cpp:269
void init(int n, int k, field_theory::finite_field *F, int verbose_level)
Definition: grassmann.cpp:70
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_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 FREE_lint(p)
Definition: foundations.h:642
#define NEW_lint(n)
Definition: foundations.h:628
#define Int_vec_print(A, B, C)
Definition: foundations.h:685
the orbiter library for the classification of combinatorial objects