Add `coefficients(a::AbsPowerSeriesRingElem)`
Codecov Report
All modified and coverable lines are covered by tests :white_check_mark:
Project coverage is 88.03%. Comparing base (
efb6ceb) to head (73f0fdc). Report is 16 commits behind head on master.
Additional details and impacted files
@@ Coverage Diff @@
## master #1811 +/- ##
=======================================
Coverage 88.03% 88.03%
=======================================
Files 119 119
Lines 30057 29995 -62
=======================================
- Hits 26460 26406 -54
+ Misses 3597 3589 -8
:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.
@fieker does that make sense?
Ok, so what I wanted to add is a function that gives me all coefficients (as coeff does for a single one), but skipping the infinite sequence of zeros in the end.
If there is any other clean way to get this, I am happy with using that instead as well.
you need to be thinking about what you want: you want the leading zeros? If the element has a valuation? @lgoettgens what do you need/ want? I think for polys we allow access past the degree - to get 0, for power series (and Laurent) even going to -infty would make sense
I don't really care about leading zeros.
I think having coefficients(a)[i] == coeff(a, i-1) work for all indices of coefficients(a) would be nice (this is as it is for polys).
Bump
It is not clear to me that this right thing. length is not part of the interface and exporting pol_length was a mistake in the first place.
A faithful representation of the power series would need to include the coefficients up precision(x) - 1.
That's true. I adapted the function an tests accordingly.
Off-topic, but: this function looks to me like another example of an extrep function as proposed in https://github.com/oscar-system/Oscar.jl/issues/4151. Which then raises the natural question: do we also have a reverse that takes such a coefficient list and turns it back into a series? E.g. a == parent(a)(coefficients(a)) ?
@fieker this now goes up to precision(x) -1. Are you happy with this?
Unfortunately, due to branch names being weird, this has to get force-merged. @fingolfin @thofma could you do the favor?