Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

improve approximate order on __getitem__ calls #34556

Closed
mantepse opened this issue Sep 19, 2022 · 7 comments · Fixed by #35265
Closed

improve approximate order on __getitem__ calls #34556

mantepse opened this issue Sep 19, 2022 · 7 comments · Fixed by #35265

Comments

@mantepse
Copy link
Collaborator

We improve the approximate order of a stream whenever Stream_inexact.__getitem__ is called.

This may slow down Stream_inexact.__getitem__ but should speed up other operations.

It must be checked carefully whether this is an overall improvement or not.

Depends on #34552

CC: @tscrim

Component: combinatorics

Keywords: LazyPowerSeries

Author: Martin Rubey

Branch/Commit: u/mantepse/improve_approximate_order_on___getitem___calls @ 5a2cb8b

Issue created by migration from https://trac.sagemath.org/ticket/34556

@mantepse mantepse added this to the sage-9.8 milestone Sep 19, 2022
@mantepse
Copy link
Collaborator Author

@sagetrac-git
Copy link
Mannequin

sagetrac-git mannequin commented Sep 19, 2022

Branch pushed to git repo; I updated commit sha1. New commits:

5a2cb8bimprove approximate order when getitem is called

@sagetrac-git
Copy link
Mannequin

sagetrac-git mannequin commented Sep 19, 2022

Commit: 5a2cb8b

@mantepse
Copy link
Collaborator Author

Dependencies: #34552

@mantepse

This comment has been minimized.

@mantepse
Copy link
Collaborator Author

Changed keywords from none to LazyPowerSeries

@mantepse
Copy link
Collaborator Author

Author: Martin Rubey

@mkoeppe mkoeppe removed this from the sage-9.8 milestone Jan 29, 2023
@mantepse mantepse added this to the sage-10.0 milestone Mar 22, 2023
vbraun pushed a commit that referenced this issue Apr 1, 2023
    
<!-- ^^^^^
Please provide a concise, informative and self-explanatory title.
Don't put issue numbers in there, do this in the PR body below.
For example, instead of "Fixes #1234" use "Introduce new method to
calculate 1+1"
-->
### 📚 Description

Calling `Stream_inexact.__getitem__(n)` for `n ==
self._approximate_order`, we can update `self._true_order` and
`self._approximate_order` as follows:

* if the result is non-zero, we now know that `n` is the true order
* otherwise, we know that `n+1` is a lower bound for the order.
<!-- Describe your changes here in detail -->
<!-- Why is this change required? What problem does it solve? -->
<!-- If it resolves an open issue, please link to the issue here. For
example "Closes #1337" -->

This fixes #35261, but it may not be the best fix, because it
potentially makes `__getitem__` slower.

Fixes #34556, which was the original issue.

### 📝 Checklist

<!-- Put an `x` in all the boxes that apply. -->
<!-- If your change requires a documentation PR, please link it
appropriately -->
<!-- If you're unsure about any of these, don't hesitate to ask. We're
here to help! -->

- [x] I have made sure that the title is self-explanatory and the
description concisely explains the PR.
- [x] I have linked an issue or discussion.
- [x] I have created tests covering the changes.
- [x] I have updated the documentation accordingly.

### ⌛ Dependencies
<!-- List all open pull requests that this PR logically depends on -->
<!--
- #xyz: short description why this is a dependency
- #abc: ...
-->
    
URL: #35265
Reported by: Martin Rubey
Reviewer(s): Martin Rubey, Travis Scrimshaw
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants