Orbiter 2022
Combinatorial Objects
schlaefli_labels.cpp
Go to the documentation of this file.
1/*
2 * schlaefli_labels.cpp
3 *
4 * Created on: May 22, 2021
5 * Author: betten
6 */
7
8
9
10
11#include "foundations.h"
12
13using namespace std;
14
15
16namespace orbiter {
17namespace layer1_foundations {
18namespace algebraic_geometry {
19
20
22{
23 Sets = NULL;
24 M = NULL;
25 Sets2 = NULL;
26
27
28 Line_label = NULL;
29 Line_label_tex = NULL;
30}
31
33{
34 if (Sets) {
36 }
37 if (M) {
38 FREE_int(M);
39 }
40 if (Sets2) {
42 }
43
44
45 if (Line_label) {
46 delete [] Line_label;
47 }
48 if (Line_label_tex) {
49 delete [] Line_label_tex;
50 }
51
52}
53
54
55void schlaefli_labels::init(int verbose_level)
56{
57 int f_v = (verbose_level >= 1);
59
60 int i, j, h, h2;
61
62 if (f_v) {
63 cout << "schlaefli_labels::init" << endl;
64 }
65
66 Sets = NEW_lint(30 * 2);
67 M = NEW_int(6 * 6);
68 Int_vec_zero(M, 6 * 6);
69
70 h = 0;
71 for (i = 0; i < 6; i++) {
72 for (j = 0; j < 6; j++) {
73 if (j == i) {
74 continue;
75 }
76 M[i * 6 + j] = h;
77 Sets[h * 2 + 0] = i;
78 Sets[h * 2 + 1] = 6 + j;
79 h++;
80 }
81 }
82
83
84 if (h != 30) {
85 cout << "h != 30" << endl;
86 exit(1);
87 }
88
89
90 if (f_v) {
91 cout << "schlaefli_labels::init Sets:" << endl;
93 Sets, 30, 2, FALSE /* f_tex */);
94 }
95
96
97 Sets2 = NEW_lint(15 * 2);
98 h2 = 0;
99 for (i = 0; i < 6; i++) {
100 for (j = i + 1; j < 6; j++) {
101 Sets2[h2 * 2 + 0] = M[i * 6 + j];
102 Sets2[h2 * 2 + 1] = M[j * 6 + i];
103 h2++;
104 }
105 }
106 if (h2 != 15) {
107 cout << "h2 != 15" << endl;
108 exit(1);
109 }
110
111 if (f_v) {
112 cout << "Sets2:" << endl;
114 Sets2, 15, 2, FALSE /* f_tex */);
115 }
116
117
118
119 Line_label = new std::string[28];
120 Line_label_tex = new std::string[28];
121 char str[1000];
122 int a, b, c;
123
124 for (i = 0; i < 27; i++) {
125 if (i < 6) {
126 snprintf(str, 1000, "a_%d", i + 1);
127 }
128 else if (i < 12) {
129 snprintf(str, 1000, "b_%d", i - 6 + 1);
130 }
131 else {
132 h = i - 12;
133 c = Sets2[h * 2 + 0];
134 a = Sets[c * 2 + 0] + 1;
135 b = Sets[c * 2 + 1] - 6 + 1;
136 snprintf(str, 1000, "c_{%d%d}", a, b);
137 }
138 if (f_v) {
139 cout << "creating label " << str
140 << " for line " << i << endl;
141 }
142 Line_label[i].assign(str);
143 }
144 Line_label[27].assign("d");
145
146 for (i = 0; i < 27; i++) {
147 if (i < 6) {
148 snprintf(str, 1000, "a_{%d}", i + 1);
149 }
150 else if (i < 12) {
151 snprintf(str, 1000, "b_{%d}", i - 6 + 1);
152 }
153 else {
154 h = i - 12;
155 c = Sets2[h * 2 + 0];
156 a = Sets[c * 2 + 0] + 1;
157 b = Sets[c * 2 + 1] - 6 + 1;
158 snprintf(str, 1000, "c_{%d%d}", a, b);
159 }
160 if (f_v) {
161 cout << "creating label " << str
162 << " for line " << i << endl;
163 }
164 Line_label_tex[i].assign(str);
165 }
166 Line_label_tex[27].assign("d");
167
168
169
170
171 if (f_v) {
172 cout << "schlaefli_labels::init done" << endl;
173 }
174}
175
176
177}}}
178
void print_lint_matrix_with_standard_labels(std::ostream &ost, long int *p, int m, int n, int f_tex)
#define FREE_int(p)
Definition: foundations.h:640
#define Int_vec_zero(A, B)
Definition: foundations.h:713
#define NEW_int(n)
Definition: foundations.h:625
#define FALSE
Definition: foundations.h:234
#define FREE_lint(p)
Definition: foundations.h:642
#define NEW_lint(n)
Definition: foundations.h:628
the orbiter library for the classification of combinatorial objects