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

New method for subsets of fixed size? #12

Closed
ettersi opened this issue Nov 17, 2017 · 3 comments
Closed

New method for subsets of fixed size? #12

ettersi opened this issue Nov 17, 2017 · 3 comments

Comments

@ettersi
Copy link
Contributor

ettersi commented Nov 17, 2017

I want to iterate over all unordered pairs in a collection A. Thanks to this package, the easiest way to do this is to use subsets(A,2), but this seems rather wasteful as it does not exploit that I know at compile time the size of the set. So I suggest to add a method subsets(xs,::Type{Val{k}}) which can do so.

I'd be happy to provide a PR, but I first wanted to check that there's a chance it will make it into this package. Also, it would be my first PR ever, so I would likely need some help along the way.

@iamed2
Copy link
Contributor

iamed2 commented Nov 17, 2017

The new suggested way to do type constants would be to define subsets(xs, ::Val{k}) but yes this sounds like a good addition we would welcome.

@ettersi
Copy link
Contributor Author

ettersi commented Nov 18, 2017

Would it be acceptable to introduce a dependency on StaticArrays? Having a mutable statically sized data type would come in handy.

@iamed2
Copy link
Contributor

iamed2 commented Jun 1, 2018

This was added in #13

@iamed2 iamed2 closed this as completed Jun 1, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants