14namespace layer5_applications {
15namespace apps_combinatorics {
19static void hadamard_classify_early_test_function(
long int *S,
int len,
20 long int *candidates,
int nb_candidates,
21 long int *good_candidates,
int &nb_good_candidates,
22 void *data,
int verbose_level);
27 int verbose_level,
int verbose_level_clique)
29 int f_v = (verbose_level = 1);
30 int i, j, k, d, cnt, cnt1;
34 if (
n > (
int)
sizeof(int) * 8) {
35 cout <<
"n > sizeof(uint) * 8" << endl;
46 cout <<
"n =" <<
n << endl;
47 cout <<
"N =" <<
N << endl;
50 N2 = (
N * (
N - 1)) >> 1;
53 cout <<
"N2 = (N * (N - 1)) >> 1 =" <<
N2 << endl;
54 cout <<
"list of points:" << endl;
55 for (i = 0; i <
N; i++) {
58 for (j = 0; j <
n; j++) {
78 cout <<
"after allocating adjacency bitvector" << endl;
79 cout <<
"computing adjacency matrix:" << endl;
83 for (i = 0; i <
N; i++) {
84 for (j = i + 1; j <
N; j++) {
89 cout <<
"dotproduct i=" << i <<
" j=" << j <<
" is " << d << endl;
100 if ((k & ((1 << 13) - 1)) == 0) {
101 cout <<
"i=" << i <<
" j=" << j <<
" k=" << k <<
" / " <<
N2 << endl;
105 cout <<
"We have " << cnt <<
" edges in the graph" << endl;
113 for (i = 0; i <
N; i++) {
114 for (j = i + 1; j <
N; j++) {
117 if (bitvector_s_i(bitvector_adjacency, k)) {
120 if (bitvector_s_i(bitvector_adjacency, k) && d) {
121 cout <<
"something is wrong in entry i=" << i <<
" j=" << j << endl;
122 cout <<
"dotproduct i=" << i <<
" j=" << j <<
" is " << d << endl;
123 cout <<
"bitvector_s_i(bitvector_adjacency, k)="
124 << bitvector_s_i(bitvector_adjacency, k) << endl;
130 cout <<
"We found " << cnt1 <<
" edges in the graph" << endl;
133 cout <<
"cnt1 != cnt, something is wrong" << endl;
134 cout <<
"cnt=" << cnt << endl;
135 cout <<
"cnt1=" << cnt1 << endl;
142 string label, label_tex;
144 sprintf(str,
"Hadamard_graph_%d",
n);
146 sprintf(str,
"Hadamard\\_graph\\_%d",
n);
147 label_tex.assign(str);
164 fname.append(
".colored_graph");
166 CG->
save(fname, verbose_level);
179 cout <<
"initializing colored graph" << endl;
190 cout <<
"initializing colored graph done" << endl;
195 sprintf(str,
"Hadamard_graph_%d.magma",
n);
196 fname_graph.assign(label);
197 fname_graph.append(
".magma");
208 for (i = 0; i <
N; i++) {
209 for (j = i + 1; j <
N; j++) {
212 color_graph[i *
N + j] = 2;
213 color_graph[j *
N + i] = 2;
216 color_graph[i *
N + j] = 1;
217 color_graph[j *
N + i] = 1;
222 cout <<
"We found " << cnt1 <<
" edges in the graph" << endl;
225 cout <<
"cnt1 != cnt, something is wrong" << endl;
226 cout <<
"cnt=" << cnt << endl;
227 cout <<
"cnt1=" << cnt1 << endl;
231 cout <<
"color graph:" << endl;
236 cout <<
"Too big to print" << endl;
244 is_association_scheme(color_graph,
N, Pijk,
245 colors, nb_colors, verbose_level);
247 cout <<
"number of colors = " << nb_colors << endl;
249 int_vec_print(cout, colors, nb_colors);
251 cout <<
"Pijk:" << endl;
252 for (i = 0; i < nb_colors; i++) {
253 cout <<
"i=" << i <<
":" << endl;
254 int_matrix_print(Pijk + i * nb_colors * nb_colors, nb_colors, nb_colors);
265 cout <<
"drawing adjacency matrix" << endl;
271 sprintf(str,
"Hadamard_graph_%d",
n);
272 fname_base.assign(str);
280 cout <<
"drawing adjacency matrix done" << endl;
286 cout <<
"computing automorphism group of "
287 "uncolored graph:" << endl;
300 cout <<
"computing automorphism group of "
301 "uncolored graph done, group order = " << go << endl;
307 fname_group.assign(
"Hadamard_group_");
308 sprintf(str,
"%d",
n);
309 fname_group.append(str);
310 fname_group.append(
".magma");
316 sprintf(prefix,
"./had_%d",
n);
319 cout <<
"Starting the clique finder, "
320 "target_depth = " <<
n <<
" prefix=" << prefix << endl;
331 hadamard_classify_early_test_function,
348 verbose_level_clique);
364 cout <<
"Orbit " << h <<
" is the set ";
370 cout <<
"is a clique" << endl;
373 cout <<
"is not a clique, this should not happen" << endl;
377 for (j = 0; j <
n; j++) {
379 for (i = 0; i <
n; i++) {
389 cout <<
"The Hadamard matrix " << h <<
" is:" << endl;
391 for (i = 0; i <
n; i++) {
392 for (j = 0; j <
n; j++) {
398 for (i = 0; i <
n; i++) {
399 for (j = 0; j <
n; j++) {
401 for (k = 0; k <
n; k++) {
402 c += H[i *
n + k] * Ht[k *
n + j];
407 cout <<
"The matrix H * H^t is:" << endl;
414 long int i, j, a, b, idx;
417 for (i = 0; i <
n; i++) {
419 for (j = i + 1; j <
n; j++) {
435 long int *candidates,
int nb_candidates,
436 long int *good_candidates,
int &nb_good_candidates,
439 int f_v = (verbose_level >= 1);
444 cout <<
"hadamard_classify::early_test_func checking set ";
447 cout <<
"candidate set of size " << nb_candidates <<
":" << endl;
452 nb_good_candidates = nb_candidates;
459 nb_good_candidates = 0;
460 for (j = 0; j < nb_candidates; j++) {
464 good_candidates[nb_good_candidates++] = a;
476 for (i = 0; i <
n; i++) {
491void hadamard_classify_early_test_function(
long int *S,
int len,
492 long int *candidates,
int nb_candidates,
493 long int *good_candidates,
int &nb_good_candidates,
494 void *data,
int verbose_level)
497 int f_v = (verbose_level >= 1);
500 cout <<
"early_test_function for set ";
505 candidates, nb_candidates,
506 good_candidates, nb_good_candidates,
509 cout <<
"early_test_function done" << endl;
a collection of combinatorial functions
long int ij2k_lint(long int i, long int j, long int n)
compact storage of 0/1-data as bitvectors
void m_i(long int i, int a)
void allocate(long int length)
various functions related to geometries
void AG_element_unrank(int q, int *v, int stride, int len, long int a)
a graph with a vertex coloring
void draw(std::string &fname, graphics::layered_graph_draw_options *Draw_options, int verbose_level)
void save(std::string &fname, int verbose_level)
void export_to_magma(std::string &fname, int verbose_level)
void init(int nb_points, int nb_colors, int nb_colors_per_vertex, int *colors, data_structures::bitvector *Bitvec, int f_ownership_of_bitvec, std::string &label, std::string &label_tex, int verbose_level)
int is_adjacent(int i, int j)
a class to represent arbitrary precision integers
groups::strong_generators * Strong_gens
void group_order(ring_theory::longinteger_object &go)
Interface to the graph canonization software Nauty.
action * create_automorphism_group_of_graph_bitvec(int n, data_structures::bitvector *Bitvec, int verbose_level)
void export_permutation_group_to_magma(std::string &fname, actions::action *A2, int verbose_level)
to control the behavior of the poset classification algorithm
std::string problem_label
the poset classification algorithm
int nb_orbits_at_level(int level)
void compute_orbits_on_subsets(int target_depth, poset_classification_control *PC_control, poset_with_group_action *Poset, int verbose_level)
void get_set_by_level(int level, int node, long int *set)
a poset with a group action on it
void init_subset_lattice(actions::action *A, actions::action *A2, groups::strong_generators *Strong_gens, int verbose_level)
void add_testing_without_group(void(*func)(long int *S, int len, long int *candidates, int nb_candidates, long int *good_candidates, int &nb_good_candidates, void *data, int verbose_level), void *data, int verbose_level)
classification of Hadamard matrices
int clique_test(long int *set, int sz)
graph_theory::colored_graph * CG
void init(int n, int f_draw, int verbose_level, int verbose_level_clique)
void early_test_func(long int *S, int len, long int *candidates, int nb_candidates, long int *good_candidates, int &nb_good_candidates, int verbose_level)
data_structures::bitvector * Bitvec
poset_classification::poset_classification * gen
int dot_product(int a, int b, int n)
#define Lint_vec_copy(A, B, C)
#define Int_vec_zero(A, B)
#define Lint_vec_print(A, B, C)
#define Int_matrix_print(A, B, C)
orbiter_kernel_system::orbiter_session * Orbiter
global Orbiter session
the orbiter library for the classification of combinatorial objects