Skip to content
This repository has been archived by the owner on Mar 6, 2018. It is now read-only.

Commit

Permalink
Document passing in coefficients into valuations()
Browse files Browse the repository at this point in the history
  • Loading branch information
saraedum committed Dec 7, 2016
1 parent 052bd61 commit 1fd47aa
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 2 deletions.
10 changes: 10 additions & 0 deletions augmented_valuation.py
Original file line number Diff line number Diff line change
Expand Up @@ -1540,6 +1540,11 @@ def valuations(self, f, coefficients=None):
- ``f`` -- a polynomial in the domain of this valuation
- ``coefficients`` -- the coefficients of ``f`` as produced by
:meth:`coefficients` or ``None`` (default: ``None``); this can be
used to speed up the computation when the expansion of ``f`` is
already known from a previous computation.
OUTPUT:
An iterator over rational numbers (or infinity) `[v(f_0), v(f_1\phi), \dots]`
Expand Down Expand Up @@ -1703,6 +1708,11 @@ def valuations(self, f, coefficients=None):
- ``f`` -- a polynomial in the domain of this valuation
- ``coefficients`` -- the coefficients of ``f`` as produced by
:meth:`coefficients` or ``None`` (default: ``None``); this can be
used to speed up the computation when the expansion of ``f`` is
already known from a previous computation.
OUTPUT:
An iterator over rational numbers (or infinity) `[v(f_0), v(f_1\phi), \dots]`
Expand Down
9 changes: 7 additions & 2 deletions gauss_valuation.py
Original file line number Diff line number Diff line change
Expand Up @@ -242,14 +242,19 @@ def uniformizer(self):
"""
return self.domain()(self._base_valuation.uniformizer())

def valuations(self, f):
def valuations(self, f, coefficients=None):
"""
Return the valuations of the `f_i\phi^i` in the expansion `f=\sum f_i\phi^i`.
INPUT:
- ``f`` -- a polynomial in the domain of this valuation
- ``coefficients`` -- the coefficients of ``f`` as produced by
:meth:`coefficients` or ``None`` (default: ``None``); this can be
used to speed up the computation when the expansion of ``f`` is
already known from a previous computation.
OUTPUT:
A list, each entry a rational numbers or infinity, the valuations of `f_0, f_1\phi, \dots`
Expand All @@ -267,7 +272,7 @@ def valuations(self, f):
"""
f = self.domain().coerce(f)

for c in self.coefficients(f):
for c in coefficients or self.coefficients(f):
yield self._base_valuation(c)

@cached_method
Expand Down

0 comments on commit 1fd47aa

Please sign in to comment.