File tree Expand file tree Collapse file tree 1 file changed +19
-0
lines changed
src/sage/rings/polynomial Expand file tree Collapse file tree 1 file changed +19
-0
lines changed Original file line number Diff line number Diff line change @@ -5298,6 +5298,25 @@ cdef class MPolynomial_libsingular(MPolynomial_libsingular_base):
5298
5298
self ._parent._singular_().set_ring()
5299
5299
return self ._repr_short_()
5300
5300
5301
+ def _singular_ (self , singular = None ):
5302
+ """
5303
+ Override :meth:`sage.structure.sage_object.SageObject._singular_`
5304
+ to declare the type of ``self`` to be ``'poly'``.
5305
+ Needed because even with ``setring``, constant polynomials are not considered
5306
+ polynomials of the current ring.
5307
+
5308
+ TESTS::
5309
+
5310
+ sage: R.<x,y> = Zmod(5)[]
5311
+ sage: a = singular(R(2)) + singular(R(2)) + singular(R(1)); a
5312
+ 0
5313
+ sage: a == singular(R(0))
5314
+ True
5315
+ """
5316
+ if singular is None :
5317
+ from sage.interfaces.singular import singular
5318
+ return singular(self ._singular_init_(singular), type = ' poly' )
5319
+
5301
5320
def sub_m_mul_q (self , MPolynomial_libsingular m , MPolynomial_libsingular q ):
5302
5321
"""
5303
5322
Return ``self - m*q``, where ``m`` must be a monomial and
You can’t perform that action at this time.
0 commit comments