-
Notifications
You must be signed in to change notification settings - Fork 126
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
Convert partition methods to return iterators #3389
Convert partition methods to return iterators #3389
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good to me so far, but I'm not really an expert on iterators either. Thank you for working on this!
4147993
to
6f591d2
Compare
6f591d2
to
96eb52e
Compare
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #3389 +/- ##
==========================================
- Coverage 82.80% 81.24% -1.56%
==========================================
Files 577 580 +3
Lines 78494 79268 +774
==========================================
- Hits 64995 64404 -591
- Misses 13499 14864 +1365
|
`nmin` -> `n_2min`
f985127
to
a250314
Compare
Co-authored-by: Max Horn <max@quendi.de>
Another question I have: You seem to rely on this being fast. Are there some timing tests to make sure it stays fast? |
f84fef5
to
262eca4
Compare
262eca4
to
5a5b613
Compare
This is an ancient issue #697... Also, in this case the comparison is not completely fair. From my experience with the other combinatoric's things, calling |
I didn't mean to compare to the older version, I simply wanted to recommend adding some performance tests now. They could just be for the iterator without |
Co-authored-by: Lars Göttgens <lars.goettgens@gmail.com>
@lkastner how do you envision performance tests would work? I.e. who would run them to test for performance regressions? We can't do this in CI, as timings fluctuate wildly. |
But we already do run timing tests in CI? https://github.com/oscar-system/Oscar.jl/blob/master/test/PolyhedralGeometry/timing.jl |
I think #3389 (comment) is the only unresolved comment above. |
I'll assume that one can replace the |
With the recent migration of combinatorics functions from
experimental
tosrc
in #3159 , there is some work to be done converting the methods to return iterators instead of very large collections of combinatorial objects. This is work to address #3147Here we are converting the methods that focus on returning integer partitions.
There are 3 different "batches" of partition methods that need to be converted in this way.
partitions(n)
for computing all integer partitions of n - this has been convertedpartitions(n,m)
(also optionally with upper/lower bounds) for partitioning into a fixed number of parts - this has been converted.partitions(n,v)
where v is a vector of allowed values to use in the partition (with options to specify the number of parts, or to restrict the multiplicities of the allowed values) - this one still needs to be converted.