Commit bc11158d authored by Quentin HAMMERER's avatar Quentin HAMMERER
Browse files

.

parent 66179232
......@@ -9,7 +9,7 @@ struct input_poly_t *input_system;
// int *jlog;
// int ncols;
// int nrows;
int n; /* number of variables */
int n_var; /* number of variables */
// int v; /* number of non-enumerated variables (the first ones) */
int m; /* number of polynomials */
// int D;
......@@ -240,9 +240,9 @@ bool polynomial_started = false;
/* callbacks */
void parser_setup(void *opaque, int nvar, const char **vars)
{
n = nvar;
variable_name = malloc(n * sizeof(char *));
for (int i = 0; i < n; i++)
n_var = nvar;
variable_name = malloc(n_var * sizeof(char *));
for (int i = 0; i < n_var; i++)
variable_name[i] = strdup(vars[i]);
// allocate dummy polynomial
......@@ -284,7 +284,7 @@ void parser_store_polynomial(void *opaque, int line)
int get_number_of_variables()
{
return n;
return n_var;
}
void test_shift_128()
......@@ -327,7 +327,7 @@ int monomial_enumerate(int degree, monomial_t *out)
return 1;
}
int count = 0;
monomial_t top = mkvar(n);
monomial_t top = mkvar(n_var);
monomial_t i = mkvar(degree) - 1;
while (i < top) {
if (out != NULL)
......@@ -377,9 +377,9 @@ struct input_poly_t *convert_input_system(int nb_monomial, int *size_sys)
void print_monomial(FILE *stream, monomial_t m)
{
int v[n];
int v[n_var];
int d = 0;
for (int i = 0; i < n; i++) {
for (int i = 0; i < n_var; i++) {
if (m & mkvar(i)) {
v[d] = i;
d++;
......@@ -399,7 +399,7 @@ void system_to_txt(char *dest, struct input_poly_t *sys, int size)
FILE *f = fopen(dest, "w");
if (f == NULL)
err(1, "Cannot open %s", dest);
for (int i = 0; i < n; i++)
for (int i = 0; i < n_var; i++)
{
if (i != 0)
fprintf(f, ", ");
......@@ -418,4 +418,4 @@ void system_to_txt(char *dest, struct input_poly_t *sys, int size)
fprintf(f, "\n");
}
fclose(f);
}
\ No newline at end of file
}
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment