Struct integer_partitions::Partitions [] [src]

pub struct Partitions { /* fields omitted */ }

Iterates over the partitions of a given positive integer.

Methods

impl Partitions
[src]

[src]

Makes a new iterator.

Panics

Panics if n < 1.

[src]

Advances the iterator and returns the next partition.

[src]

Makes a new iterator, trying to avoid allocations.

Any vector can be passed to this function, since its contents will be cleared and it will be filled with zeroes, but note that the vector will still reallocate if its capacity is less than n + 1.

Panics

Panics if n < 1.

[src]

Destroys the iterator and returns a vector for further use.

You only need to call this function if you want to reuse the vector for something else. Its contents will be in an undefined state, and so cannot be relied upon.