Orbiter 2022
Combinatorial Objects
norm_tables.cpp
Go to the documentation of this file.
1// norm_tables.cpp
2//
3// Anton Betten
4// 11/28/2008
5//
6//
7//
8//
9//
10
11#include "foundations.h"
12
13using namespace std;
14
15
16namespace orbiter {
17namespace layer1_foundations {
18namespace field_theory {
19
20
22{
23 norm_table = NULL;
24 norm_table_sorted = NULL;
25 sorting_perm = NULL;
26 sorting_perm_inv = NULL;
27 nb_types = 0;
28 type_first = NULL;
29 type_len = NULL;
30 the_type = NULL;
31}
32
34{
35 if (norm_table) {
37 norm_table = NULL;
38 }
41 norm_table_sorted = NULL;
42 }
43 if (sorting_perm) {
45 sorting_perm = NULL;
46 }
47 if (sorting_perm_inv) {
49 sorting_perm_inv = NULL;
50 }
51 if (type_first) {
53 type_first = NULL;
54 }
55 if (type_len) {
57 type_len = NULL;
58 }
59 if (the_type) {
61 the_type = NULL;
62 }
63}
64
66{
67 int qq = U.FQ->q;
68 int i, f, l, j, a, b, c, jj;
70
71 norm_table = NEW_int(qq);
72 for (i = 1; i < qq; i++) {
73 norm_table[i - 1] = U.N2(i);
74 }
75
79
80 //cout << "nb_types=" << NT.nb_types << endl;
82 for (i = 0; i < nb_types; i++) {
83 f = type_first[i];
84 l = type_len[i];
85 //cout << "type " << i << " f=" << f << " l=" << l << endl;
86 for (j = 0; j < l; j++) {
87 jj = f + j;
88 a = sorting_perm_inv[jj];
89 b = a + 1;
90 c = U.N2(b);
91 //cout << "j=" << j << " a=" << a << " b=" << b
92 // << " N2(b)=" << c << endl;
93 if (j == 0) {
94 the_type[i] = c;
95 }
96 }
97 }
98
99}
100
102 int norm, int verbose_level)
103{
104 int idx, f, gamma;
106
107 Sorting.int_vec_search(the_type, nb_types, norm, idx);
108 f = type_first[idx];
109 //l = type_len[idx];
110 gamma = sorting_perm_inv[f + 0] + 1;
111 return gamma;
112}
113
114}}}
115
a collection of functions related to sorted vectors
int int_vec_search(int *v, int len, int a, int &idx)
Definition: sorting.cpp:1094
void int_vec_classify(int length, int *the_vec, int *&the_vec_sorted, int *&sorting_perm, int *&sorting_perm_inv, int &nb_types, int *&type_first, int *&type_len)
Definition: sorting.cpp:1503
int choose_an_element_of_given_norm(int norm, int verbose_level)
void init(orthogonal_geometry::unusual_model &U, int verbose_level)
Definition: norm_tables.cpp:65
Penttila's unusual model to create BLT-sets.
Definition: orthogonal.h:676
#define FREE_int(p)
Definition: foundations.h:640
#define NEW_int(n)
Definition: foundations.h:625
the orbiter library for the classification of combinatorial objects