Opened 12 years ago
Last modified 8 years ago
#10271 needs_work enhancement
Make big_oh notation work for any element that has a big_oh() method
Reported by: | tkluck | Owned by: | boothby |
---|---|---|---|
Priority: | trivial | Milestone: | sage-6.4 |
Component: | commutative algebra | Keywords: | sd32 |
Cc: | Merged in: | ||
Authors: | Tom Boothby | Reviewers: | Timo Kluck |
Report Upstream: | N/A | Work issues: | add doctest |
Branch: | Commit: | ||
Dependencies: | #11726, #11719 | Stopgaps: |
Description (last modified by )
One can use the big-oh notation
O(x^{n})
when x is a generator of a power series or a laurent series. It is convenient to also be able to use this notation when the parent of x is another ring (for example, a subclass of a power series ring).
The current implementation in rings/big_oh.py
imports a large number of types, which slows down the Sage startup. Elements should implement their own big_oh() methods, and the function O(x)
should simply call x.big_oh()
.
Attachments (3)
Change History (20)
Changed 12 years ago by
comment:1 Changed 11 years ago by
- Status changed from new to needs_review
Changed 11 years ago by
comment:2 Changed 11 years ago by
I just added the patch in the right format, i.e. the output of hg_sage.export() instead of a normal diff.
comment:3 Changed 11 years ago by
- Description modified (diff)
comment:4 Changed 11 years ago by
- Milestone set to sage-4.7.1
- Reviewers set to Mariah Lenox
- Status changed from needs_review to positive_review
Applied patch to sage-4.7.1.alpha2, did 'sage -b', then 'make testlong'. All tests passed. Positive review!
comment:5 Changed 11 years ago by
- Status changed from positive_review to needs_work
- Work issues set to add doctest
I think this patch needs an extra doctest to demonstrate what it does and that it works as expected.
comment:6 Changed 11 years ago by
The following behavior is bad. In both cases, I think one should get an error.
sage: R.<x> = QQ[[]] sage: O(1+x^10) O(x^10) sage: f = x*(1/x + x^9); type(f) <type 'sage.rings.laurent_series_ring_element.LaurentSeries'> sage: O(f) O(x^0)
comment:7 Changed 11 years ago by
- Description modified (diff)
- Owner changed from malb to boothby
comment:8 Changed 11 years ago by
- Summary changed from Make big_oh notation work for any element that has degree() and add_bigoh() properties to Make big_oh notation work for any element that has a big_oh() method
comment:9 Changed 11 years ago by
comment:10 Changed 11 years ago by
- Keywords sd32 added
comment:11 Changed 11 years ago by
- Dependencies set to #11726, #11719
comment:12 Changed 11 years ago by
- Status changed from needs_work to needs_review
comment:13 Changed 9 years ago by
- Reviewers changed from Mariah Lenox to Timo Kluck
- Status changed from needs_review to needs_work
I could have reviewed this sooner, sorry about that. However, the ticket's dependencies are still open, so maybe we should still wait for them to be accepted?
This doesn't apply to v5.4 anymore. I also couldn't easily fix that myself. I'll set the status to needs_work.
comment:14 Changed 9 years ago by
- Milestone changed from sage-5.11 to sage-5.12
comment:15 Changed 8 years ago by
- Milestone changed from sage-6.1 to sage-6.2
comment:16 Changed 8 years ago by
- Milestone changed from sage-6.2 to sage-6.3
comment:17 Changed 8 years ago by
- Milestone changed from sage-6.3 to sage-6.4
patch for sage.rings.big_oh