Opened 15 years ago
Closed 14 years ago
#2360 closed defect (fixed)
[with patch, positive review] Strange Polynomial substitution problem
Reported by: | jbmohler | Owned by: | somebody |
---|---|---|---|
Priority: | major | Milestone: | sage-3.3 |
Component: | basic arithmetic | Keywords: | |
Cc: | Merged in: | ||
Authors: | Reviewers: | ||
Report Upstream: | N/A | Work issues: | |
Branch: | Commit: | ||
Dependencies: | Stopgaps: |
Description
I made a stupid error plugging a list into a polynomial, but it uncovered this very strange bug:
sage: R.<x,y,z,u,v,w>=ZZ[] sage: P.<a>=ZZ[] sage: e=[x^2,y^3] sage: f=6*a^4 sage: f(x) 6*x^4 sage: f(e) Exception exceptions.TypeError: "can't multiply sequence by non-int of type 'list'" in 'sage.rings.polynomial.polynomial_compiled.sqr_pd.eval' ignored Exception exceptions.TypeError: "unsupported operand type(s) for *: 'NoneType' and 'NoneType'" in 'sage.rings.polynomial.polynomial_compiled.sqr_pd.eval' ignored Exception exceptions.TypeError: "unsupported operand parent(s) for '*': 'Integer Ring' and '<type 'NoneType'>'" in 'sage.rings.polynomial.polynomial_compiled.mul_pd.eval' ignored sage: f(x) Exception exceptions.TypeError: "can't multiply sequence by non-int of type 'list'" in 'sage.rings.polynomial.polynomial_compiled.sqr_pd.eval' ignored Exception exceptions.TypeError: "unsupported operand type(s) for *: 'NoneType' and 'NoneType'" in 'sage.rings.polynomial.polynomial_compiled.sqr_pd.eval' ignored Exception exceptions.TypeError: "unsupported operand parent(s) for '*': 'Integer Ring' and '<type 'NoneType'>'" in 'sage.rings.polynomial.polynomial_compiled.mul_pd.eval' ignored
Notice that the plugging in the list seemed to ruin the polynomial good and proper.
Attachments (1)
Change History (8)
comment:1 Changed 15 years ago by
Component: | algebraic geometry → basic arithmetic |
---|---|
Milestone: | → sage-2.10.3 |
Owner: | changed from was to somebody |
comment:2 Changed 15 years ago by
comment:3 Changed 14 years ago by
Summary: | Strange Polynomial substitution problem → [with patch, needs review] Strange Polynomial substitution problem |
---|
The attached patch fixes the issue. Credit goes to Tom Boothby too.
comment:4 Changed 14 years ago by
Summary: | [with patch, needs review] Strange Polynomial substitution problem → [with patch, needs work] Strange Polynomial substitution problem |
---|
The patch fixes the issue, but I'd rather have the original error about multiplying lists propagate up instead of a generic "RuntimeError?: Polynomial evaluation error in val()!"
Changed 14 years ago by
Attachment: | trac_2360_fix.patch added |
---|
comment:5 Changed 14 years ago by
Summary: | [with patch, needs work] Strange Polynomial substitution problem → [with patch, needs review] Strange Polynomial substitution problem |
---|
I updated the patch.
comment:6 Changed 14 years ago by
Summary: | [with patch, needs review] Strange Polynomial substitution problem → [with patch, positive review] Strange Polynomial substitution problem |
---|
OK, that looks good.
comment:7 Changed 14 years ago by
Milestone: | sage-3.4.1 → sage-3.3 |
---|---|
Resolution: | → fixed |
Status: | new → closed |
Merged in Sage 3.3.alpha2.
Cheers,
Michael
Note: See
TracTickets for help on using
tickets.
Ah, it's even easier. No second mpoly ring required!