Ticket #1214 (closed defect: fixed)

Opened 3 years ago

Last modified 3 years ago

[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: Author(s):
Report Upstream: Reviewer(s):
Merged in: Work issues:

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

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

Change History

Changed 3 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 3 years ago by mhansen

Changed 3 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

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

Changed 3 years ago by mabshoff

  • status changed from assigned to closed
  • resolution set to fixed

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

Note: See TracTickets for help on using tickets.