Ticket #1214 (closed defect: fixed)
[with patch, with positive review] error in polynomial ideal membership testing
| Reported by: | mhansen | Owned by: | mhansen |
|---|---|---|---|
| Priority: | major | Milestone: | sage-2.8.15 |
| Component: | commutative algebra | Keywords: | |
| Cc: | Work issues: | ||
| Report Upstream: | Reviewers: | ||
| Authors: | Merged in: | ||
| Dependencies: | Stopgaps: |
Description
sage: x^2 in I
---------------------------------------------------------------------------
<type 'exceptions.AttributeError'> Traceback (most recent call last)
/opt/maple11/lib/<ipython console> in <module>()
/opt/sage/local/lib/python2.5/site-packages/sage/rings/ideal.py in __contains__(self, x)
315 if self.gen().is_zero():
316 return x.is_zero()
--> 317 return self.gen().divides(x)
318
319 def __cmp__(self, other):
<type 'exceptions.AttributeError'>: 'Polynomial_rational_dense' object has no attribute 'divides'
Attachments
Change History
comment:2 Changed 6 years ago by mhansen
- Owner changed from malb to mhansen
- Status changed from new to assigned
- Summary changed from error in polynomial ideal membership testing to [with patch] error in polynomial ideal membership testing
- Milestone changed from sage-2.9 to sage-2.8.13
comment:3 Changed 6 years ago by ncalexan
- Summary changed from [with patch] error in polynomial ideal membership testing to [with patch, with positive review] error in polynomial ideal membership testing
This patch should be applied -- doctests are excellent and I think the divides() function is good.
There is a typo:
1624 def divides(self, x): 1625 """ 1626 Return True if self divides n.
$n$ should be $x$.
Note: See
TracTickets for help on using
tickets.


sage: P.<x> = PolynomialRing(QQ) sage: I = P.ideal(x^2-2) sage: x^2 in I --------------------------------------------------------------------------- <type 'exceptions.AttributeError'> Traceback (most recent call last) /opt/maple11/lib/<ipython console> in <module>() /opt/sage/local/lib/python2.5/site-packages/sage/rings/ideal.py in __contains__(self, x) 315 if self.gen().is_zero(): 316 return x.is_zero() --> 317 return self.gen().divides(x) 318 319 def __cmp__(self, other): <type 'exceptions.AttributeError'>: 'Polynomial_rational_dense' object has no attribute 'divides' sage: P.<x> = PolynomialRing(ZZ) sage: I = P.ideal(x^2-2) sage: x^2 in I --------------------------------------------------------------------------- <type 'exceptions.AttributeError'> Traceback (most recent call last) /opt/maple11/lib/<ipython console> in <module>() /opt/sage/local/lib/python2.5/site-packages/sage/rings/ideal.py in __contains__(self, x) 315 if self.gen().is_zero(): 316 return x.is_zero() --> 317 return self.gen().divides(x) 318 319 def __cmp__(self, other): <type 'exceptions.AttributeError'>: 'sage.rings.polynomial.polynomial_integer_dense_ntl' object has no attribute 'divides'