15namespace layer1_foundations {
36 int f_v = (verbose_level >= 1);
39 cout <<
"diophant_create::init" << endl;
48 cout <<
"please use -label <label> to give the system a name" << endl;
63 cout <<
"creating finite field of order q=" <<
Descr->
input_q
69 cout <<
"diophant_create::init creating finite field "
71 <<
" using the default polynomial (if necessary)" << endl;
97 sprintf(str,
"max_arc_%d_%d_%d.diophant",
Descr->
input_q,
101 cout <<
"Written file " << fname <<
" of size " << Fio.
file_size(fname) << endl;
119 cout <<
"sz != m * n" << endl;
131 int *Covering_matrix;
132 int nb_rows, nb_cols;
136 cout <<
"f_problem_of_Steiner_type" << endl;
137 cout <<
"reading coefficient matrix from file "
142 nb_rows, nb_cols, verbose_level);
145 int nb_k_orbits = nb_rows;
148 D->
open(nb_t_orbits, nb_k_orbits);
150 for (j = 0; j < nb_k_orbits; j++) {
151 for (h = 0; h < nb_cols; h++) {
152 i = Covering_matrix[j * nb_cols + h];
158 for (i = 0; i <
D->
m; i++) {
163 for (i = 0; i <
D->
n; i++) {
175 cout <<
"reading coefficient matrix from file "
180 m, n, verbose_level);
186 for (i = 0; i < m; i++) {
187 for (j = 0; j < n; j++) {
188 D->
Aij(i, j) = A[i * n + j];
200 cout <<
"-RHS please specify the coefficient matrix first" << endl;
204 if (sz != 3 *
D->
m) {
205 cout <<
"number of values for RHS must be 3 times the number of rows of the system" << endl;
208 for (i = 0; i <
D->
m; i++) {
209 if (RHS[3 * i + 2] == 1) {
211 D->
RHS[i] = RHS[3 * i + 1];
214 else if (RHS[3 * i + 2] == 2) {
216 D->
RHS[i] = RHS[3 * i + 1];
219 else if (RHS[3 * i + 2] == 3) {
221 D->
RHS[i] = RHS[3 * i + 1];
224 else if (RHS[3 * i + 2] == 4) {
226 D->
RHS[i] = RHS[3 * i + 1];
230 cout <<
"type of RHS not recognized" << endl;
245 cout <<
"-RHS_csv please specify the coefficient matrix first" << endl;
250 m, n, verbose_level);
252 cout <<
"reading RHS from file " <<
Descr->
RHS_csv_text <<
". Csv file must have exactly 3 column2." << endl;
256 cout <<
"number of rows in csv file must match number of rows of the system" << endl;
259 for (i = 0; i < m; i++) {
260 if (RHS[3 * i + 2] == 1) {
262 D->
RHS[i] = RHS[3 * i + 1];
265 else if (RHS[3 * i + 2] == 2) {
267 D->
RHS[i] = RHS[3 * i + 1];
270 else if (RHS[3 * i + 2] == 3) {
272 D->
RHS[i] = RHS[3 * i + 1];
275 else if (RHS[3 * i + 2] == 4) {
277 D->
RHS[i] = RHS[3 * i + 1];
281 cout <<
"type of RHS not recognized" << endl;
295 cout <<
"-RHS_constant please specify the coefficient matrix first" << endl;
300 cout <<
"sz != 3" << endl;
303 for (i = 0; i <
D->
m; i++) {
309 else if (RHS[2] == 2) {
314 else if (RHS[2] == 3) {
319 else if (RHS[2] == 4) {
325 cout <<
"type of RHS not recognized" << endl;
338 cout <<
"-x_max_global please specify the coefficient matrix first" << endl;
341 for (j = 0; j <
D->
n; j++) {
350 cout <<
"-x_min_global please specify the coefficient matrix first" << endl;
353 for (j = 0; j <
D->
n; j++) {
360 cout <<
"-x_bounds please specify the coefficient matrix first" << endl;
368 if (sz != 2 *
D->
n) {
369 cout <<
"sz != 2 * D->n" << endl;
372 for (j = 0; j <
D->
n; j++) {
373 D->
x_min[j] = x_bounds[2 * j + 0];
374 D->
x_max[j] = x_bounds[2 * j + 1];
386 cout <<
"-x_bounds_csv please specify the coefficient matrix first" << endl;
391 m1, n1, verbose_level);
394 <<
". Csv file must have exactly " <<
D->
n <<
" rows." << endl;
399 <<
". The csv file must have exactly 2 columns." << endl;
402 for (j = 0; j <
D->
n; j++) {
403 D->
x_min[j] = x_bounds[2 * j + 0];
404 D->
x_max[j] = x_bounds[2 * j + 1];
412 cout <<
"-has_sum please specify the coefficient matrix first" << endl;
428 fname.append(
".diophant");
431 cout <<
"Written file " << fname <<
" of size " << Fio.
file_size(fname) << endl;
434 cout <<
"diophant_create::init done" << endl;
void finite_field_init(int q, int f_without_tables, int verbose_level)
void init_override_polynomial(int q, std::string &poly, int f_without_tables, int verbose_level)
void maximal_arc_by_diophant(int arc_sz, int arc_d, std::string &secant_lines_text, std::string &external_lines_as_subset_of_secants_text, solvers::diophant *&D, int verbose_level)
projective space PG(n,q) of dimension n over Fq
arc_in_projective_space * Arc_in_projective_space
void projective_space_init(int n, field_theory::finite_field *F, int f_init_incidence_structure, int verbose_level)
a collection of functions related to file io
void int_matrix_read_csv(std::string &fname, int *&M, int &m, int &n, int verbose_level)
long int file_size(std::string &fname)
diophant_description * Descr
void init(diophant_description *Descr, int verbose_level)
to describe a diophantine system from command line arguments
int problem_of_Steiner_type_nb_t_orbits
std::string x_bounds_text
int f_override_polynomial
int f_coefficient_matrix_csv
int f_problem_of_Steiner_type
std::string override_polynomial
std::string problem_of_Steiner_type_covering_matrix_fname
std::string external_lines_as_subset_of_secants_text
std::string RHS_constant_text
std::string coefficient_matrix_text
std::string maximal_arc_secants_text
std::string coefficient_matrix_csv
diophantine systems of equations (i.e., linear systems over the integers)
diophant_equation_type * type
void save_in_general_format(std::string &fname, int verbose_level)
#define Int_vec_scan(A, B, C)
the orbiter library for the classification of combinatorial objects