Expand description
Discrete combinatorics.
This crate hosts exact counting functions (over num_bigint::BigUint), lazy
enumerators, and canonical combinadic / Lehmer / mixed-radix rank-unrank
helpers. These ordinals are the bridge to rank, but this crate never depends
on sim-lib-rank.
Re-exports§
pub use bit_vector::BitVectorIter;pub use bit_vector::bit_vector_rank;pub use bit_vector::bit_vector_unrank;pub use bit_vector::bit_vectors;pub use cards::CardSpec;pub use cards::combinatorics_cards;pub use combination::CombinationIter;pub use combination::combination_rank;pub use combination::combination_unrank;pub use combination::combinations;pub use count::MAX_FACTORIAL_INPUT;pub use count::MAX_PARTITION_INPUT;pub use count::bell_number;pub use count::binomial;pub use count::factorial;pub use count::factorial_checked;pub use count::falling_factorial;pub use count::integer_partition_count;pub use count::integer_partition_count_checked;pub use count::multinomial;pub use count::permutation_count;pub use count::stirling2;pub use error::CombError;pub use mixed_radix::mixed_radix_rank;pub use mixed_radix::mixed_radix_unrank;pub use partition::IntegerPartitionIter;pub use partition::integer_partitions;pub use permutation::PermutationIter;pub use permutation::permutation_rank;pub use permutation::permutation_unrank;pub use permutation::permutations;pub use subset::SubsetIter;pub use subset::subset_rank;pub use subset::subset_unrank;pub use subset::subsets;
Modules§
- bit_
vector - Fixed-width bit vectors in natural binary order, with rank/unrank.
- cards
- Browse/help card content for the combinatorics family, as static data.
- combination
k-combinations of{0, ..., n-1}in lexicographic order, with rank/unrank.- count
- Exact combinatorial counting functions over
num_bigint::BigUint. - error
- Error type for discrete combinatorics.
- mixed_
radix - Bounded integer vectors under a mixed-radix numeral system, with rank/unrank.
- partition
- Integer partitions of
nin ascending-composition order (Kelleher’saccel_asc). The iterator is genuinely lazy, so largenis safe to start. - permutation
- Permutations of
{0, ..., n-1}in lexicographic order, with Lehmer-code rank/unrank. - subset
- Subsets of
{0, ..., n-1}in bitmask order, with rank/unrank.