itertools
itertools copied to clipboard
implement Iterator::nth for Combinations
Hello!
I have implemented nth
method for Combinations
iterator.
Closes #301 .
Let me know, what do you think. Other changes in tests are due to rustfmt
.
I have rebased this on master
.
Thanks! I'll take a look at this soon.
@fyrchik I've filed a PR adding a quickcheck test on your feature branch: https://github.com/fyrchik/rust-itertools/pull/1
That test case is finding differences between the output of your specialized Combinations::nth
and the current unspecialized method.
The specialized version of Combinations::nth
needs to behave identically to the current unspecialized method before I can merge this PR.
I have reimplemented this and got rid of binomial coefficients.
We are still advancing iterator one-by-one, however there are no intermediate allocations.
I have also added quickcheck
tests from @jswrenn to be sure that new implementations behaves similar to the old.
Thanks! Could you resolve the merge conflict? Also, note that the behavior of combinations(0)
changed in #383.
I have rebased on master. cargo +nightly test
finished successfully.
Hi @fyrchik, Combinations
has evolved a bit since you worked on this.
Do you want to update your work here? I would promptly respond/review.
We now have tests about specializations so I don't think we need your tests.
EDIT: Well, I see all your repositories are archived, I'm closing this. I'll probably make this myself when I find more time unless someone does this before me.