Ticket #1406 (closed defect: fixed)

Opened 5 years ago

Last modified 5 years ago

[with patch] bug in coercion of multivariate polynomials (possibly libsingular related)

Reported by: was Owned by: mhansen
Priority: major Milestone: sage-2.9
Component: basic arithmetic Keywords:
Cc: Work issues:
Report Upstream: Reviewers:
Authors: Merged in:
Dependencies: Stopgaps:

Description

Reducing a polynomial to the libsingular polynomials to GF(pn) is buggy as the following examples all illustrate.

sage: R.<x,y> = QQ[]
sage: S.<xx,yy> = GF(5)[]
sage: S(5*x*y + x + 17*y)
0*xx*yy + xx + 2*yy
sage: R.<x,y> = ZZ[]
sage: S.<xx,yy> = GF(5)[]
sage: R.<x,y> = ZZ[]
sage: S.<xx,yy> = GF(25,'a')[]
sage: S(5*x*y + x + 17*y)
0*xx*yy + xx + 2*yy
sage: type(S(5*x*y + x + 17*y))
<type 'sage.rings.polynomial.multi_polynomial_libsingular.MPolynomial_libsingular'>
sage: R.<x,y> = ZZ[]
sage: S.<xx,yy> = Integers(5)[]
sage: S(5*x*y + x + 17*y)
xx + 2*yy

Attachments

1406.patch Download (2.1 KB) - added by mhansen 5 years ago.
trac-1406.patch Download (2.6 KB) - added by was 5 years ago.
This is a -- I think -- better version of the 1406.patch that mhansen attached -- use it instead.

Change History

comment:1 Changed 5 years ago by mhansen

  • Owner changed from somebody to mhansen
  • Status changed from new to assigned

I have a fix for this, but it causes a segfault in the testing of multi_polynomial_ideal.py .

--Mike

Changed 5 years ago by mhansen

comment:2 Changed 5 years ago by mhansen

  • Summary changed from bug in coercion of multivariate polynomials (possibly libsingular related) to [with patch] bug in coercion of multivariate polynomials (possibly libsingular related)

Changed 5 years ago by was

This is a -- I think -- better version of the 1406.patch that mhansen attached -- use it instead.

comment:3 Changed 5 years ago by was

Bonus -- my patch doesn't cause segfaults in multi_polynomial_ideal.py... I think.

comment:4 Changed 5 years ago by mhansen

Actually, it turns out that that segfault was there all along (with or without the patch). See #1409 .

comment:5 Changed 5 years ago by mabshoff

Ok, looks good to me, merging William's patch.

Cheers,

Michael

comment:6 Changed 5 years ago by mabshoff

  • Status changed from assigned to closed
  • Resolution set to fixed

Merged in 2.9.alpha1.

Note: See TracTickets for help on using tickets.