Skip to content

Commit 40862be

Browse files
committed
Rename fmpq_mpoly.zpoly into primitive, zcontent into content
Also fix their docstring tests.
1 parent 725a194 commit 40862be

3 files changed

Lines changed: 13 additions & 13 deletions

File tree

‎README.md‎

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -168,14 +168,14 @@ CHANGELOG
168168

169169
Contributors (0.10.0):
170170

171-
- Insert Name (IN)
171+
- Vitaly Magerya (VM)
172172

173173
Changes (0.10.0):
174174

175-
- [gh-322](https://github.com/flintlib/python-flint/pull/322), Add `zcontent`
176-
and `zpoly` methods to `fmpq_mpoly`, to get the primitive integer polynomial
177-
of self and the `fmpq` content (the internal representation of the
178-
`fmpq_mpoly`). (IN)
175+
- [gh-421](https://github.com/flintlib/python-flint/pull/421),
176+
Add `primitive` and `content` methods to `fmpq_mpoly`, to get
177+
the primitive integer polynomial and the `fmpq` content, which
178+
form the internal representation of the `fmpq_mpoly`. (VM)
179179

180180
0.9.0
181181
-----

‎src/flint/types/fmpq_mpoly.pyi‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -102,8 +102,8 @@ class fmpq_mpoly(flint_mpoly[fmpq_mpoly_ctx, fmpq, ifmpq]):
102102
def xgcd(self, other: fmpq_mpoly, /) -> fmpq: ...
103103
def term_content(self) -> fmpq_mpoly: ...
104104

105-
def zpoly(self) -> fmpz_mpoly: ...
106-
def zcontent(self) -> fmpq: ...
105+
def primitive(self) -> fmpz_mpoly: ...
106+
def content(self) -> fmpq: ...
107107

108108
def factor(self) -> tuple[fmpq, list[tuple[fmpq_mpoly, int]]]: ...
109109
def factor_squarefree(self) -> tuple[fmpq, list[tuple[fmpq_mpoly, int]]]: ...

‎src/flint/types/fmpq_mpoly.pyx‎

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -785,30 +785,30 @@ cdef class fmpq_mpoly(flint_mpoly):
785785
fmpq_mpoly_term_content(res.val, self.val, self.ctx.val)
786786
return res
787787

788-
def zpoly(self):
788+
def primitive(self):
789789
"""
790790
Return the integer polynomial of ``self``. The product
791-
of this and ``self.zcontent()``, represents the whole
791+
of this and ``self.content()``, represents the whole
792792
polynomial.
793793
794794
>>> ctx = fmpq_mpoly_ctx.get(("x","y"))
795795
>>> x, y = ctx.gens()
796-
>>> (fmpq(2,3)*x + fmpq(2,5)*y).zpoly()
796+
>>> (x*2/3 + y*2/5).primitive()
797797
5*x + 3*y
798798
"""
799799
cdef fmpz_mpoly_ctx zctx = fmpz_mpoly_ctx.from_context(self.ctx)
800800
cdef fmpz_mpoly res = create_fmpz_mpoly(zctx)
801801
fmpz_mpoly_set(res.val, self.val.zpoly, zctx.val)
802802
return res
803803

804-
def zcontent(self):
804+
def content(self):
805805
"""
806806
Return the content of ``self``. The product of this and
807-
``self.zpoly()``, represents the whole polynomial.
807+
``self.primitive()``, represents the whole polynomial.
808808
809809
>>> ctx = fmpq_mpoly_ctx.get(("x","y"))
810810
>>> x, y = ctx.gens()
811-
>>> (fmpq(2,3)*x + fmpq(2,5)*y).zcontent()
811+
>>> (x*2/3 + y*2/5).content()
812812
2/15
813813
"""
814814
cdef fmpq res = fmpq.__new__(fmpq)

0 commit comments

Comments
 (0)