17namespace layer1_foundations {
18namespace combinatorics {
44 int *Incma,
int *partition,
47 int f_v = (verbose_level >= 1);
50 cout <<
"encoded_combinatorial_object::init_everything" << endl;
54 encoded_combinatorial_object::Incma = Incma;
57 cout <<
"encoded_combinatorial_object::init_everything done" << endl;
66 int f_v = (verbose_level >= 1);
69 cout <<
"encoded_combinatorial_object::init" << endl;
70 cout <<
"encoded_combinatorial_object::init "
93 cout <<
"encoded_combinatorial_object::init done" << endl;
104 if (Incma[i *
nb_cols + j] == 0) {
127 int f_v = (verbose_level >= 1);
130 cout <<
"encoded_combinatorial_object::init_canonical_form" << endl;
143 cout <<
"encoded_combinatorial_object::init_canonical_form done" << endl;
166 int *&Incma_out,
int verbose_level)
168 int f_v = (verbose_level >= 1);
171 cout <<
"encoded_combinatorial_object::compute_canonical_incma" << endl;
177 for (i = 0; i <
nb_rows; i++) {
178 ii = canonical_labeling[i];
179 for (j = 0; j <
nb_cols; j++) {
187 cout <<
"encoded_combinatorial_object::compute_canonical_incma done" << endl;
192 int *canonical_labeling,
int verbose_level)
194 int f_v = (verbose_level >= 1);
197 cout <<
"encoded_combinatorial_object::compute_canonical_form" << endl;
206 Incma_out, verbose_level);
211 for (i = 0; i <
nb_rows; i++) {
212 for (j = 0; j <
nb_cols; j++) {
213 if (Incma_out[i *
nb_cols + j]) {
215 Canonical_form->
m_i(a, 1);
222 cout <<
"encoded_combinatorial_object::compute_canonical_form done" << endl;
229 int f_v = (verbose_level >= 1);
232 cout <<
"encoded_combinatorial_object::incidence_matrix_projective_space_top_left" << endl;
240 for (j = 0; j < P->
N_lines; j++) {
247 cout <<
"encoded_combinatorial_object::incidence_matrix_projective_space_top_left done" << endl;
255 int f_v = (verbose_level >= 1);
258 cout <<
"encoded_combinatorial_object::extended_incidence_matrix_projective_space_top_left" << endl;
267 for (j = 0; j < P->
N_lines; j++) {
273 for (j = 0; j < P->
N_lines; j++) {
279 cout <<
"encoded_combinatorial_object::extended_incidence_matrix_projective_space_top_left computing points on lines" << endl;
282 long int *Pts_on_line;
286 for (j = 0; j < P->
N_lines; j++) {
288 j , Pts_on_line + j * P->
k,
293 cout <<
"encoded_combinatorial_object::extended_incidence_matrix_projective_space_top_left computing planes through lines" << endl;
296 std::vector<std::vector<long int>> Plane_ranks;
298 for (j = 0; j < P->
N_lines; j++) {
300 std::vector<long int> plane_ranks;
303 j , plane_ranks, 0 );
305 Plane_ranks.push_back(plane_ranks);
307 for (h = 0; h < plane_ranks.size(); h++) {
313 for (l = 0; l < P->
k; l++) {
315 i = Pts_on_line[j * P->
k + l];
327 cout <<
"encoded_combinatorial_object::extended_incidence_matrix_projective_space_top_left done" << endl;
337 int f_v = (verbose_level >= 1);
340 cout <<
"encoded_combinatorial_object::canonical_form_given_canonical_labeling" << endl;
351 for (i = 0; i <
nb_rows; i++) {
352 for (j = 0; j <
nb_cols; j++) {
353 if (Incma_out[i *
nb_cols + j]) {
364 cout <<
"encoded_combinatorial_object::canonical_form_given_canonical_labeling done" << endl;
371 int f_v = (verbose_level >= 1);
374 cout <<
"encoded_combinatorial_object::latex_set_system_by_columns" << endl;
388 ost <<
"Column sets of the encoded object:\\\\" << endl;
389 for (j = 0; j <
nb_cols; j++) {
391 for (i = 0; i <
nb_rows; i++) {
397 ost <<
"\\\\" << endl;
407 int f_v = (verbose_level >= 1);
410 cout <<
"encoded_combinatorial_object::latex_set_system_by_rows" << endl;
425 ost <<
"Row sets of the encoded object:\\\\" << endl;
426 for (i = 0; i <
nb_rows; i++) {
428 for (j = 0; j <
nb_cols; j++) {
436 ost <<
"\\\\" << endl;
446 int f_v = (verbose_level >= 1);
449 cout <<
"encoded_combinatorial_object::latex_incma" << endl;
465 for (i = 0; i <
nb_rows; i++) {
467 Vi[V++] = i - i0 + 1;
472 cout <<
"encoded_combinatorial_object::latex_incma Vi=";
477 for (j = 0; j <
nb_cols; j++) {
479 Bj[B++] = j - j0 + 1;
484 cout <<
"encoded_combinatorial_object::latex_incma Bj=";
490 cout <<
"encoded_combinatorial_object::latex_incma before L.incma_latex" << endl;
499 cout <<
"encoded_combinatorial_object::latex_incma after L.incma_latex" << endl;
507 cout <<
"encoded_combinatorial_object::latex_incma done" << endl;
515void projective_space_with_action::save_Levi_graph(std::string &prefix,
517 int *Incma,
int nb_rows,
int nb_cols,
518 long int *canonical_labeling,
int canonical_labeling_len,
521 int f_v = (verbose_level >= 1);
524 cout <<
"projective_space_with_action::save_Levi_graph" << endl;
529 string fname_labeling;
532 sprintf(str, mask, nb_rows, nb_cols);
534 fname_csv.assign(prefix);
535 fname_csv.append(str);
536 fname_csv.append(
".csv");
538 fname_bin.assign(prefix);
539 fname_bin.append(str);
540 fname_bin.append(
".graph");
543 fname_labeling.assign(prefix);
544 fname_labeling.append(
"_labeling");
545 fname_labeling.append(
".csv");
550 cout <<
"labeling:" << endl;
551 L.lint_vec_print_as_matrix(cout,
552 canonical_labeling, N, 10 ,
TRUE );
555 Fio.lint_vec_write_csv(canonical_labeling, canonical_labeling_len,
556 fname_labeling,
"can_lab");
557 Fio.int_matrix_write_csv(fname_csv, Incma, nb_rows, nb_cols);
564 CG->create_Levi_graph_from_incidence_matrix(
565 Incma, nb_rows, nb_cols,
566 TRUE, canonical_labeling, verbose_level);
567 CG->save(fname_bin, verbose_level);
570 cout <<
"projective_space_with_action::save_Levi_graph done" << endl;
577 int nb_orbits,
int *orbit_first,
int *orbit_len,
int *orbit,
580 int f_v = (verbose_level >= 1);
583 cout <<
"encoded_combinatorial_object::latex_TDA" << endl;
599 for (i = 0; i < nb_orbits; i++) {
600 fst = orbit_first[i];
607 for (; i < nb_orbits; i++) {
608 fst = orbit_first[i];
615 cout <<
"encoded_combinatorial_object::latex_TDA Vi=";
620 cout <<
"encoded_combinatorial_object::latex_TDA Bj=";
631 for (i = 0; i <
nb_rows; i++) {
633 for (j = 0; j <
nb_cols; j++) {
635 if (Incma[i0 *
nb_cols + j0]) {
642 cout <<
"encoded_combinatorial_object::latex_TDA "
643 "before L.incma_latex" << endl;
652 cout <<
"encoded_combinatorial_object::latex_TDA "
653 "after L.incma_latex" << endl;
662 cout <<
"encoded_combinatorial_object::latex_TDA done" << endl;
668 int nb_orbits,
int *orbit_first,
int *orbit_len,
int *orbit,
671 int f_v = (verbose_level >= 1);
674 cout <<
"encoded_combinatorial_object::latex_TDA_with_labels" << endl;
690 for (i = 0; i < nb_orbits; i++) {
691 fst = orbit_first[i];
698 for (; i < nb_orbits; i++) {
699 fst = orbit_first[i];
706 cout <<
"encoded_combinatorial_object::latex_TDA_with_labels Vi=";
711 cout <<
"encoded_combinatorial_object::latex_TDA_with_labels Bj=";
722 for (i = 0; i <
nb_rows; i++) {
724 for (j = 0; j <
nb_cols; j++) {
726 if (Incma[i0 *
nb_cols + j0]) {
735 std::string *point_labels;
736 std::string *block_labels;
739 point_labels =
new string [v];
740 block_labels =
new string [b];
742 for (i = 0; i < v; i++) {
745 sprintf(str,
"%d", orbit[i]);
746 point_labels[i].assign(str);
750 for (j = 0; j < b; j++) {
753 sprintf(str,
"%d", orbit[
nb_rows + j]);
754 block_labels[j].assign(str);
763 cout <<
"encoded_combinatorial_object::latex_TDA_with_labels "
764 "before L.incma_latex_with_text_labels" << endl;
776 cout <<
"encoded_combinatorial_object::latex_TDA_with_labels "
777 "after L.incma_latex_with_text_labels" << endl;
781 delete [] point_labels;
782 delete [] block_labels;
789 cout <<
"encoded_combinatorial_object::latex_TDA_with_labels done" << endl;
798 int f_v = (verbose_level >= 1);
801 cout <<
"encoded_combinatorial_object::latex_canonical_form" << endl;
820 for (i = 0; i < nb_orbits; i++) {
821 fst = orbit_first[i];
828 for (; i < nb_orbits; i++) {
829 fst = orbit_first[i];
836 cout <<
"encoded_combinatorial_object::latex_canonical_form Vi=";
841 cout <<
"encoded_combinatorial_object::latex_canonical_form Bj=";
852 for (i = 0; i <
nb_rows; i++) {
854 for (j = 0; j <
nb_cols; j++) {
856 if (Incma[i0 *
nb_cols + j0]) {
864 for (i = 0; i <
nb_rows; i++) {
865 for (j = 0; j <
nb_cols; j++) {
871 ost <<
"\\\\" << endl;
880 for (i = 0; i <
nb_rows; i++) {
883 for (j = 0; j <
nb_cols; j++) {
889 cout <<
"encoded_combinatorial_object::latex_canonical_form "
890 "before L.incma_latex" << endl;
901 cout <<
"encoded_combinatorial_object::latex_canonical_form "
902 "after L.incma_latex" << endl;
909 ost <<
"\\\\" << endl;
916 cout <<
"encoded_combinatorial_object::latex_canonical_form done" << endl;
928 for (i = 0; i <
nb_rows; i++) {
930 for (j = 0; j <
nb_cols; j++) {
932 if (Incma[i0 *
nb_cols + j0]) {
941 int *&Flags,
int &nb_flags_counted,
949 nb_flags_counted = 0;
950 for (i = 0; i <
nb_rows; i++) {
951 for (j = 0; j <
nb_cols; j++) {
953 Flags[nb_flags_counted++] = i *
nb_cols + j;
958 cout <<
"encoded_combinatorial_object::apply_canonical_labeling_and_get_flags nb_flags_counted != nb_flags" << endl;
965 std::string *row_labels,
966 std::string *col_labels,
969 int f_v = (verbose_level >= 1);
972 cout <<
"encoded_combinatorial_object::latex_canonical_form" << endl;
991 for (i = 0; i < nb_orbits; i++) {
992 fst = orbit_first[i];
999 for (; i < nb_orbits; i++) {
1000 fst = orbit_first[i];
1007 cout <<
"encoded_combinatorial_object::latex_canonical_form Vi=";
1012 cout <<
"encoded_combinatorial_object::latex_canonical_form Bj=";
1023 for (i = 0; i <
nb_rows; i++) {
1025 for (j = 0; j <
nb_cols; j++) {
1027 if (Incma[i0 *
nb_cols + j0]) {
1039 for (i = 0; i <
nb_rows; i++) {
1040 for (j = 0; j <
nb_cols; j++) {
1050 ost <<
"too many to print." << endl;
1053 ost <<
"\\\\" << endl;
1061 cout <<
"encoded_combinatorial_object::latex_canonical_form "
1062 "before L.incma_latex_with_text_labels" << endl;
1075 cout <<
"encoded_combinatorial_object::latex_canonical_form "
1076 "after L.incma_latex_with_text_labels" << endl;
1080 ost <<
"\\\\" << endl;
1087 cout <<
"encoded_combinatorial_object::latex_canonical_form done" << endl;
a collection of combinatorial functions
int rank_k_subset(int *set, int n, int k)
encoding of combinatorial object for use with nauty
~encoded_combinatorial_object()
void set_incidence(int a)
void latex_TDA(std::ostream &ost, int nb_orbits, int *orbit_first, int *orbit_len, int *orbit, int verbose_level)
void compute_canonical_form(data_structures::bitvector *&Canonical_form, int *canonical_labeling, int verbose_level)
void latex_canonical_form(std::ostream &ost, data_structures::nauty_output *NO, int verbose_level)
void apply_canonical_labeling_and_get_flags(int *&Inc2, int *&Flags, int &nb_flags_counted, data_structures::nauty_output *NO)
int get_incidence_ij(int i, int j)
void init_canonical_form(encoded_combinatorial_object *Enc, data_structures::nauty_output *NO, int verbose_level)
void set_incidence_ij(int i, int j)
int canonical_labeling_len
void compute_canonical_incma(int *canonical_labeling, int *&Incma_out, int verbose_level)
void latex_set_system_by_columns(std::ostream &ost, int verbose_level)
void latex_incma(std::ostream &ost, int verbose_level)
void latex_canonical_form_with_labels(std::ostream &ost, data_structures::nauty_output *NO, std::string *row_labels, std::string *col_labels, int verbose_level)
void latex_set_system_by_rows(std::ostream &ost, int verbose_level)
encoded_combinatorial_object()
void init(int nb_rows, int nb_cols, int verbose_level)
void latex_TDA_with_labels(std::ostream &ost, int nb_orbits, int *orbit_first, int *orbit_len, int *orbit, int verbose_level)
void canonical_form_given_canonical_labeling(int *canonical_labeling, data_structures::bitvector *&B, int verbose_level)
void incidence_matrix_projective_space_top_left(geometry::projective_space *P, int verbose_level)
void apply_canonical_labeling(int *&Inc2, data_structures::nauty_output *NO)
void extended_incidence_matrix_projective_space_top_left(geometry::projective_space *P, int verbose_level)
void init_everything(int nb_rows, int nb_cols, int *Incma, int *partition, int verbose_level)
compact storage of 0/1-data as bitvectors
void m_i(long int i, int a)
void allocate(long int length)
void matrix_print_tight(int *p, int m, int n)
output data created by a run of nauty
projective space PG(n,q) of dimension n over Fq
void create_points_on_line(long int line_rk, long int *line, int verbose_level)
void planes_through_a_line(long int line_rk, std::vector< long int > &plane_ranks, int verbose_level)
int is_incident(int pt, int line)
options for drawing an incidence structure
interface to create latex output files
void incma_latex_with_labels(std::ostream &fp, int v, int b, int V, int B, int *Vi, int *Bj, int *row_labels_int, int *col_labels_int, int *incma, int verbose_level)
void incma_latex(std::ostream &fp, int v, int b, int V, int B, int *Vi, int *Bj, int *incma, int verbose_level)
void int_set_print_tex(std::ostream &ost, int *v, int len)
void incma_latex_with_text_labels(std::ostream &fp, graphics::draw_incidence_structure_description *Descr, int v, int b, int V, int B, int *Vi, int *Bj, int *incma, int f_labelling_points, std::string *point_labels, int f_labelling_blocks, std::string *block_labels, int verbose_level)
graphics::draw_incidence_structure_description * Draw_incidence_structure_description
data_structures::int_vec * Int_vec
#define Int_vec_zero(A, B)
#define Int_vec_copy(A, B, C)
#define Int_vec_print(A, B, C)
orbiter_kernel_system::orbiter_session * Orbiter
global Orbiter session
the orbiter library for the classification of combinatorial objects