Skip to content

Conversation

@mohabsafey
Copy link
Contributor

This PR fixes a bug occurring for non radical ideals (when the radical is not in shape position).
The bug was precisely in the choice of new linear forms to be introduced.

Copy link
Contributor

@jerebertho jerebertho left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Many thanks!

Copy link
Contributor

@jerebertho jerebertho Jan 23, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You might be able to simplify the function equal_param by calling nmod_poly_equal on param->coords[i] and test_param->coords[i] in the outer loop.

See below.

*bsz, *nlins_ptr, linvars, lineqs_ptr[0], squvars,
0, bdata_fglm, bdata_bms, success, md);
int boo = equal_param(*bparam, *test_nmod_param);
if(boo == 0){
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
if(boo == 0){
if(! boo){

test/diff/diff_reals_dim0-chgvar.sh \
test/diff/diff_reals_dim0-extract.sh \
test/diff/diff_reals_dim0-swapvar.sh \
test/diff/diff_choice-linear-form.sh \
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
test/diff/diff_choice-linear-form.sh \
test/diff/diff_choice-linear-form-qq.sh \

test/diff/diff_reals_dim0-extract.sh \
test/diff/diff_reals_dim0-swapvar.sh \
test/diff/diff_choice-linear-form.sh \
test/diff/diff_choice-linear-form-real-roots.sh \
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
test/diff/diff_choice-linear-form-real-roots.sh \
test/diff/diff_choice-linear-form-qq-real-roots.sh \

test/diff/diff_radical_shape-qq.sh:test/diff/diff_radical_shape-qq.sh
input_files/choice-linear-form-qq.ms:input_files/choice-linear-form-qq.ms
output_files/choice-linear-form-qq.res:output_files/choice-linear-form-qq.res
test/diff/diff_choice-linear-form.sh:test/diff/diff_choice-linear-form.sh
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
test/diff/diff_choice-linear-form.sh:test/diff/diff_choice-linear-form.sh
test/diff/diff_choice-linear-form-qq.sh:test/diff/diff_choice-linear-form-qq.sh

test/diff/diff_choice-linear-form.sh:test/diff/diff_choice-linear-form.sh
input_files/choice-linear-form-qq-real-roots.ms:input_files/choice-linear-form-qq-real-roots.ms
output_files/choice-linear-form-qq-real-roots.res:output_files/choice-linear-form-qq-real-roots.res
test/diff/diff_choice-linear-form-real-roots.sh:test/diff/diff_choice-linear-form-real-roots.sh
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
test/diff/diff_choice-linear-form-real-roots.sh:test/diff/diff_choice-linear-form-real-roots.sh
test/diff/diff_choice-linear-form-qq-real-roots.sh:test/diff/diff_choice-linear-form-qq-real-roots.sh

* */
static int equal_param(param_t *param, param_t *test_param){
for(int i = 0; i < param->nvars-1; i++){
if(param->coords[i]->length != test_param->coords[i]->length){
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
if(param->coords[i]->length != test_param->coords[i]->length){
if(! nmod_poly_equal (param->coords[i], test_param->coords[i])){
return 0;
}

and then remove everything below until the end of the outer loop.

Disclaimer: this should be tested.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Rename test/diff/diff_choice-linear-form-qq-real-roots.sh

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Rename test/diff/diff_choice-linear-form-qq.sh

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants