18namespace layer4_classification {
19namespace poset_classification {
22void poset_classification::print_set_verbose(
int node)
27void poset_classification::print_set_verbose(
int level,
int orbit)
35void poset_classification::print_set(
int node)
40void poset_classification::print_set(
int level,
int orbit)
49void poset_classification::print_progress_by_extension(
51 int cur,
int prev,
int cur_ex,
52 int nb_ext_cur,
int nb_fuse_cur)
60 cout <<
" **** Upstep extension " << cur_ex <<
" / "
62 << nb_ext_cur <<
" n e w orbits and "
63 << nb_fuse_cur <<
" fusion nodes. We now have "
65 <<
" nodes at level " << size;
71void poset_classification::print_progress(
74 int nb_ext_cur,
int nb_fuse_cur)
82 cout <<
" **** Upstep finished with "
83 << nb_ext_cur <<
" n e w orbits and "
84 << nb_fuse_cur <<
" fusion nodes. We now have "
86 <<
" nodes at level " << size;
92void poset_classification::print_progress(
double progress)
95 long int progress1, progress2;
97 progress0 = progress * 100.;
98 progress2 = (
long int) (progress0 * 100.);
99 progress1 = progress2 / 100;
100 progress2 = progress2 % 100;
101 cout <<
"progress: " << progress1 <<
"."
102 << setw(2) << progress2 <<
" % " << endl;
105void poset_classification::print_progress_by_level(
int lvl)
111void poset_classification::print_orbit_numbers(
int depth)
116 cout <<
"###########################################################"
117 "#######################################" << endl;
119 cout <<
"Found " << nb_nodes <<
" orbits at depth " << depth << endl;
120 for (j = 0; j <= depth; j++) {
128void poset_classification::print()
132 cout <<
"Poset classification:" << endl;
134 cout <<
"Action:" << endl;
136 cout <<
"Action2:" << endl;
138 cout <<
"Group order:" << Poset->
go << endl;
139 cout <<
"Degree:" << Poset->
A2->
degree << endl;
140 cout <<
"depth:" << depth << endl;
142 cout <<
"Found " << nb_nodes <<
" orbits at depth " << depth << endl;
143 for (j = 0; j <= depth; j++) {
149void poset_classification::print_statistic_on_callbacks_naked()
158void poset_classification::print_statistic_on_callbacks()
160 cout <<
"# of calls to image_of/mult/invert/retrieve/store: ";
166void poset_classification::prepare_fname_data_file(std::string &fname,
167 std::string &fname_base,
int depth_completed)
171 fname.assign(fname_base);
172 sprintf(str,
"_%d.data", depth_completed);
176void poset_classification::print_representatives_at_level(
int lvl)
181 cout <<
"The " << l <<
" representatives at level "
182 << lvl <<
" are:" << endl;
183 for (i = 0; i < l; i++) {
184 cout << i <<
" / " << l <<
" : ";
190void poset_classification::print_lex_rank(
long int *set,
int sz)
195 combinatorics_domain Combi;
199 r1 = Combi.rank_subset(set, sz, n);
200 r2 = Combi.rank_k_subset(set, n, sz);
202 cout <<
"lex rank = " << r1 <<
" lex rank as "
203 << sz <<
"-subset = " << r2;
208void poset_classification::print_problem_label()
210 if (problem_label[0]) {
211 cout << problem_label <<
" ";
215void poset_classification::print_level_info(
int prev_level,
int prev)
229 cout <<
" : Level " << prev_level <<
" Node " << prev <<
" = "
236void poset_classification::print_level_extension_info(
238 int prev,
int cur_extension)
240 cout <<
"Level " << prev_level <<
" Node " << prev <<
" = "
244 <<
" Extension " << cur_extension
250void poset_classification::print_level_extension_coset_info(
252 int prev,
int cur_extension,
int coset,
int nb_cosets)
254 cout <<
"Level " << prev_level <<
" Node " << prev <<
" = "
258 <<
" Extension " << cur_extension
262 <<
"Coset " << coset <<
" / " << nb_cosets <<
" : ";
265void poset_classification::print_node(
int node)
267 cout <<
"poset_classification::print_node "
268 "node " << node <<
":" << endl;
272void poset_classification::print_extensions_at_level(
273 ostream &ost,
int lvl)
279 ost <<
"extensions at level " << lvl <<
":" << endl;
282 ost <<
"there are " << len <<
" nodes at level " << lvl <<
":" << endl;
283 for (i = 0; i < len; i++) {
286 ost <<
"Node " << i <<
" / " << len <<
" = " << node <<
":" << endl;
291void poset_classification::print_fusion_nodes(
int depth)
295 for (i = 0; i <= depth; i++) {
298 for (j = 0; j < l; j++) {
306 cout <<
"fusion (" << f + j <<
"/" << h
316void poset_classification::read_data_file(
int &depth_completed,
317 std::string &fname,
int verbose_level)
321 int nb_group_elements;
327 cout <<
"poset_classification::read_data_file "
328 "fname = " << fname << endl;
329 cout <<
"Poset->A->elt_size_in_int = "
331 cout <<
"Poset->A->coded_elt_size_in_char = "
333 cout <<
"verbose_level=" << verbose_level << endl;
337 cout <<
"file size = " << size << endl;
340 cout <<
"error: the file does not exist" << endl;
344 cout <<
"poset_classification::read_data_file "
345 "before m->alloc" << endl;
352 cout <<
"poset_classification::read_data_file "
353 "after m->alloc" << endl;
360 cout <<
"poset_classification::read_data_file "
361 "Before reading file " << fname <<
" of size "
365 ifstream fp(fname, ios::binary);
367 fp.read((
char *) m->
data, size);
370 cout <<
"poset_classification::read_data_file "
371 "Read file " << fname <<
" of size "
379 cout <<
"poset_classification::read_data_file "
380 "before read_memory_object" << endl;
383 nb_group_elements, verbose_level - 2);
385 cout <<
"poset_classification::read_data_file "
386 "after poset_classification_read_memory" << endl;
391 cout <<
"poset_classification::read_data_file done" <<endl;
396void poset_classification::write_data_file(
int depth_completed,
397 std::string &fname_base,
int verbose_level)
402 int nb_group_elements;
411 cout <<
"poset_classification::write_data_file "
412 "fname = " << fname << endl;
413 cout <<
"Poset->A->elt_size_in_int = "
415 cout <<
"Poset->A->coded_elt_size_in_char = "
419 depth_completed, verbose_level);
421 cout <<
"size on file = " << size0 << endl;
424 verbose_level1 = verbose_level;
426 cout <<
"poset_classification::write_data_file "
427 "file=" << fname << endl;
428 cout <<
"size on file = " << size0 << endl;
429 cout <<
"the size is very big (> 1 GB)" << endl;
439 cout <<
"poset_classification::write_data_file "
440 "before write_memory_object" << endl;
444 nb_group_elements, verbose_level1);
446 cout <<
"poset_classification::write_data_file "
447 "after write_memory_object, written " << nb_group_elements
448 <<
" group elements" << endl;
450 cout <<
"m->used_length=" << m->
used_length << endl;
451 cout <<
"size0=" << size0 << endl;
454 cout <<
"poset_classification::write_data_file "
455 "m->used_length != size0" << endl;
460 cout <<
"poset_classification::write_data_file "
462 <<
" to file " << fname << endl;
465 ofstream fp(fname, ios::binary);
470 cout <<
"poset_classification::write_data_file "
471 "Written file " << fname <<
" of size "
479 cout <<
"poset_classification::write_data_file "
480 "finished written file "
481 << fname <<
" of size " << Fio.
file_size(fname) << endl;
482 cout <<
" nb_group_elements=" << nb_group_elements << endl;
486void poset_classification::write_file(
488 int depth_completed,
int verbose_level)
491 int f_v = (verbose_level >= 1);
493 int nb_group_elements = 0;
497 cout <<
"poset_classification::write_file "
498 "depth_completed=" << depth_completed << endl;
502 cout <<
"poset_classification::write_file size on file = " << size0 << endl;
506 cout <<
"poset_classification::write_file" << endl;
507 cout <<
"size on file = " << size0 << endl;
508 cout <<
"the size is very big (> 1 GB)" << endl;
517 cout <<
"poset_classification::write_file "
518 "before write_memory_object" << endl;
521 nb_group_elements, 0 );
523 cout <<
"poset_classification::write_file "
524 "after write_memory_object" << endl;
525 cout <<
"m->used_length=" << m->
used_length << endl;
529 cout <<
"poset_classification::write_file "
530 "m->used_length != size0" << endl;
531 cout <<
"m->used_length=" << m->
used_length << endl;
532 cout <<
"size0" << size0 << endl;
540 cout <<
"poset_classification::write_file size != size0" << endl;
541 cout <<
"poset_classification::write_file size = " << size << endl;
542 cout <<
"poset_classification::write_file size0 = " << size0 << endl;
548 cout <<
"poset_classification::write_file "
549 "before fp.write" << endl;
551 fp.write((
char *) &depth_completed,
sizeof(
int));
552 fp.write((
char *) &size,
sizeof(
long int));
553 fp.write(m->
data, size);
555 cout <<
"poset_classification::write_file "
556 "after fp.write" << endl;
562 cout <<
"poset_classification::write_file done" << endl;
566void poset_classification::read_file(
568 int &depth_completed,
int verbose_level)
571 int f_v = (verbose_level >= 1);
573 int nb_group_elements;
576 cout <<
"poset_classification::read_file" << endl;
580 fp.read((
char *) &depth_completed,
sizeof(int));
581 fp.read((
char *) &size,
sizeof(
long int));
584 cout <<
"poset_classification::read_file "
585 "size = " << size << endl;
593 fp.read(m->
data, size);
600 cout <<
"poset_classification::read_file "
601 "before poset_classification_read_memory" << endl;
604 nb_group_elements, verbose_level - 0);
606 cout <<
"poset_classification::read_file "
607 "after poset_classification_read_memory" << endl;
613 cout <<
"poset_classification::read_file done, "
614 "depth_completed=" << depth_completed << endl;
618void poset_classification::housekeeping(
int i,
619 int f_write_files,
int t0,
int verbose_level)
622 int f_v = (verbose_level >= 1);
623 int f_vv = (verbose_level >= 2);
624 int f_v5 = (verbose_level >= 5);
628 cout <<
"poset_classification::housekeeping "
629 "level=" << i << endl;
630 cout <<
"poset_classification::housekeeping "
631 "verbose_level=" << verbose_level << endl;
632 cout <<
"poset_classification::housekeeping "
633 "problem_label_with_path=" << problem_label_with_path << endl;
637 cout <<
"###################################################"
638 "###############################################" << endl;
640 cout <<
"Found " << nb_nodes <<
" orbits at depth " << i << endl;
643 cout <<
"orbits at level " << i <<
":" << endl;
647 for (j = 0; j <= i; j++) {
666 cout <<
"nb_calls_to_coset_rep_inv="
668 cout <<
"nb_calls_to_coset_rep_inv_recursion="
670 cout <<
"average word length=" <<
671 (double) nb2 / (
double) nb1 << endl;
678 if (nb_nodes < 1000) {
679 int f_with_strong_generators =
FALSE;
680 int f_long_version =
FALSE;
681 Poo->
write_lvl(cout, i, t0, f_with_strong_generators,
682 f_long_version, verbose_level - 2);
687 string my_fname_base;
690 cout <<
"poset_classification_housekeeping "
691 "writing files" << endl;
699 string fname_reps_csv;
702 fname_reps_csv.assign(problem_label_with_path);
703 sprintf(str,
"_reps_lvl_%d", i);
704 fname_reps_csv.append(str);
705 fname_reps_csv.append(
".csv");
710 my_fname_base.assign(problem_label_with_path);
711 my_fname_base.append(
"a");
713 cout <<
"poset_classification_housekeeping "
714 "my_fname_base=" << my_fname_base << endl;
715 cout <<
"poset_classification_housekeeping "
716 "before write_level_file_binary" << endl;
721 cout <<
"poset_classification_housekeeping "
722 "after write_level_file_binary" << endl;
725 my_fname_base.assign(problem_label_with_path);
726 my_fname_base.append(
"b");
728 cout <<
"poset_classification_housekeeping "
729 "my_fname_base=" << my_fname_base << endl;
730 cout <<
"poset_classification_housekeeping "
731 "before write_level_file_binary" << endl;
735 cout <<
"poset_classification_housekeeping "
736 "my_fname_base=" << my_fname_base << endl;
737 cout <<
"poset_classification_housekeeping "
738 "before write_sv_level_file_binary" << endl;
745 cout <<
"poset_classification_housekeeping "
746 "before write_lvl_file" << endl;
752 cout <<
"poset_classification_housekeeping "
753 "after write_lvl_file" << endl;
756 cout <<
"poset_classification_housekeeping "
757 "before poset_classification::write_data_file" << endl;
760 problem_label_with_path, verbose_level);
763 cout <<
"poset_classification::housekeeping "
764 "after poset_classification::write_data_file" << endl;
769 cout <<
"poset_classification_housekeeping "
770 "not writing files" << endl;
775 if (Control->f_Log) {
776 int verbose_level = 1;
777 int f = first_poset_orbit_node_at_level[i];
780 cout <<
"There are " << len
781 <<
" nodes at level " << i <<
":" << endl;
782 for (j = 0; j < len; j++) {
783 Log_nodes(f + j, i, cout,
FALSE, verbose_level);
787 if (Control->f_log && i == sz) {
788 int verbose_level = 1;
791 for (ii = 0; ii <= sz; ii++) {
792 int f = first_poset_orbit_node_at_level[ii];
795 cout <<
"There are " << len
796 <<
" nodes at level " << ii <<
":" << endl;
797 for (j = 0; j < len; j++) {
798 Log_nodes(f + j, ii, cout,
FALSE, verbose_level);
804 if (Control->
f_T || (Control->
f_t && i == sz)) {
806 cout <<
"poset_classification::housekeeping "
807 "before write_treefile_and_draw_tree" << endl;
817 cout <<
"poset_classification::housekeeping "
818 "after write_treefile_and_draw_tree" << endl;
823 cout <<
"poset_classification_housekeeping "
824 "not writing tree" << endl;
829 cout <<
"poset_classification::housekeeping done" << endl;
833void poset_classification::housekeeping_no_data_file(
int i,
834 int t0,
int verbose_level)
837 int f_v = (verbose_level >= 1);
838 int f_v5 = (verbose_level >= 5);
842 cout <<
"poset_classification::"
843 "housekeeping_no_data_file "
844 "verbose_level=" << verbose_level << endl;
847 cout <<
"######################################################"
848 "############################################" << endl;
849 cout <<
"depth " << i <<
" completed, found "
854 cout <<
"orbits at level " << i <<
":" << endl;
860 for (j = 0; j <= i; j++) {
862 <<
" orbits" << endl;
868 if (Control->
f_W || (Control->
f_w && i == sz)) {
870 char fname_base2[1000];
872 sprintf(fname_base2,
"%sa", fname_base);
875 sprintf(fname_base2,
"%sb", fname_base);
878 fname_base,
FALSE, 0, 0, 1);
891 if (Control->
f_T || (Control->
f_t && i == sz)) {
898 cout <<
"poset_classification::"
899 "housekeeping_no_data_file done" << endl;
903void poset_classification::create_fname_sv_level_file_binary(std::string &fname,
904 std::string &fname_base,
int level)
908 fname.assign(fname_base);
909 sprintf(str,
"_lvl_%d_sv.data", level);
914int poset_classification::test_sv_level_file_binary(
915 int level, std::string &fname_base)
930void poset_classification::read_sv_level_file_binary(
931 int level, std::string &fname_base,
932 int f_split,
int split_mod,
int split_case,
933 int f_recreate_extensions,
int f_dont_keep_sv,
936 int f_v = (verbose_level >= 1);
944 cout <<
"poset_classification::read_sv_level_file_binary "
945 "reading file " << fname <<
" of size "
950 ifstream fp(fname, ios::binary);
953 f_split, split_mod, split_case,
954 f_recreate_extensions, f_dont_keep_sv,
960void poset_classification::write_sv_level_file_binary(
961 int level, std::string &fname_base,
962 int f_split,
int split_mod,
int split_case,
965 int f_v = (verbose_level >= 1);
973 cout <<
"poset_classification::write_sv_level_file_binary "
974 "fname = " << fname << endl;
979 ofstream fp(fname, ios::binary);
982 f_split, split_mod, split_case,
987 cout <<
"poset_classification::write_sv_level_file_binary "
988 "finished written file "
989 << fname <<
" of size " << Fio.
file_size(fname) << endl;
993void poset_classification::read_level_file_binary(
int level,
994 std::string &fname_base,
int verbose_level)
996 int f_v = (verbose_level >= 1);
999 int nb_group_elements;
1002 fname.assign(fname_base);
1003 sprintf(str,
"_lvl_%d.data", level);
1007 cout <<
"poset_classification::read_level_file_binary "
1008 "reading file " << fname <<
" of size "
1013 cout <<
"poset_classification::read_level_file_binary "
1014 "probems while reading file " << fname << endl;
1019 ifstream fp(fname, ios::binary);
1022 nb_group_elements, verbose_level);
1027void poset_classification::write_level_file_binary(
int level,
1028 std::string &fname_base,
int verbose_level)
1030 int f_v = (verbose_level >= 1);
1033 int nb_group_elements;
1036 fname.assign(fname_base);
1037 sprintf(str,
"_lvl_%d.data", level);
1041 cout <<
"poset_classification::write_level_file_binary "
1042 "fname = " << fname << endl;
1048 ofstream fp(fname, ios::binary);
1051 nb_group_elements, verbose_level);
1055 cout <<
"poset_classification::write_level_file_binary "
1056 "finished written file "
1057 << fname <<
" of size " << Fio.
file_size(fname)
1058 <<
" nb_group_elements=" << nb_group_elements << endl;
1063void poset_classification::recover(
1064 std::string &recover_fname,
1065 int &depth_completed,
int verbose_level)
1067 int f_v = (verbose_level >= 1);
1070 cout <<
"poset_classification::recover "
1071 "recovering from file " << recover_fname << endl;
1075 cout <<
"poset_classification::recover "
1076 "recovering finished, "
1077 "depth_completed = " << depth_completed << endl;
1081void poset_classification::make_fname_lvl_file_candidates(std::string &fname,
1082 std::string &fname_base,
int lvl)
1086 fname.assign(fname_base);
1087 sprintf(str,
"_lvl_%d_candidates.txt", lvl);
1092void poset_classification::make_fname_lvl_file(std::string &fname,
1093 std::string &fname_base,
int lvl)
1097 fname.assign(fname_base);
1098 sprintf(str,
"_lvl_%d", lvl);
1103void poset_classification::make_fname_lvl_reps_file(std::string &fname,
1104 std::string &fname_base,
int lvl)
1108 fname.assign(fname_base);
1109 sprintf(str,
"_lvl_%d_reps", lvl);
1116void poset_classification::Log_nodes(
int cur,
int depth,
1117 ostream &f,
int f_recurse,
1120 int f_v = (verbose_level >= 1);
1126 cout <<
"Log_nodes cur=" << cur << endl;
1128 if (f_base_case && cur < Base_case->size) {
1132 f <<
"Node " << cur << endl;
1133 f <<
"===============" << endl;
1141 f <<
"with " << node->nb_strong_generators
1142 <<
" strong poset_classifications:" << endl;
1144 cout <<
"Log_nodes cur=" << cur
1145 <<
" printing strong poset_classifications" << endl;
1147 for (i = 0; i < node->nb_strong_generators; i++) {
1149 node->hdl_strong_generators[i], Elt1, 0);
1158 if (node->nb_strong_generators) {
1160 cout <<
"Log_nodes cur=" << cur
1161 <<
" printing tl" << endl;
1164 int_vec_print(f, node->tl, Poset->
A->
base_len());
1169 cout <<
"Log_nodes cur=" << cur
1170 <<
" printing extensions" << endl;
1177 f <<
"fusion node " << i <<
":" << endl;
1197 Log_nodes(next, depth + 1, f,
TRUE, verbose_level);
1205void poset_classification::log_current_node(ostream &f,
int size)
1212 for (i = 0; i < size; i++) {
1213 f << set_S[i] <<
" ";
1221void poset_classification::make_spreadsheet_of_orbit_reps(
1224 int Nb_orbits, nb_orbits, i, level, first;
1227 pchar *Text_orbit_reps;
1228 pchar *Text_stab_order;
1229 pchar *Text_orbit_length;
1230 pchar *Text_schreier_vector_length;
1232 int schreier_vector_length;
1238 for (level = 0; level <= max_depth; level++) {
1247 Text_orbit_length =
NEW_pchar(Nb_orbits);
1248 Text_schreier_vector_length =
NEW_pchar(Nb_orbits);
1251 for (level = 0; level <= max_depth; level++) {
1254 for (i = 0; i < nb_orbits; i++) {
1255 snprintf(str,1000,
"%d", level);
1256 Text_level[first + i] =
NEW_char(strlen(str) + 1);
1257 strcpy(Text_level[first + i], str);
1259 snprintf(str, 1000,
"%d", i);
1260 Text_node[first + i] =
NEW_char(strlen(str) + 1);
1261 strcpy(Text_node[first + i], str);
1265 Text_orbit_reps[first + i] =
NEW_char(strlen(str) + 1);
1266 strcpy(Text_orbit_reps[first + i], str);
1271 Text_stab_order[first + i] =
NEW_char(strlen(str) + 1);
1272 strcpy(Text_stab_order[first + i], str);
1275 Text_orbit_length[first + i] =
NEW_char(strlen(str) + 1);
1276 strcpy(Text_orbit_length[first + i], str);
1283 schreier_vector_length = 0;
1285 snprintf(str, 1000,
"%d", schreier_vector_length);
1286 Text_schreier_vector_length[first + i] =
NEW_char(strlen(str) + 1);
1287 strcpy(Text_schreier_vector_length[first + i], str);
1294 Text_level,
"Level");
1298 Text_orbit_reps,
"Orbit rep");
1300 Text_stab_order,
"Stab order");
1302 Text_orbit_length,
"Orbit length");
1304 Text_schreier_vector_length,
"Schreier vector length");
1307 cout <<
"before Sp->save " << fname_csv << endl;
1308 Sp->
save(fname_csv, verbose_level);
1309 cout <<
"after Sp->save " << fname_csv << endl;
1313 for (i = 0; i < Nb_orbits; i++) {
1317 for (i = 0; i < Nb_orbits; i++) {
1321 for (i = 0; i < Nb_orbits; i++) {
1325 for (i = 0; i < Nb_orbits; i++) {
1329 for (i = 0; i < Nb_orbits; i++) {
1333 for (i = 0; i < Nb_orbits; i++) {
1334 FREE_char(Text_schreier_vector_length[i]);
1340void poset_classification::make_spreadsheet_of_level_info(
1344 int f_v = (verbose_level >= 1);
1346 int nb_rows, Nb_orbits, nb_orbits, i, level;
1348 pchar *Text_nb_orbits;
1349 pchar *Text_orbit_length_sum;
1350 pchar *Text_schreier_vector_length_sum;
1351 pchar *Text_binomial;
1353 orbit_length_sum, orbit_length_total;
1357 int schreier_vector_length_int;
1359 schreier_vector_length_sum, schreier_vector_length_total;
1365 cout <<
"poset_classification::"
1366 "make_spreadsheet_of_level_info" << endl;
1368 nb_rows = max_depth + 2;
1372 Text_orbit_length_sum =
NEW_pchar(nb_rows);
1373 Text_schreier_vector_length_sum =
NEW_pchar(nb_rows);
1377 orbit_length_total.
create(0, __FILE__, __LINE__);
1378 schreier_vector_length_total.
create(0, __FILE__, __LINE__);
1379 a_total.
create(0, __FILE__, __LINE__);
1381 for (level = 0; level <= max_depth; level++) {
1384 cout <<
"poset_classification::"
1385 "make_spreadsheet_of_level_info "
1386 "level = " << level <<
" / " << max_depth << endl;
1391 snprintf(str, 1000,
"%d", level);
1392 Text_label[level] =
NEW_char(strlen(str) + 1);
1393 strcpy(Text_label[level], str);
1395 snprintf(str, 1000,
"%d", nb_orbits);
1396 Text_nb_orbits[level] =
NEW_char(strlen(str) + 1);
1397 strcpy(Text_nb_orbits[level], str);
1399 orbit_length_sum.
create(0, __FILE__, __LINE__);
1400 schreier_vector_length_sum.
create(0, __FILE__, __LINE__);
1402 for (i = 0; i < nb_orbits; i++) {
1405 cout <<
"poset_classification::"
1406 "make_spreadsheet_of_level_info "
1407 "level = " << level <<
" / " << max_depth
1408 <<
" orbit " << i <<
" / " << nb_orbits << endl;
1426 schreier_vector_length_int = 1;
1428 if (schreier_vector_length_int <= 0) {
1429 schreier_vector_length_int = 1;
1431 schreier_vector_length.
create(schreier_vector_length_int, __FILE__, __LINE__);
1433 if (schreier_vector_length_int >= 0) {
1435 schreier_vector_length);
1444 Nb_orbits += nb_orbits;
1447 schreier_vector_length_sum);
1451 Text_orbit_length_sum[level] =
NEW_char(strlen(str) + 1);
1452 strcpy(Text_orbit_length_sum[level], str);
1455 Text_schreier_vector_length_sum[level] =
NEW_char(strlen(str) + 1);
1456 strcpy(Text_schreier_vector_length_sum[level], str);
1459 Text_binomial[level] =
NEW_char(strlen(str) + 1);
1460 strcpy(Text_binomial[level], str);
1464 level = max_depth + 1;
1465 snprintf(str, 1000,
"total");
1466 Text_label[level] =
NEW_char(strlen(str) + 1);
1467 strcpy(Text_label[level], str);
1469 snprintf(str, 1000,
"%d", Nb_orbits);
1470 Text_nb_orbits[level] =
NEW_char(strlen(str) + 1);
1471 strcpy(Text_nb_orbits[level], str);
1474 Text_orbit_length_sum[level] =
NEW_char(strlen(str) + 1);
1475 strcpy(Text_orbit_length_sum[level], str);
1478 Text_schreier_vector_length_sum[level] =
NEW_char(strlen(str) + 1);
1479 strcpy(Text_schreier_vector_length_sum[level], str);
1482 Text_binomial[level] =
NEW_char(strlen(str) + 1);
1483 strcpy(Text_binomial[level], str);
1492 Sp->
fill_column_with_text(4, (
const char **) Text_schreier_vector_length_sum,
"Schreier_vector_length_sum");
1498 cout <<
"before Sp->save " << fname_csv << endl;
1499 Sp->
save(fname_csv, verbose_level);
1500 cout <<
"after Sp->save " << fname_csv << endl;
1504 for (i = 0; i < nb_rows; i++) {
1508 for (i = 0; i < nb_rows; i++) {
1512 for (i = 0; i < nb_rows; i++) {
1516 for (i = 0; i < nb_rows; i++) {
1517 FREE_char(Text_schreier_vector_length_sum[i]);
1520 for (i = 0; i < nb_rows; i++) {
1530void poset_classification::create_schreier_tree_fname_mask_base(
1531 std::string &fname_mask)
1534 fname_mask.assign(problem_label_with_path);
1536 fname_mask.append(
"schreier_tree_node_%d_%d");
1539void poset_classification::create_schreier_tree_fname_mask_base_tex(
1540 std::string &fname_mask)
1543 fname_mask.assign(problem_label_with_path);
1545 fname_mask.append(
"schreier_tree_node_%d.tex");
1548void poset_classification::create_shallow_schreier_tree_fname_mask_base(
1549 std::string &fname_mask)
1552 fname_mask.assign(problem_label_with_path);
1554 fname_mask.append(
"shallow_schreier_tree_node_%d_%d");
1558void poset_classification::create_shallow_schreier_tree_fname_mask(
1559 std::string &fname,
int node)
1564 sprintf(str,
"%d", node);
1565 fname.assign(problem_label_with_path);
1567 fname.append(
"shallow_schreier_tree_node_");
1569 fname.append(
"_%d");
1573void poset_classification::make_fname_candidates_file_default(
1574 char *fname2000,
int level)
1576 snprintf(fname2000, 2000,
"%s_lvl_%d_candidates.bin",
1577 problem_label_with_path.c_str(), level);
1581void poset_classification::wedge_product_export_magma(
1582 int n,
int q,
int vector_space_dimension,
1583 int level,
int verbose_level)
1585 int f_v = (verbose_level >= 1);
1590 cout <<
"poset_classification::wedge_product_export_magma" << endl;
1596 int a, i, j, h, fst, len, ii, jj;
1604 v =
NEW_int(vector_space_dimension);
1610 cout <<
"exporting to magma" << endl;
1611 cout <<
"fst=" << fst <<
" len=" << len << endl;
1616 snprintf(fname, 1000,
"Wedge_n%d_q%d_d%d.magma", n, q, level);
1621 f <<
"// file " << fname << endl;
1622 f <<
"n := " << n <<
";" << endl;
1623 f <<
"q := " << q <<
";" << endl;
1624 f <<
"d := " << level <<
";" << endl;
1625 f <<
"n2 := " << vector_space_dimension <<
";" << endl;
1626 f <<
"V := VectorSpace (GF (q), n2);" << endl;
1628 f <<
"/* list of orbit reps */" << endl;
1629 f <<
"L := [" << endl;
1632 for (i = 0; i < len; i++) {
1635 f <<
"// orbit rep " << i << endl;
1638 for (j = 0; j < level; j++) {
1642 for (h = 0; h < vector_space_dimension; h++) {
1644 if (h < vector_space_dimension - 1) {
1649 if (j < level - 1) {
1657 f <<
"," << endl << endl;
1660 f << endl <<
"];" << endl << endl;
1664 f <<
"// list of orbit lengths " << endl;
1667 for (i = 0; i < len; i++) {
1669 if ((i % 20) == 0) {
1671 f <<
"// orbits " << i <<
" and following:" << endl;
1680 f <<
"];" << endl << endl;
1683 f <<
"// subspaces of vector space " << endl;
1684 f <<
"L := [sub< V | L[i]>: i in [1..#L]];" << endl;
1686 f <<
"// stabilisers " << endl;
1687 f <<
"P := GL(n, q);" << endl;
1688 f <<
"E := ExteriorSquare (P);" << endl;
1691 f <<
"// base:" << endl;
1692 f <<
"BV := VectorSpace (GF (q), n);" << endl;
1693 f <<
"B := [ BV | " << endl;
1694 for (i = 0; i < Poset->
A->
base_len(); i++) {
1699 for (h = 0; h < n; h++) {
1705 if (i < Poset->A->base_len() - 1) {
1714 f <<
"P`Base := B;" << endl;
1716 f <<
"// list of stabilizer generators" << endl;
1717 f <<
"S := [" << endl;
1720 for (i = 0; i < len; i++) {
1723 std::vector<int> gen_hdl;
1724 std::vector<int> tl;
1728 O->
get_tl(tl,
this, verbose_level);
1730 f <<
"// orbit rep " << i <<
" has "
1731 << gen_hdl.size() <<
" strong generators";
1732 if (gen_hdl.size()) {
1733 f <<
", transversal lengths: ";
1735 for (h = 0; h < tl.size(); h++) {
1742 for (j = 0; j < gen_hdl.size(); j++) {
1748 for (ii = 0; ii < n; ii++) {
1750 for (jj = 0; jj < n; jj++) {
1751 a = Elt[ii * n + jj];
1768 if (j < gen_hdl.size() - 1) {
1774 f <<
"," << endl << endl;
1777 f << endl <<
"];" << endl << endl;
1781 f << endl <<
"T := [sub<GL(n, q) | [&cat (s): "
1782 "s in S[i]]> : i in [1..#S]];"
1791 cout <<
"written file " << fname <<
" of size "
1795 cout <<
"poset_classification::wedge_product_export_magma "
1800void poset_classification::write_reps_csv(
int lvl,
int verbose_level)
1802 int f_v = (verbose_level >= 1);
1803 string fname_reps_csv;
1807 cout <<
"poset_classification::write_reps_csv" << endl;
1809 fname_reps_csv.assign(problem_label_with_path);
1810 sprintf(str,
"_reps_lvl_%d", lvl);
1811 fname_reps_csv.append(str);
1812 fname_reps_csv.append(
".csv");
1817 cout <<
"poset_classification::write_reps_csv done" << endl;
field_theory::finite_field * F
a collection of combinatorial functions
void binomial(ring_theory::longinteger_object &a, int n, int k, int verbose_level)
for reading and writing of csv files
void fill_column_with_text(int col_idx, const char **text, const char *heading)
void fill_column_with_row_index(int col_idx, const char *heading)
void save(std::string &fname, int verbose_level)
void init_empty_table(int nb_rows, int nb_cols)
void PG_element_unrank_modified(int *v, int stride, int len, int a)
a collection of functions related to file io
long int file_size(std::string &fname)
for serialization of complex data types
void alloc(long int length, int verbose_level)
interface to system functions
void time_check_delta(std::ostream &ost, int dt)
domain to compute with objects of type longinteger
void add_in_place(longinteger_object &a, longinteger_object &b)
a class to represent arbitrary precision integers
void print_to_string(char *str)
void create(long int i, const char *file, int line)
int nb_times_retrieve_called
int nb_times_image_of_called
int nb_times_store_called
int nb_times_invert_called
void element_print_quick(void *elt, std::ostream &ost)
int coded_elt_size_in_char
void element_retrieve(int hdl, void *elt, int verbose_level)
void element_print_as_permutation(void *elt, std::ostream &ost)
action_pointer_table * ptr
void element_print_verbose(void *elt, std::ostream &ost)
int nb_calls_to_coset_rep_inv_recursion
int nb_calls_to_coset_rep_inv
represents a flag in the poset classification algorithm; related to poset_orbit_node
std::string schreier_tree_prefix
graphics::layered_graph_draw_options * draw_options
int f_find_node_by_stabilizer_order
int find_node_by_stabilizer_order
void print_progress(int size, int cur, int prev, int nb_ext_cur, int nb_fuse_cur)
double level_progress(int lvl)
void orbit_length(int orbit_at_level, int level, ring_theory::longinteger_object &len)
void write_treefile(std::string &fname_base, int lvl, graphics::layered_graph_draw_options *draw_options, int verbose_level)
poset_orbit_node * get_node_ij(int level, int node)
void compute_and_print_automorphism_group_orders(int lvl, std::ostream &ost)
int nb_orbits_at_level(int level)
void write_level_file_binary(int level, std::string &fname_base, int verbose_level)
void print_progress_by_level(int lvl)
void get_set_by_level(int level, int node, long int *set)
void get_orbit_length_and_stabilizer_order(int node, int level, ring_theory::longinteger_object &stab_order, ring_theory::longinteger_object &len)
void print_representatives_at_level(int lvl)
void create_fname_sv_level_file_binary(std::string &fname, std::string &fname_base, int level)
void print_level_info(int prev_level, int prev)
void write_sv_level_file_binary(int level, std::string &fname_base, int f_split, int split_mod, int split_case, int verbose_level)
void write_data_file(int depth_completed, std::string &fname_base, int verbose_level)
void prepare_fname_data_file(std::string &fname, std::string &fname_base, int depth_completed)
void print_statistic_on_callbacks_naked()
void print_problem_label()
void find_node_by_stabilizer_order(int level, int order, int verbose_level)
void unrank_point(int *v, long int rk)
void read_data_file(int &depth_completed, std::string &fname, int verbose_level)
void read_sv_level_file_binary2(int level, std::ifstream &fp, int f_split, int split_mod, int split_case, int f_recreate_extensions, int f_dont_keep_sv, int verbose_level)
void read_level_file_binary2(int level, std::ifstream &fp, int &nb_group_elements, int verbose_level)
void write_level_file_binary2(int level, std::ofstream &fp, int &nb_group_elements, int verbose_level)
void write_lvl(std::ostream &f, int lvl, int t0, int f_with_stabilizer_generators, int f_long_version, int verbose_level)
void save_representatives_at_level_to_csv(std::string &fname, int lvl, int verbose_level)
void write_memory_object(int depth_completed, orbiter_kernel_system::memory_object *m, int &nb_group_elements, int verbose_level)
poset_orbit_node * get_node_ij(int level, int node)
long int calc_size_on_file(int depth_completed, int verbose_level)
int node_get_nb_of_extensions(int node)
void read_memory_object(int &depth_completed, orbiter_kernel_system::memory_object *m, int &nb_group_elements, int verbose_level)
void write_sv_level_file_binary2(int level, std::ofstream &fp, int f_split, int split_mod, int split_case, int verbose_level)
poset_orbit_node * get_node(int node_idx)
void print_progress_by_level(int lvl)
void write_lvl_file(std::string &fname_base, int lvl, int t0, int f_with_stabilizer_generators, int f_long_version, int verbose_level)
int first_node_at_level(int i)
to represent one poset orbit; related to the class poset_classification
extension * get_E(int idx)
void get_tl(std::vector< int > &tl, poset_classification *PC, int verbose_level)
void log_current_node(poset_classification *gen, int s, std::ostream &f, int f_with_stabilizer_poset_classifications, int verbose_level)
int has_Schreier_vector()
void print_set_verbose(poset_classification *gen)
void print_node(poset_classification *gen)
void get_strong_generators_handle(std::vector< int > &gen_hdl, int verbose_level)
void print_extensions(std::ostream &ost)
int get_nb_of_live_points()
void print_set(poset_classification *gen)
void store_set_to(poset_classification *gen, int i, long int *to)
int get_nb_of_extensions()
algebra::vector_space * VS
ring_theory::longinteger_object go
#define Lint_vec_print_to_str(A, B, C)
the orbiter library for the classification of combinatorial objects
#define EXTENSION_TYPE_FUSION
#define EXTENSION_TYPE_EXTENSION