Orbiter 2022
Combinatorial Objects
substructure_stats_and_selection.cpp
Go to the documentation of this file.
1/*
2 * substructure_stats_and_selection.cpp
3 *
4 * Created on: Jun 9, 2021
5 * Author: betten
6 */
7
8
9
11#include "discreta/discreta.h"
14
15using namespace std;
16
17namespace orbiter {
18namespace layer4_classification {
19
20
21
23{
24 //std::string fname_case_out;
25 SubC = NULL;
26 Pts = NULL;
27 nb_pts = 0;
28 nCk = 0;
29 isotype = NULL;
30 orbit_frequencies = NULL;
31 nb_orbits = 0;
32 T = NULL;
33
34 SoS = NULL;
35 types = NULL;
36 nb_types = 0;
37 selected_type = 0;
40
43
44 gens = NULL;
45 //transporter_to_canonical_form = NULL;
46 //Gens_stabilizer_original_set = NULL;
47}
48
49
51{
52 if (gens) {
54 }
55 if (SoS) {
57 }
58 if (types) {
60 }
61 if (isotype) {
63 }
66 }
67 if (T) {
69 }
72 }
73
74}
75
76
78 std::string &fname_case_out,
80 long int *Pts,
81 int nb_pts,
82 int verbose_level)
83{
84 int f_v = (verbose_level >= 1);
85
86
87 if (f_v) {
88 cout << "substructure_stats_and_selection::init, fname_case_out=" << fname_case_out << " nb_pts=" << nb_pts << endl;
89 }
90
92
96
97 if (f_v) {
98 cout << "substructure_stats_and_selection::init before PC->trace_all_k_subsets_and_compute_frequencies" << endl;
99 }
100
103 0 /*verbose_level*/);
104
105 if (f_v) {
106 cout << "substructure_stats_and_selection::init after PC->trace_all_k_subsets_and_compute_frequencies" << endl;
107 }
108
109
110
111
113
115
116
117 if (f_v) {
118 cout << "substructure_stats_and_selection::init Pts=";
119 Lint_vec_print(cout, Pts, nb_pts);
120 cout << endl;
121 cout << "substructure_stats_and_selection::init orbit isotype=";
122 Int_vec_print(cout, isotype, nCk);
123 cout << endl;
124 cout << "substructure_stats_and_selection::init orbit frequencies=";
126 cout << endl;
127 cout << "substructure_stats_and_selection::init orbit frequency types=";
128 T->print_naked(FALSE /* f_backwards */);
129 cout << endl;
130 }
131
132
134 int i, f, l, idx;
135 int j;
136
137
138
139 SoS = T->get_set_partition_and_types(types, nb_types, verbose_level);
140
142
143
144 selected_type = -1;
145
146 for (i = 0; i < nb_types; i++) {
147 f = T->type_first[i];
148 l = T->type_len[i];
149 cout << types[i];
150 cout << " : ";
151 Lint_vec_print(cout, SoS->Sets[i], SoS->Set_size[i]);
152 cout << " : ";
153
154
155 for (j = 0; j < SoS->Set_size[i]; j++) {
156
157 idx = SoS->Sets[i][j];
158
160
162
163 if (types[i]) {
164
165 // types[i] must be greater than zero
166 // so the type really appears.
167
168 if (selected_type == -1) {
169 selected_type = j;
170 selected_orbit = idx;
172 go.assign_to(go_min);
173 }
174 else {
175 if (D.compare_unsigned(go, go_min) < 0) {
176 selected_type = j;
177 selected_orbit = idx;
179 go.assign_to(go_min);
180 }
181 }
182 }
183
184 cout << go;
185 if (j < SoS->Set_size[i] - 1) {
186 cout << ", ";
187 }
188 }
189 cout << endl;
190 }
191
192 if (f_v) {
193 cout << "selected_type = " << selected_type
194 << " selected_orbit = " << selected_orbit
195 << " selected_frequency = " << selected_frequency
196 << " go_min = " << go_min << endl;
197 }
198
199
200
201
202 if (f_v) {
203 cout << "substructure_stats_and_selection::init" << endl;
204 cout << "selected_orbit = " << selected_orbit << endl;
205 }
206
207 if (f_v) {
208 cout << "substructure_stats_and_selection::init "
209 "we decide to go for subsets of size " << SubC->substructure_size
210 << ", selected_frequency = " << selected_frequency << endl;
211 }
212
213 j = 0;
215 for (i = 0; i < nCk; i++) {
216 if (isotype[i] == selected_orbit) {
217 interesting_subsets[j++] = i;
218 //cout << "subset of rank " << i << " is isomorphic to orbit " << orb_idx << " j=" << j << endl;
219 }
220 }
221 if (j != selected_frequency) {
222 cout << "substructure_stats_and_selection::init j != selected_frequency" << endl;
223 exit(1);
224 }
226#if 0
227 if (f_vv) {
228 print_interesting_subsets(nb_pts, intermediate_subset_size, nb_interesting_subsets, interesting_subsets);
229 }
230#endif
231
232
234 gens,
235 SubC->substructure_size, selected_orbit, verbose_level);
236
237
238
239 if (f_v) {
240 cout << "substructure_stats_and_selection::init" << endl;
241 cout << "stabilizer generators are:" << endl;
243 }
244
245 if (f_v) {
246 cout << "substructure_stats_and_selection::init done" << endl;
247 }
248
249
250}
251
252
253}}
254
255
a statistical analysis of data consisting of single integers
void init(int *data, int data_length, int f_second, int verbose_level)
Definition: tally.cpp:72
data_structures::set_of_sets * get_set_partition_and_types(int *&types, int &nb_types, int verbose_level)
Definition: tally.cpp:702
domain to compute with objects of type longinteger
Definition: ring_theory.h:240
int compare_unsigned(longinteger_object &a, longinteger_object &b)
a class to represent arbitrary precision integers
Definition: ring_theory.h:366
void get_stabilizer_generators(groups::strong_generators *&gens, int level, int orbit_at_level, int verbose_level)
void get_stabilizer_order(int level, int orbit_at_level, ring_theory::longinteger_object &go)
void trace_all_k_subsets_and_compute_frequencies(long int *the_set, int n, int k, int &nCk, int *&isotype, int *&orbit_frequencies, int &nb_orbits, int verbose_level)
poset_classification::poset_classification * PC
void init(std::string &fname_case_out, substructure_classifier *SubC, long int *Pts, int nb_pts, int verbose_level)
#define FREE_int(p)
Definition: foundations.h:640
#define NEW_OBJECT(type)
Definition: foundations.h:638
#define Lint_vec_print(A, B, C)
Definition: foundations.h:686
#define FREE_OBJECT(p)
Definition: foundations.h:651
#define FALSE
Definition: foundations.h:234
#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