pub fn exhaustive_b_tree_sets_min_length<I: Clone + Iterator>(
    min_length: u64,
    xs: I
) -> ExhaustiveOrderedUniqueCollections<I, BTreeSet<I::Item>>Notable traits for ExhaustiveOrderedUniqueCollections<I, C>impl<I: Iterator, C: FromIterator<I::Item>> Iterator for ExhaustiveOrderedUniqueCollections<I, C> where
    I::Item: Clone
type Item = C;
where
    I::Item: Clone + Ord
Expand description

Generates BTreeSets with a mininum length, with elements from a single iterator.

The BTreeSets are ordered lexicographically with respect to the order of the element iterator.

The source iterator should not repeat any elements, but this is not enforced.

The iterator should be finite; if it is infinite, only prefixes of the iterator will be generated.

If the input iterator is infinite, the output length is also infinite.

If the input iterator length is $n$ and the min_length is $\ell$, the output length is $$ \sum_{i=\ell}^n \binom{n}{i}. $$

Examples

extern crate itertools;
#[macro_use]
extern crate maplit;

use itertools::Itertools;
use malachite_base::sets::exhaustive::exhaustive_b_tree_sets_min_length;

fn main() {
    let xss = exhaustive_b_tree_sets_min_length(2, 1..=4).collect_vec();
    assert_eq!(
        xss,
        &[
            btreeset!{1, 2},
            btreeset!{1, 3},
            btreeset!{2, 3},
            btreeset!{1, 2, 3},
            btreeset!{1, 4},
            btreeset!{2, 4},
            btreeset!{1, 2, 4},
            btreeset!{3, 4},
            btreeset!{1, 3, 4},
            btreeset!{2, 3, 4},
            btreeset!{1, 2, 3, 4}
        ]
    );
}