Opened 7 years ago

Closed 7 years ago

#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: Merged in:
Authors: Reviewers:
Report Upstream: Work issues:
Branch: Commit:
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 (1)

1214.patch (2.3 KB) - added by mhansen 7 years ago.

Download all attachments as: .zip

Change History (5)

comment:1 Changed 7 years ago by mhansen

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'

Changed 7 years ago by mhansen

comment:2 Changed 7 years ago by mhansen

  • Milestone changed from sage-2.9 to sage-2.8.13
  • 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

comment:3 Changed 7 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$.

comment:4 Changed 7 years ago by mabshoff

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

Merged in 2.8.15.alpha1 - I corrected the documentation as Nick suggested.

Note: See TracTickets for help on using tickets.