Skip to content

Conversation

@jacksonhenry3
Copy link

Summary:

This pull request impls the iterator trait for the Partitions struct so it can be used as an iterator directly.

Description:

  • Added an iterator implementation to the Partitions struct.
  • The iterator yields Vec<usize>, where each vec represents a partition.

Testing:

Tested against the existing oeis test case, ensuring that the iterator still yields the expected partitions for the first few entries of A000041.

@colt-browning
Copy link
Contributor

Win in usability, but loss in performance: this implementation allocates a new vector at each iteration.
(Just pointing this out, not implying that this is good or bad.)

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