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

Correcting a comment in EntryStream.java #273

Merged
merged 1 commit into from
Nov 29, 2023
Merged

Correcting a comment in EntryStream.java #273

merged 1 commit into from
Nov 29, 2023

Conversation

kivanval
Copy link
Contributor

in EntryStream.java, in the ofPairs() methods, there was an error in the formula for the size of the output EntryStream.

The ofPairs() methods by its nature calculate all possible combinations of list items (Actually, I don't really understand why it's not called ofCombinations()).

The formula for combinations is as follows:
image

If we take our specific case, where r = 2, the formula will look like this:
image

in EntryStream.java, in the ofPairs() methods, there was an error in the formula for the size of the output EntryStream.
@kivanval kivanval changed the title Correcting a comment Correcting a comment in EntryStream.java Nov 19, 2023
@amaembo amaembo merged commit a26d9c5 into amaembo:master Nov 29, 2023
@amaembo
Copy link
Owner

amaembo commented Nov 29, 2023

Thank you, merged.

Actually, I don't really understand why it's not called ofCombinations()

Because it does not produce any combinations (with arbitrary r), but a partial case with r = 2. There's StreamEx#ofCombinations method that produces any combination vectors.

@amaembo
Copy link
Owner

amaembo commented Nov 29, 2023

By the way, there's the same problem in documentation in StreamEx.ofPairs methods.

@kivanval kivanval deleted the fix/desc branch November 29, 2023 08:33
@kivanval
Copy link
Contributor Author

By the way, there's the same problem in documentation in StreamEx.ofPairs methods.

Can you change it yourself or do I have to make another pull request? :D
For some reason I missed that StreamEx has such a method.

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

Successfully merging this pull request may close these issues.

2 participants