Skip to main content

Crate sim_lib_discrete_comb

Crate sim_lib_discrete_comb 

Source
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 cookbook::FiniteEnumerationDemo;
pub use cookbook::RankableValuesDemo;
pub use cookbook::finite_enumeration_demo;
pub use cookbook::rankable_values_demo;
pub use count::MAX_BINOMIAL_INPUT;
pub use count::MAX_FACTORIAL_INPUT;
pub use count::MAX_PARTITION_INPUT;
pub use count::bell_number;
pub use count::binomial;
pub use count::binomial_checked;
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;
pub use word::MixedRadixWords;
pub use word::canonical_cycles;
pub use word::digits_to_word;
pub use word::longest_only;
pub use word::word_count;
pub use word::word_radices;
pub use word::word_rank;
pub use word::word_to_digits;
pub use word::word_unrank;
pub use word::words;

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.
cookbook
Deterministic cookbook builders for discrete combinatorics recipes.
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 n in ascending-composition order (Kelleher’s accel_asc). The iterator is genuinely lazy, so large n is 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.
word
Fixed-alphabet words, cyclic patterns, and longest-only selection.

Statics§

RECIPES
Cookbook recipes for this lib, embedded at build time.