-
-
Notifications
You must be signed in to change notification settings - Fork 480
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
RealSet: Faster operations by scan-line (merging) techniques #32181
Comments
Commit: |
Branch pushed to git repo; I updated commit sha1. New commits: |
This comment has been minimized.
This comment has been minimized.
comment:8
If you merge the most current beta (9.7.beta6), you can use https://trac.sagemath.org/wiki/ReleaseTours/sage-9.7#Validatingdocstringwith.sage-tox-erst |
Branch pushed to git repo; I updated commit sha1. New commits:
|
comment:10
|
comment:11
The current code does not pass the doc-tests. |
comment:12
I took a look through the code, but didn't run the code.
|
Branch pushed to git repo; I updated commit sha1. New commits:
|
Branch pushed to git repo; I updated commit sha1. New commits:
|
Branch pushed to git repo; I updated commit sha1. New commits:
|
comment:41
Replying to @yuan-zhou:
|
comment:42
If you want, you can add a deprecation for the |
Branch pushed to git repo; I updated commit sha1. New commits:
|
Branch pushed to git repo; I updated commit sha1. New commits:
|
comment:45
Here's a microbenchmark: Before:
With this ticket:
|
comment:46
Does the overhead look acceptable on the above examples? |
comment:47
What do you have in mind there? |
This comment has been minimized.
This comment has been minimized.
comment:49
Somewhere in the original code (mul ?), the empty interval is set to (0, 0)
|
This comment has been minimized.
This comment has been minimized.
comment:51
Is this syntax
|
comment:52
I didn't like it either, since the new code spends a lot of effect to take care of that. I wanted to eliminate that. However, the original code allowed for it (contained doctests of that kind).
|
comment:53
OK, you are right, the old code did allow it. So we have to keep it. |
comment:54
I think you can simplify it further by making it
When used as a bound method, But it could also be used as an unbound method |
comment:55
(Just a suggestion, it's fine as it) |
comment:56
Replying to @yuan-zhou:
Yes, I think it's fine. My guess is that it could be improved by a custom version of heapq with a fast path for near-trivial cases, or even cythonized. Let's keep this for a possible follow-up ticket. |
Reviewer: Matthias Koeppe |
comment:58
That's a good suggestion, but I incline to leave it as is on this ticket. The reason is the treatments for special cases such as
|
comment:59
Thank you! Replying to @mkoeppe: |
comment:60
Should |
comment:61
Never mind. Without
Replying to @yuan-zhou:
|
Changed branch from u/yzh/realset__faster_operations_by_scan_line__merging__techniques to |
Adapt from:
Union
andIntersection
from pairwise computation to multiple realsets with scan-line algorithm. In order to compare the performance of the scan-line and orginial methods, we use different dataset to test the CPU time the random generator and timing test code can find in this page:normalize
and also makenormalize
optionally. After replacing it, we test it with 500,000 random intervals, the original methods take 151 second to construct it; scan-line methods only took 18 seconds.difference
,symmetric_difference
andare_pairwise_disjoint
with scan-line methods. We use 1000 realsets each realsets containing 1000 random intervals as the testing dataset. The original methods found the difference between two real sets took 11 seconds on average, and the new methods only took 0.021 seconds on average; symmetric_differnce also has a similar result.convex_hull
andis_connected
inRealSet
.Depends on #34252
CC: @yuan-zhou
Component: geometry
Author: Yueqi Li, Yuan Zhou
Branch/Commit:
1ef7dd1
Reviewer: Matthias Koeppe
Issue created by migration from https://trac.sagemath.org/ticket/32181
The text was updated successfully, but these errors were encountered: