Skip to content

Commit 51a572e

Browse files
committed
Mirror f24f9aa
1 parent 5a7de35 commit 51a572e

2 files changed

Lines changed: 12 additions & 6 deletions

File tree

src/flint/types/fmpz_mod_mpoly.pyx

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -290,6 +290,12 @@ cdef class fmpz_mod_mpoly(flint_mpoly):
290290
def __bool__(self):
291291
return not fmpz_mod_mpoly_is_zero(self.val, self.ctx.val)
292292

293+
def is_zero(self):
294+
return <bint>fmpz_mod_mpoly_is_zero(self.val, self.ctx.val)
295+
296+
def is_one(self):
297+
return <bint>fmpz_mod_mpoly_is_one(self.val, self.ctx.val)
298+
293299
def __richcmp__(self, other, int op):
294300
if not (op == Py_EQ or op == Py_NE):
295301
return NotImplemented
@@ -844,9 +850,6 @@ cdef class fmpz_mod_mpoly(flint_mpoly):
844850
"""
845851
return self.ctx
846852

847-
def is_one(self):
848-
return fmpz_mod_mpoly_is_one(self.val, self.ctx.val)
849-
850853
def coefficient(self, slong i):
851854
"""
852855
Return the coefficient at index `i`.

src/flint/types/nmod_mpoly.pyx

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -270,6 +270,12 @@ cdef class nmod_mpoly(flint_mpoly):
270270
def __bool__(self):
271271
return not nmod_mpoly_is_zero(self.val, self.ctx.val)
272272

273+
def is_zero(self):
274+
return <bint>nmod_mpoly_is_zero(self.val, self.ctx.val)
275+
276+
def is_one(self):
277+
return <bint>nmod_mpoly_is_one(self.val, self.ctx.val)
278+
273279
def __richcmp__(self, other, int op):
274280
if not (op == Py_EQ or op == Py_NE):
275281
return NotImplemented
@@ -811,9 +817,6 @@ cdef class nmod_mpoly(flint_mpoly):
811817
"""
812818
return self.ctx
813819

814-
def is_one(self):
815-
return nmod_mpoly_is_one(self.val, self.ctx.val)
816-
817820
def coefficient(self, slong i):
818821
"""
819822
Return the coefficient at index `i`.

0 commit comments

Comments
 (0)