Skip to content

Commit

Permalink
Merge pull request #100 from jerebertho/fix_bug_change_var_nonradical
Browse files Browse the repository at this point in the history
Fix bug change var nonradical
  • Loading branch information
ederc authored Nov 7, 2023
2 parents 355e948 + b4a75f2 commit 40731f1
Show file tree
Hide file tree
Showing 10 changed files with 193 additions and 11 deletions.
6 changes: 4 additions & 2 deletions Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -25,13 +25,15 @@ checkdiff = test/diff/diff_cp_d_3_n_4_p_2.sh \
test/diff/diff_multy-qq.sh \
test/diff/diff_nonradical_shape-qq.sh \
test/diff/diff_nonradical_radicalshape-qq.sh \
test/diff/diff_nonradical_radicalshape-no-square-31.sh \
test/diff/diff_nonradical_radicalshape-no-square-qq.sh \
test/diff/diff_one-16.sh \
test/diff/diff_one-31.sh \
test/diff/diff_one-qq.sh \
test/diff/diff_radical_shape-31.sh \
test/diff/diff_radical_shape-qq.sh \
test/diff/diff_reals_dim0.sh \
test/diff/diff_reals_dim0-swapvar.sh \
test/diff/diff_reals_dim0.sh \
test/diff/diff_reals_dim0-swapvar.sh \
test/diff/diff_bug_empty_tracer.sh \
test/diff/diff_bug_2nd_prime_bad.sh \
test/diff/diff_bug_68.sh \
Expand Down
9 changes: 8 additions & 1 deletion configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,14 @@ AC_CONFIG_LINKS([
output_files/nonradical_radicalshape-qq.res:output_files/nonradical_radicalshape-qq.res
output_files/nonradical_radicalshape-qq.p3.res:output_files/nonradical_radicalshape-qq.p3.res
test/diff/diff_nonradical_radicalshape-qq.sh:test/diff/diff_nonradical_radicalshape-qq.sh
input_files/one-16.ms:input_files/one-16.ms
input_files/nonradical_radicalshape-no-square-31.ms:input_files/nonradical_radicalshape-no-square-31.ms
output_files/nonradical_radicalshape-no-square-31.c0.res:output_files/nonradical_radicalshape-no-square-31.c0.res
test/diff/diff_nonradical_radicalshape-no-square-31.sh:test/diff/diff_nonradical_radicalshape-no-square-31.sh
input_files/nonradical_radicalshape-no-square-qq.ms:input_files/nonradical_radicalshape-no-square-qq.ms
output_files/nonradical_radicalshape-no-square-qq.res:output_files/nonradical_radicalshape-no-square-qq.res
output_files/nonradical_radicalshape-no-square-qq.p3.res:output_files/nonradical_radicalshape-no-square-qq.p3.res
test/diff/diff_nonradical_radicalshape-no-square-qq.sh:test/diff/diff_nonradical_radicalshape-no-square-qq.sh
input_files/one-16.ms:input_files/one-16.ms
output_files/one-16.res:output_files/one-16.res
test/diff/diff_one-16.sh:test/diff/diff_one-16.sh
input_files/one-31.ms:input_files/one-31.ms
Expand Down
5 changes: 5 additions & 0 deletions input_files/nonradical_radicalshape-no-square-31.ms
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
x,y,z
1073741827
5184*x^2+5328*x*y-3312*x*z+1369*y^2-1702*y*z+529*z^2+12528*x+6438*y-4002*z+7569,
1936*x^2+2552*x*y+8624*x*z+841*y^2+5684*y*z+9604*z^2-2024*x-1334*y-4508*z+529,
100*x^2-1220*x*y-160*x*z+3721*y^2+976*y*z+64*z^2-580*x+3538*y+464*z+841
5 changes: 5 additions & 0 deletions input_files/nonradical_radicalshape-no-square-qq.ms
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
x,y,z
0
5184*x^2+5328*x*y-3312*x*z+1369*y^2-1702*y*z+529*z^2+12528*x+6438*y-4002*z+7569,
1936*x^2+2552*x*y+8624*x*z+841*y^2+5684*y*z+9604*z^2-2024*x-1334*y-4508*z+529,
100*x^2-1220*x*y-160*x*z+3721*y^2+976*y*z+64*z^2-580*x+3538*y+464*z+841
Empty file.
3 changes: 3 additions & 0 deletions output_files/nonradical_radicalshape-no-square-qq.p3.res
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
[0, [1,
[[[-3 / 2^2, -5 / 2^3], [-3 / 2^2, -5 / 2^3], [5 / 2^3, 3 / 2^2]]]
]]:
16 changes: 16 additions & 0 deletions output_files/nonradical_radicalshape-no-square-qq.res
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
[0, [0,
4,
8,
['x', 'y', 'z', 'A'],
[30/256,-17/256,-5/256,-13/256],
[1,
[[1, [2957511, 3454087]],
[0, [3454087]],
[
[[0, [2186132]],
1],
[[0, [2325791]],
1],
[[0, [-2480426]],
1]
]]]]]:
34 changes: 26 additions & 8 deletions src/msolve/msolve.c
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,7 @@ static inline void mpz_param_out_str(FILE *file, const data_gens_ff_t *gens,
}
}
for(int i = 0; i < param->nvars - 1; i++){
fprintf(file, "%d,", gens->random_linear_form[i]);
fprintf(file, "%d", gens->random_linear_form[i]);
if(gens->field_char == 0){
fprintf(file, "/%d", sum);
}
Expand Down Expand Up @@ -4913,10 +4913,19 @@ int core_msolve(
if(gens->change_var_order >= 0){
undo_variable_order_change(gens);
}
if (add_random_linear_form_to_input_system(gens, info_level)) {
goto restart;
}
}
if (genericity_handling == 2) {
if (add_random_linear_form_to_input_system(gens, info_level)) {
goto restart;
}
}
fprintf(stderr, "\n=====> Computation failed <=====\n");
fprintf(stderr, "Try to add a random linear form with ");
fprintf(stderr, "a new variable\n");
fprintf(stderr, "(smallest w.r.t. DRL) to the input system. ");
fprintf(stderr, "This will\n");
fprintf(stderr, "be done automatically if you run msolve with option\n");
fprintf(stderr, "\"-c2\" which is the default.\n");
}
}
else {
/* normal_form is 1 */
Expand Down Expand Up @@ -5575,9 +5584,18 @@ int core_msolve(
if(gens->change_var_order >= 0){
undo_variable_order_change(gens);
}
if (add_random_linear_form_to_input_system(gens, info_level)) {
goto restart;
}
if (genericity_handling == 2) {
if (add_random_linear_form_to_input_system(gens, info_level)) {
goto restart;
}
}
fprintf(stderr, "\n=====> Computation failed <=====\n");
fprintf(stderr, "Try to add a random linear form with ");
fprintf(stderr, "a new variable\n");
fprintf(stderr, "(smallest w.r.t. DRL) to the input system. ");
fprintf(stderr, "This will\n");
fprintf(stderr, "be done automatically if you run msolve with option\n");
fprintf(stderr, "\"-c2\" which is the default.\n");
}
}

Expand Down
51 changes: 51 additions & 0 deletions test/diff/diff_nonradical_radicalshape-no-square-31.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
#!/bin/bash

file=nonradical_radicalshape-no-square-31

# source test/diff/diff_source.sh

$(pwd)/msolve -f input_files/$file.ms -o test/diff/$file.res \
-P 2 -l 2 -t 1 -c 0
if [ $? -gt 0 ]; then
exit 3
fi

diff test/diff/$file.res output_files/$file.c0.res
if [ $? -gt 0 ]; then
exit 4
fi

$(pwd)/msolve -f input_files/$file.ms -o test/diff/$file.res \
-P 2 -l 2 -t 2 -c 0
if [ $? -gt 0 ]; then
exit 23
fi

diff test/diff/$file.res output_files/$file.c0.res
if [ $? -gt 0 ]; then
exit 24
fi

$(pwd)/msolve -f input_files/$file.ms -o test/diff/$file.res \
-P 2 -l 44 -t 1 -c 0
if [ $? -gt 0 ]; then
exit 43
fi

diff test/diff/$file.res output_files/$file.c0.res
if [ $? -gt 0 ]; then
exit 44
fi

$(pwd)/msolve -f input_files/$file.ms -o test/diff/$file.res \
-P 2 -l 44 -t 2 -c 0
if [ $? -gt 0 ]; then
exit 63
fi

diff test/diff/$file.res output_files/$file.c0.res
if [ $? -gt 0 ]; then
exit 64
fi

rm test/diff/$file.res
75 changes: 75 additions & 0 deletions test/diff/diff_nonradical_radicalshape-no-square-qq.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,75 @@
#!/bin/bash

file=nonradical_radicalshape-no-square-qq

# source test/diff/diff_source.sh

$(pwd)/msolve -f input_files/$file.ms -o test/diff/$file.res \
-p 3 -l 2 -t 1
if [ $? -gt 0 ]; then
exit 3
fi

diff test/diff/$file.res output_files/$file.p3.res
if [ $? -gt 0 ]; then
exit 4
fi

$(pwd)/msolve -f input_files/$file.ms -o test/diff/$file.res \
-P 2 -l 2 -t 1 -c 0
if [ $? -ne 1 ]; then
exit 5
fi

$(pwd)/msolve -f input_files/$file.ms -o test/diff/$file.res \
-p 3 -l 2 -t 2
if [ $? -gt 0 ]; then
exit 23
fi

diff test/diff/$file.res output_files/$file.p3.res
if [ $? -gt 0 ]; then
exit 24
fi

$(pwd)/msolve -f input_files/$file.ms -o test/diff/$file.res \
-P 2 -l 2 -t 2 -c 0
if [ $? -ne 1 ]; then
exit 25
fi

$(pwd)/msolve -f input_files/$file.ms -o test/diff/$file.res \
-p 3 -l 44 -t 1
if [ $? -gt 0 ]; then
exit 43
fi

diff test/diff/$file.res output_files/$file.p3.res
if [ $? -gt 0 ]; then
exit 44
fi

$(pwd)/msolve -f input_files/$file.ms -o test/diff/$file.res \
-P 2 -l 44 -t 1 -c 0
if [ $? -ne 1 ]; then
exit 45
fi

$(pwd)/msolve -f input_files/$file.ms -o test/diff/$file.res \
-p 3 -l 44 -t 2
if [ $? -gt 0 ]; then
exit 63
fi

diff test/diff/$file.res output_files/$file.p3.res
if [ $? -gt 0 ]; then
exit 64
fi

$(pwd)/msolve -f input_files/$file.ms -o test/diff/$file.res \
-P 2 -l 44 -t 2 -c 0
if [ $? -ne 1 ]; then
exit 65
fi

rm test/diff/$file.res

0 comments on commit 40731f1

Please sign in to comment.